Implement e2e test of view-source

This commit is contained in:
Shin'ya Ueoka 2018-06-17 14:18:21 +09:00
parent ef332b1738
commit 2e9574fbea
2 changed files with 18 additions and 1 deletions

1
QA.md
View file

@ -27,7 +27,6 @@ The behaviors of the console are tested in [Console section](#consoles).
#### Misc #### Misc
- [ ] <kbd>g</kbd><kbd>f</kbd>: open page source in the new tab.
- [ ] <kbd>y</kbd>: yank current URL and show a message - [ ] <kbd>y</kbd>: yank current URL and show a message
- [ ] <kbd>p</kbd>: open clipboard's URL in current tab - [ ] <kbd>p</kbd>: open clipboard's URL in current tab
- [ ] <kbd>P</kbd>: open clipboard's URL in new tab - [ ] <kbd>P</kbd>: open clipboard's URL in new tab

View file

@ -163,4 +163,22 @@ describe("tab test", () => {
let win = await windows.get(targetWindow.id); let win = await windows.get(targetWindow.id);
expect(win.tabs).to.have.lengthOf(1); 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 + '/']);
});
});
}); });