From 67072f5c2372fd84d908d4781ce27448ec1b487c Mon Sep 17 00:00:00 2001 From: carlosjr Date: Mon, 28 Dec 2020 14:13:22 +0100 Subject: [PATCH] e2e path for route index now works focused and full run --- e2e/paths/08-route/03_create_and_clone.spec.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/e2e/paths/08-route/03_create_and_clone.spec.js b/e2e/paths/08-route/03_create_and_clone.spec.js index c42bbdc55..be758f788 100644 --- a/e2e/paths/08-route/03_create_and_clone.spec.js +++ b/e2e/paths/08-route/03_create_and_clone.spec.js @@ -63,11 +63,14 @@ describe('Route create path', () => { await page.waitForState('route.index'); }); + let count; it(`should count the amount of routes before clonation`, async() => { - await page.waitForNumberOfElements(selectors.routeIndex.anyResult, 8); - const result = await page.countElement(selectors.routeIndex.anyResult); + await page.waitForFunction(selector => { + return document.querySelectorAll(selector).length > 6; + }, {}, selectors.routeIndex.anyResult); + count = await page.countElement(selectors.routeIndex.anyResult); - expect(result).toEqual(8); + expect(count).toBeGreaterThanOrEqual(7); }); it(`should clone the first route`, async() => { @@ -80,10 +83,10 @@ describe('Route create path', () => { }); it(`should reload the section and count the amount of routes after clonation`, async() => { - await page.waitForNumberOfElements(selectors.routeIndex.anyResult, 9); + await page.waitForNumberOfElements(selectors.routeIndex.anyResult, count + 1); const result = await page.countElement(selectors.routeIndex.anyResult); - expect(result).toEqual(9); + expect(result).toEqual(count + 1); }); }); });