aboutsummaryrefslogtreecommitdiff
path: root/e2e/command_tabopen.test.ts
diff options
context:
space:
mode:
authorShin'ya UEOKA <ueokande@i-beam.org>2019-10-08 13:08:29 +0000
committerShin'ya UEOKA <ueokande@i-beam.org>2019-10-08 13:19:28 +0000
commit68f6211aac4177f3a70a40031dabbd1b61840071 (patch)
treef46720349e17c57db7bbfc55241b12c4410f2773 /e2e/command_tabopen.test.ts
parentf59a2dd8c7ac41798e077a795ea88f3bd580e81c (diff)
Clean e2e tests
Diffstat (limited to 'e2e/command_tabopen.test.ts')
-rw-r--r--e2e/command_tabopen.test.ts20
1 files changed, 13 insertions, 7 deletions
diff --git a/e2e/command_tabopen.test.ts b/e2e/command_tabopen.test.ts
index 9d3da9a..b5533e6 100644
--- a/e2e/command_tabopen.test.ts
+++ b/e2e/command_tabopen.test.ts
@@ -2,14 +2,15 @@ import * as path from 'path';
import * as assert from 'assert';
import TestServer from './lib/TestServer';
-import settings from './settings';
import eventually from './eventually';
import { Builder, Lanthan } from 'lanthan';
import { WebDriver } from 'selenium-webdriver';
import Page from './lib/Page';
+import SettingRepository from "./lib/SettingRepository";
+import Settings from "../src/shared/settings/Settings";
describe("tabopen command test", () => {
- let server = new TestServer(12321)
+ let server = new TestServer()
.receiveContent('/google', 'google')
.receiveContent('/yahoo', 'yahoo');
let lanthan: Lanthan;
@@ -25,11 +26,16 @@ describe("tabopen command test", () => {
webdriver = lanthan.getWebDriver();
browser = lanthan.getWebExtBrowser();
- await browser.storage.local.set({
- settings,
- });
-
await server.start();
+ await new SettingRepository(browser).saveJSON(Settings.fromJSON({
+ search: {
+ default: "google",
+ engines: {
+ "google": server.url('/google?q={}'),
+ "yahoo": server.url('/yahoo?q={}'),
+ },
+ },
+ }));
});
after(async() => {
@@ -46,7 +52,7 @@ describe("tabopen command test", () => {
}
page = await Page.navigateTo(webdriver, server.url());
- })
+ });
it('should open default search for keywords by tabopen command ', async() => {
let console = await page.showConsole();