diff options
author | Shin'ya UEOKA <ueokande@i-beam.org> | 2019-10-01 12:49:47 +0000 |
---|---|---|
committer | Shin'ya UEOKA <ueokande@i-beam.org> | 2019-10-01 13:21:58 +0000 |
commit | 5291c4cca1da50bba89da9dd4fe6c1a14eb1fc97 (patch) | |
tree | 47c969cabab668e54166747b0724e2ad2d31549d /e2e | |
parent | 80ed062487356310efd5e4a76f1f8978dc836a4f (diff) |
Add e2e test for help command
Diffstat (limited to 'e2e')
-rw-r--r-- | e2e/command_help.test.ts | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/e2e/command_help.test.ts b/e2e/command_help.test.ts new file mode 100644 index 0000000..9269d49 --- /dev/null +++ b/e2e/command_help.test.ts @@ -0,0 +1,49 @@ +import * as path from 'path'; +import * as assert from 'assert'; + +import TestServer from './lib/TestServer'; +import eventually from './eventually'; +import { Builder, Lanthan } from 'lanthan'; +import { WebDriver } from 'selenium-webdriver'; +import Page from './lib/Page'; + +describe("help command test", () => { + let server = new TestServer(); + let lanthan: Lanthan; + let webdriver: WebDriver; + let browser: any; + let page: Page; + + before(async() => { + lanthan = await Builder + .forBrowser('firefox') + .spyAddon(path.join(__dirname, '..')) + .build(); + webdriver = lanthan.getWebDriver(); + browser = lanthan.getWebExtBrowser(); + + await server.start(); + }); + + after(async() => { + await server.stop(); + if (lanthan) { + await lanthan.quit(); + } + }); + + beforeEach(async() => { + page = await Page.navigateTo(webdriver, server.url()); + }) + + it('should open help page by help command ', async() => { + let console = await page.showConsole(); + await console.execCommand('help'); + + await eventually(async() => { + let tabs = await browser.tabs.query({ active: true }); + assert.strictEqual(tabs[0].url, 'https://ueokande.github.io/vim-vixen/') + }); + }); +}); + |