diff options
Diffstat (limited to 'e2e')
-rw-r--r-- | e2e/command_help.test.ts | 49 | ||||
-rw-r--r-- | e2e/completion.test.ts | 2 |
2 files changed, 50 insertions, 1 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/') + }); + }); +}); + diff --git a/e2e/completion.test.ts b/e2e/completion.test.ts index 28c1913..afa4432 100644 --- a/e2e/completion.test.ts +++ b/e2e/completion.test.ts @@ -40,7 +40,7 @@ describe("general completion test", () => { let console = await page.showConsole(); let items = await console.getCompletions(); - assert.strictEqual(items.length, 10); + assert.strictEqual(items.length, 11); assert.deepStrictEqual(items[0], { type: 'title', text: 'Console Command' }); assert.ok(items[1].text.startsWith('set')) assert.ok(items[2].text.startsWith('open')) |