From 2562d3b9de36d8b0a25d9ec4f67c5c1430773410 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Sat, 20 Apr 2019 16:36:30 +0900 Subject: [PATCH] Make stable e2e tests --- e2e/navigate.test.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/e2e/navigate.test.js b/e2e/navigate.test.js index 5d9365b..17552e5 100644 --- a/e2e/navigate.test.js +++ b/e2e/navigate.test.js @@ -125,16 +125,20 @@ describe("navigate test", () => { await body.sendKeys(Key.Shift, 'h'); - let tab = (await browser.tabs.query({}))[0]; - let url = new URL(tab.url); - assert.equal(url.pathname, `/first`) + await eventually(async() => { + let tab = (await browser.tabs.query({}))[0]; + let url = new URL(tab.url); + assert.equal(url.pathname, `/first`) + }); body = await session.findElementByCSS('body'); await body.sendKeys(Key.Shift, 'l'); - tab = (await browser.tabs.query({}))[0]; - url = new URL(tab.url); - assert.equal(url.pathname, `/second`) + await eventually(async() => { + tab = (await browser.tabs.query({}))[0]; + url = new URL(tab.url); + assert.equal(url.pathname, `/second`) + }); }); it('should go previous and next page in by [[ and ]]', async () => {