aboutsummaryrefslogtreecommitdiff
path: root/e2e/partial_blacklist.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/partial_blacklist.test.ts
parentf59a2dd8c7ac41798e077a795ea88f3bd580e81c (diff)
Clean e2e tests
Diffstat (limited to 'e2e/partial_blacklist.test.ts')
-rw-r--r--e2e/partial_blacklist.test.ts27
1 files changed, 12 insertions, 15 deletions
diff --git a/e2e/partial_blacklist.test.ts b/e2e/partial_blacklist.test.ts
index e938dc6..950bb39 100644
--- a/e2e/partial_blacklist.test.ts
+++ b/e2e/partial_blacklist.test.ts
@@ -5,6 +5,8 @@ import TestServer from './lib/TestServer';
import { Builder, Lanthan } from 'lanthan';
import { WebDriver } from 'selenium-webdriver';
import Page from './lib/Page';
+import Settings from '../src/shared/settings/Settings';
+import SettingRepository from './lib/SettingRepository';
describe("partial blacklist test", () => {
let server = new TestServer().receiveContent('/*',
@@ -24,20 +26,15 @@ describe("partial blacklist test", () => {
await server.start();
let url = server.url().replace('http://', '');
- await browser.storage.local.set({
- settings: {
- source: 'json',
- json: `{
- "keymaps": {
- "j": { "type": "scroll.vertically", "count": 1 },
- "k": { "type": "scroll.vertically", "count": -1 }
- },
- "blacklist": [
- { "url": "${url}", "keys": ["k"] }
- ]
- }`,
+ await new SettingRepository(browser).saveJSON(Settings.fromJSON({
+ keymaps: {
+ j: { type: 'scroll.vertically', count: 1 },
+ k: { type: 'scroll.vertically', count: -1 },
},
- });
+ blacklist: [
+ { 'url': url, 'keys': ['k'] }
+ ]
+ }));
});
after(async() => {
@@ -50,11 +47,11 @@ describe("partial blacklist test", () => {
it('should disable keys in the partial blacklist', async () => {
let page = await Page.navigateTo(webdriver, server.url('/'));
- await page.sendKeys('j')
+ await page.sendKeys('j');
let scrollY = await page.getScrollY();
assert.strictEqual(scrollY, 64);
- await page.sendKeys('k')
+ await page.sendKeys('k');
scrollY = await page.getScrollY();
assert.strictEqual(scrollY, 64);
});