From 68f6211aac4177f3a70a40031dabbd1b61840071 Mon Sep 17 00:00:00 2001 From: Shin'ya UEOKA Date: Tue, 8 Oct 2019 13:08:29 +0000 Subject: Clean e2e tests --- e2e/command_winopen.test.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'e2e/command_winopen.test.ts') diff --git a/e2e/command_winopen.test.ts b/e2e/command_winopen.test.ts index 95a0b6a..fb1348d 100644 --- a/e2e/command_winopen.test.ts +++ b/e2e/command_winopen.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("winopen command test", () => { - let server = new TestServer(12321) + let server = new TestServer() .receiveContent('/google', 'google') .receiveContent('/yahoo', 'yahoo'); let lanthan: Lanthan; @@ -24,11 +25,17 @@ describe("winopen command test", () => { .build(); 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() => { @@ -45,7 +52,7 @@ describe("winopen command test", () => { } page = await Page.navigateTo(webdriver, server.url()); - }) + }); it('should open default search for keywords by winopen command ', async() => { let console = await page.showConsole(); -- cgit v1.2.3