From 40ed8364494fd15a2f0f3197fb9320c3d75cf6e2 Mon Sep 17 00:00:00 2001 From: Xiao Gui <xgui3783@gmail.com> Date: Wed, 28 Oct 2020 18:40:42 +0100 Subject: [PATCH] bugfix: fix e2e tests after regression fix --- e2e/src/selecting/region.prod.e2e-spec.js | 7 ++++--- e2e/util/selenium/layout.js | 11 +++++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/e2e/src/selecting/region.prod.e2e-spec.js b/e2e/src/selecting/region.prod.e2e-spec.js index 45acdadc5..de84b5b93 100644 --- a/e2e/src/selecting/region.prod.e2e-spec.js +++ b/e2e/src/selecting/region.prod.e2e-spec.js @@ -44,9 +44,10 @@ describe('> selecting regions', () => { const newPage = new AtlasPage() await newPage.init() await newPage.goto(url) - const texts = await newPage.getAllChipsText() - expect(texts.length).toEqual(2) - expect(texts).toContain(CONST.MULTI_REGION_SELECTION) + const allChipsVisibility = await newPage.getAllChipsVisibility() + expect(allChipsVisibility.filter(v => !!v).length).toEqual(2) + const allChipsText = await newPage.getAllChipsText() + expect(allChipsText).toContain(CONST.MULTI_REGION_SELECTION) }) }) }) diff --git a/e2e/util/selenium/layout.js b/e2e/util/selenium/layout.js index ceaae248d..c60043ad3 100644 --- a/e2e/util/selenium/layout.js +++ b/e2e/util/selenium/layout.js @@ -210,6 +210,17 @@ class WdLayoutPage extends WdBase{ return texts } + async getAllChipsVisibility(){ + const visibility = [] + const webEls = await this._getChips() + for (const el of webEls) { + visibility.push( + await el.isDisplayed() + ) + } + return visibility + } + /** * Other -- GitLab