From cf14262b3a7a31089bd4365b1e00902c8bd09518 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sun, 26 May 2019 21:15:19 +0900 Subject: Automate hintchars property test --- e2e/follow_properties.test.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'e2e') diff --git a/e2e/follow_properties.test.js b/e2e/follow_properties.test.js index 5e82b50..b38216e 100644 --- a/e2e/follow_properties.test.js +++ b/e2e/follow_properties.test.js @@ -3,6 +3,7 @@ const lanthan = require('lanthan'); const path = require('path'); const assert = require('assert'); const eventually = require('./eventually'); +const Console = require('./lib/Console'); const Key = lanthan.Key; @@ -114,7 +115,38 @@ describe('follow properties test', () => { assert.equal(await hints[2].getStyle('display'), 'block'); assert.equal(await hints[3].getStyle('display'), 'block'); assert.equal(await hints[4].getStyle('display'), 'none'); + }); + }); + + it('should show hints with hintchars by settings', async () => { + let c = new Console(session); + + await body.sendKeys(':'); + await session.switchToFrame(0); + await c.sendKeys('set hintchars=abc', Key.Enter); + await session.switchToParentFrame(); + + await body.sendKeys('f'); + await eventually(async() => { + let hints = await session.findElementsByCSS('.vimvixen-hint'); + assert.equal(hints.length, 5); + + assert.equal(await hints[0].getText(), 'A'); + assert.equal(await hints[1].getText(), 'B'); + assert.equal(await hints[2].getText(), 'C'); + assert.equal(await hints[3].getText(), 'AA'); + assert.equal(await hints[4].getText(), 'AB'); + }); + await body.sendKeys('a'); + await eventually(async() => { + let hints = await session.findElementsByCSS('.vimvixen-hint'); + + assert.equal(await hints[0].getStyle('display'), 'block'); + assert.equal(await hints[1].getStyle('display'), 'none'); + assert.equal(await hints[2].getStyle('display'), 'none'); + assert.equal(await hints[3].getStyle('display'), 'block'); + assert.equal(await hints[4].getStyle('display'), 'block'); }); }); -- cgit v1.2.3 From 3686bbbabf985c41bc972de5e3897ddd2ea77333 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Mon, 27 May 2019 19:46:37 +0900 Subject: Fix test case --- e2e/follow_properties.test.js | 60 +++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'e2e') diff --git a/e2e/follow_properties.test.js b/e2e/follow_properties.test.js index b38216e..223923e 100644 --- a/e2e/follow_properties.test.js +++ b/e2e/follow_properties.test.js @@ -118,6 +118,36 @@ describe('follow properties test', () => { }); }); + it('should open tab in background by background:false', async () => { + await body.sendKeys(Key.Shift, 'f'); + await eventually(async() => { + let hints = await session.findElementsByCSS('.vimvixen-hint'); + assert.equal(hints.length, 5); + }); + await body.sendKeys('jj'); + + await eventually(async() => { + let tabs = await browser.tabs.query({}); + assert.equal(tabs[0].active, false); + assert.equal(tabs[1].active, true); + }); + }); + + it('should open tab in background by background:true', async () => { + await body.sendKeys(Key.Control, 'f'); + await eventually(async() => { + let hints = await session.findElementsByCSS('.vimvixen-hint'); + assert.equal(hints.length, 5); + }); + await body.sendKeys('jj'); + + await eventually(async() => { + let tabs = await browser.tabs.query({}); + assert.equal(tabs[0].active, true); + assert.equal(tabs[1].active, false); + }); + }); + it('should show hints with hintchars by settings', async () => { let c = new Console(session); @@ -149,34 +179,4 @@ describe('follow properties test', () => { assert.equal(await hints[4].getStyle('display'), 'block'); }); }); - - it('should open tab in background by background:false', async () => { - await body.sendKeys(Key.Shift, 'f'); - await eventually(async() => { - let hints = await session.findElementsByCSS('.vimvixen-hint'); - assert.equal(hints.length, 5); - }); - await body.sendKeys('jj'); - - await eventually(async() => { - let tabs = await browser.tabs.query({}); - assert.equal(tabs[0].active, false); - assert.equal(tabs[1].active, true); - }); - }); - - it('should open tab in background by background:true', async () => { - await body.sendKeys(Key.Control, 'f'); - await eventually(async() => { - let hints = await session.findElementsByCSS('.vimvixen-hint'); - assert.equal(hints.length, 5); - }); - await body.sendKeys('jj'); - - await eventually(async() => { - let tabs = await browser.tabs.query({}); - assert.equal(tabs[0].active, true); - assert.equal(tabs[1].active, false); - }); - }); }); -- cgit v1.2.3