aboutsummaryrefslogtreecommitdiff
path: root/e2e/contents
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-05-13 14:41:03 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-05-13 14:41:03 +0900
commit28da164e5c630a7d9d0dafe61277814b7b777804 (patch)
tree5627af1533884b7ee284adf36ff268c1954b0e8e /e2e/contents
parentd844440a30a2ae6ddce0ff59af6c7572041f9bb4 (diff)
Add e2e test cases for [[/]]
Diffstat (limited to 'e2e/contents')
-rw-r--r--e2e/contents/navigate.test.js68
1 files changed, 66 insertions, 2 deletions
diff --git a/e2e/contents/navigate.test.js b/e2e/contents/navigate.test.js
index 590a4b3..b9d283d 100644
--- a/e2e/contents/navigate.test.js
+++ b/e2e/contents/navigate.test.js
@@ -70,13 +70,13 @@ describe("navigate test", () => {
}).then(() => {
return keys.press(targetTab.id, 'H', { shiftKey: true });
}).then(() => {
- return new Promise(resolve => { setTimeout(() => resolve(), 2000) });
+ return new Promise(resolve => { setTimeout(() => resolve(), 10) });
}).then(() => {
return tabs.get(targetTab.id);
}).then((tab) => {
expect(tab.url, 'go back in history').to.be.equal(CLIENT_URL + '/#navigate');
}).then(() => {
- return new Promise(resolve => { setTimeout(() => resolve(), 2000) });
+ return new Promise(resolve => { setTimeout(() => resolve(), 10) });
}).then(() => {
return keys.press(targetTab.id, 'L', { shiftKey: true });
}).then(() => {
@@ -85,4 +85,68 @@ describe("navigate test", () => {
expect(tab.url, 'go next in history').to.be.equal(CLIENT_URL + '/#');
});
});
+
+ it('goes previous page by <a>', () => {
+ let targetTab;
+ return tabs.create(targetWindow.id, CLIENT_URL + '/a-pagenation?page=10').then((tab) => {
+ targetTab = tab;
+ return keys.press(targetTab.id, '[');
+ }).then(() => {
+ return keys.press(targetTab.id, '[');
+ }).then(() => {
+ return new Promise(resolve => { setTimeout(() => resolve(), 10) });
+ }).then(() => {
+ return tabs.get(targetTab.id);
+ }).then((tab) => {
+ expect(tab.url).to.be.equal(CLIENT_URL + '/a-pagenation?page=9');
+ });
+ })
+
+ it('goes next page by <a>', () => {
+ let targetTab;
+ return tabs.create(targetWindow.id, CLIENT_URL + '/a-pagenation?page=10').then((tab) => {
+ targetTab = tab;
+ return keys.press(targetTab.id, ']');
+ }).then(() => {
+ return keys.press(targetTab.id, ']');
+ }).then(() => {
+ return new Promise(resolve => { setTimeout(() => resolve(), 10) });
+ }).then(() => {
+ return tabs.get(targetTab.id);
+ }).then((tab) => {
+ expect(tab.url).to.be.equal(CLIENT_URL + '/a-pagenation?page=11');
+ });
+ })
+
+ it('goes previous page by <link>', () => {
+ let targetTab;
+ return tabs.create(targetWindow.id, CLIENT_URL + '/link-pagenation?page=10').then((tab) => {
+ targetTab = tab;
+ return keys.press(targetTab.id, '[');
+ }).then(() => {
+ return keys.press(targetTab.id, '[');
+ }).then(() => {
+ return new Promise(resolve => { setTimeout(() => resolve(), 10) });
+ }).then(() => {
+ return tabs.get(targetTab.id);
+ }).then((tab) => {
+ expect(tab.url).to.be.equal(CLIENT_URL + '/link-pagenation?page=9');
+ });
+ })
+
+ it('goes next page by <link>', () => {
+ let targetTab;
+ return tabs.create(targetWindow.id, CLIENT_URL + '/link-pagenation?page=10').then((tab) => {
+ targetTab = tab;
+ return keys.press(targetTab.id, ']');
+ }).then(() => {
+ return keys.press(targetTab.id, ']');
+ }).then(() => {
+ return new Promise(resolve => { setTimeout(() => resolve(), 10) });
+ }).then(() => {
+ return tabs.get(targetTab.id);
+ }).then((tab) => {
+ expect(tab.url).to.be.equal(CLIENT_URL + '/link-pagenation?page=11');
+ });
+ })
});