diff options
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; + }); +}); |