From 7df99cf232514e4545cb4363b995e851f44f41d2 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Thu, 18 Apr 2019 21:54:56 +0900 Subject: Add e2e tests for "complete" property --- e2e/completion_open.test.js | 123 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) (limited to 'e2e') diff --git a/e2e/completion_open.test.js b/e2e/completion_open.test.js index 59d6b83..80628b3 100644 --- a/e2e/completion_open.test.js +++ b/e2e/completion_open.test.js @@ -129,4 +129,127 @@ describe("completion on open/tabopen/winopen commands", () => { assert(items.every(x => x.includes('https://'))); }); }) + + it('should display only specified items in "complete" property by set command', async() => { + let c = new Console(session); + + const execCommand = async(line) => { + await body.sendKeys(':'); + await session.switchToFrame(0); + await c.sendKeys(line, Key.Enter); + await session.switchToParentFrame(); + } + + const typeCommand = async(...keys) => { + await body.sendKeys(':'); + await session.switchToFrame(0); + await c.sendKeys(...keys); + } + + const cancel = async() => { + await c.sendKeys(Key.Escape); + await session.switchToParentFrame(); + } + + await execCommand('set complete=sbh'); + await typeCommand('open '); + + await eventually(async() => { + let completions = await c.getCompletions(); + let titles = completions.filter(x => x.type === 'title').map(x => x.text); + assert.deepEqual(titles, ['Search Engines', 'Bookmarks', 'History']) + }); + + await cancel(); + await execCommand('set complete=bss'); + await typeCommand('open '); + + await eventually(async() => { + let completions = await c.getCompletions(); + let titles = completions.filter(x => x.type === 'title').map(x => x.text); + assert.deepEqual(titles, ['Bookmarks', 'Search Engines', 'Search Engines']) + }); + }) + + it('should display only specified items in "complete" property by setting', async() => { + const settings = { + source: 'json', + json: `{ + "keymaps": { + ":": { "type": "command.show" } + }, + "search": { + "default": "google", + "engines": { "google": "https://google.com/search?q={}" } + }, + "properties": { + "complete": "sbh" + } + }`, + }; + await browser.storage.local.set({ settings, }); + + let c = new Console(session); + + const typeCommand = async(...keys) => { + await body.sendKeys(':'); + await session.switchToFrame(0); + await c.sendKeys(...keys); + } + + const cancel = async() => { + await c.sendKeys(Key.Escape); + await session.switchToParentFrame(); + } + + await browser.storage.local.set({ settings: { + source: 'json', + json: `{ + "keymaps": { + ":": { "type": "command.show" } + }, + "search": { + "default": "google", + "engines": { "google": "https://google.com/search?q={}" } + }, + "properties": { + "complete": "sbh" + } + }`, + }}); + await typeCommand('open '); + + await eventually(async() => { + let completions = await c.getCompletions(); + let titles = completions.filter(x => x.type === 'title').map(x => x.text); + assert.deepEqual(titles, ['Search Engines', 'Bookmarks', 'History']) + }); + + await cancel(); + + await browser.storage.local.set({ settings: { + source: 'json', + json: `{ + "keymaps": { + ":": { "type": "command.show" } + }, + "search": { + "default": "google", + "engines": { "google": "https://google.com/search?q={}" } + }, + "properties": { + "complete": "bss" + } + }`, + }}); + await typeCommand('open '); + + await eventually(async() => { + let completions = await c.getCompletions(); + let titles = completions.filter(x => x.type === 'title').map(x => x.text); + assert.deepEqual(titles, ['Bookmarks', 'Search Engines', 'Search Engines']) + }); + + + }) }); -- cgit v1.2.3 From 3fdd1969b4de0c28f5d198cbb339c77621fb7da6 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 20 Apr 2019 14:07:27 +0900 Subject: Add e2e tests for follow --- QA.md | 13 --- e2e/follow.test.js | 257 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 257 insertions(+), 13 deletions(-) create mode 100644 e2e/follow.test.js (limited to 'e2e') diff --git a/QA.md b/QA.md index 2c5b939..5d5f6c0 100644 --- a/QA.md +++ b/QA.md @@ -18,23 +18,10 @@ The behaviors of the console are tested in [Console section](#consoles). - [ ] Notify to users on add-on updated at first time. - [ ] Reopen tab on *only current window* by u -### Following links - -- [ ] Show hints on following on a page containing ``/`