aboutsummaryrefslogtreecommitdiff
path: root/e2e/contents/navigate.test.js
diff options
context:
space:
mode:
authorShin'ya Ueoka <ueokande@i-beam.org>2018-05-13 01:06:01 +0900
committerShin'ya Ueoka <ueokande@i-beam.org>2018-05-13 01:06:01 +0900
commite17399c4df35d5cd55300e9555240818eae5cf2c (patch)
treedafda47994947cf959c79398413faef34681a3a5 /e2e/contents/navigate.test.js
parent5617f6f7650e0eb5711bea5b060e98f0d2e94f46 (diff)
Add e2e test case for history navigations
Diffstat (limited to 'e2e/contents/navigate.test.js')
-rw-r--r--e2e/contents/navigate.test.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/e2e/contents/navigate.test.js b/e2e/contents/navigate.test.js
index 518c3e3..3b34785 100644
--- a/e2e/contents/navigate.test.js
+++ b/e2e/contents/navigate.test.js
@@ -60,4 +60,30 @@ describe("navigate test", () => {
expect(tab.url).to.be.equal(SERVER_URL + '/');
});
});
+
+ it('goes back and forward in history', () => {
+ let targetTab;
+ return tabs.create(targetWindow.id, SERVER_URL + '/#navigate').then((tab) => {
+ targetTab = tab;
+ return keys.press(targetTab.id, 'g');
+ }).then(() => {
+ return keys.press(targetTab.id, 'u');
+ }).then(() => {
+ return keys.press(targetTab.id, 'H', { shiftKey: true });
+ }).then(() => {
+ return new Promise(resolve => { setTimeout(() => resolve(), 2000) });
+ }).then(() => {
+ return tabs.get(targetTab.id);
+ }).then((tab) => {
+ expect(tab.url, 'go back in history').to.be.equal(SERVER_URL + '/#navigate');
+ }).then(() => {
+ return new Promise(resolve => { setTimeout(() => resolve(), 2000) });
+ }).then(() => {
+ return keys.press(targetTab.id, 'L', { shiftKey: true });
+ }).then(() => {
+ return tabs.get(targetTab.id);
+ }).then((tab) => {
+ expect(tab.url, 'go next in history').to.be.equal(SERVER_URL + '/#');
+ });
+ });
});