diff options
author | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-02-11 15:40:34 +0900 |
---|---|---|
committer | Shin'ya Ueoka <ueokande@i-beam.org> | 2018-02-12 22:04:55 +0900 |
commit | 3f8bbe11d96b751affa9e2bf0a1995008f9e3220 (patch) | |
tree | 70a6f389331ca93bf51b4a5e46a1833817a4bfcf /e2e/contents | |
parent | cf03d278eb8bb8f7544ae6395b76e1a1e0781053 (diff) |
send press key to tabs
Diffstat (limited to 'e2e/contents')
-rw-r--r-- | e2e/contents/scroll.test.js | 19 | ||||
-rw-r--r-- | e2e/contents/tab.test.js | 35 |
2 files changed, 35 insertions, 19 deletions
diff --git a/e2e/contents/scroll.test.js b/e2e/contents/scroll.test.js deleted file mode 100644 index 6cf0042..0000000 --- a/e2e/contents/scroll.test.js +++ /dev/null @@ -1,19 +0,0 @@ -import { expect } from "chai"; -import * as windows from "../ambassador/src/client/windows"; - -describe("scroll test", () => { - let targetWindow; - before(() => { - return windows.create().then((win) => { - targetWindow = win; - }); - }); - - after(() => { - return windows.remove(targetWindow.id); - }); - - it('runs test', () => { - expect(targetWindow.id).be.a('number'); - }); -}); diff --git a/e2e/contents/tab.test.js b/e2e/contents/tab.test.js new file mode 100644 index 0000000..d33a35f --- /dev/null +++ b/e2e/contents/tab.test.js @@ -0,0 +1,35 @@ +import { expect } from "chai"; +import * as windows from "../ambassador/src/client/windows"; +import * as tabs from "../ambassador/src/client/tabs"; +import * as keys from "../ambassador/src/client/keys"; + +const SERVER_URL = "localhost:11111"; + +describe("tab test", function() { + let targetWindow; + let targetTab; + + before(() => { + return windows.create().then((win) => { + targetWindow = win; + return tabs.create(win.id, SERVER_URL).then((tab) => { + targetTab = tab; + }); + }); + }); + + after(() => { + return windows.remove(targetWindow.id); + }); + + it('delete tab', (done) => { + let before = window.document.documentElement.scrollTop; + keys.press(targetTab.id, 'j').then((r) => { + }); + keys.press(targetTab.id, 'j').then((r) => { + }); + keys.press(targetTab.id, 'G').then((r) => { + }); + let after = window.document.documentElement.scrollTop; + }); +}); |