From 2e9574fbea4636577b0e9f33c3650d85ae85055a Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 17 Jun 2018 14:18:21 +0900 Subject: [PATCH] Implement e2e test of view-source --- QA.md | 1 - e2e/contents/tab.test.js | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/QA.md b/QA.md index a88680e..0473126 100644 --- a/QA.md +++ b/QA.md @@ -27,7 +27,6 @@ The behaviors of the console are tested in [Console section](#consoles). #### Misc -- [ ] gf: open page source in the new tab. - [ ] y: yank current URL and show a message - [ ] p: open clipboard's URL in current tab - [ ] P: open clipboard's URL in new tab diff --git a/e2e/contents/tab.test.js b/e2e/contents/tab.test.js index 2d7f548..bb6c56f 100644 --- a/e2e/contents/tab.test.js +++ b/e2e/contents/tab.test.js @@ -163,4 +163,22 @@ describe("tab test", () => { let win = await windows.get(targetWindow.id); expect(win.tabs).to.have.lengthOf(1); }); + + it('opens view-source by gf', () => { + let target; + return Promise.resolve().then(() => { + return windows.get(targetWindow.id); + }).then((win) => { + target = win.tabs[0]; + return keys.press(target.id, 'g'); + }).then(() => { + return keys.press(target.id, 'f'); + }).then(() => { + return new Promise((resolve) => setTimeout(resolve, 300)); + }).then(() => { + return windows.get(targetWindow.id); + }).then((win) => { + expect(win.tabs.map((t) => t.url)).to.include.members([CLIENT_URL + '/', 'view-source:' + CLIENT_URL + '/']); + }); + }); });