From 8301188b08f97ca779dd833d5256b7e0715d1460 Mon Sep 17 00:00:00 2001 From: John Ghatas Date: Fri, 3 Apr 2020 15:10:53 +0200 Subject: [PATCH] fix: Added code for coverage compatibility in the tests --- frontend/test/index.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/frontend/test/index.js b/frontend/test/index.js index 41bc03460e..bb06d77ce9 100644 --- a/frontend/test/index.js +++ b/frontend/test/index.js @@ -26,6 +26,7 @@ describe('Frontend', () => { let http; let browser; + before(() => { http = require('./../lib/server'); }) @@ -45,6 +46,11 @@ describe('Frontend', () => { page.coverage.stopJSCoverage(), page.coverage.stopCSSCoverage(), ]); + + [...jsCoverage, ...cssCoverage].forEach((element) => { + element.url = element.url.replace('?', ''); + }); + pti.write([...jsCoverage, ...cssCoverage]) await browser.close() }) @@ -56,7 +62,7 @@ describe('Frontend', () => { const title = await page.title() // We expect the page to return the correct title, making sure there isn't another server running on this port assert.equal(title, 'AliceO2 Logbook 2020') - }) + }).timeout(5000) describe('Overview', () => { it('can filter logs dynamically', async () => { @@ -69,10 +75,10 @@ describe('Frontend', () => { assert.equal(id, 'filtersCheckbox1') await page.click(`#${id}`) - await page.waitFor(1750) + await page.waitFor(1000) const newTableRows = await page.$$('table tr') // We expect the amount of logs in this filter to match the advertised amount in the filters component assert.equal(true, newTableRows.length - 1 === parseInt(amount.substring(1, amount.length - 1))) }) - }) + }).timeout(5000) })