Skip to content

Commit 8301188

Browse files
committed
fix: Added code for coverage compatibility in the tests
1 parent 2ae6781 commit 8301188

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

frontend/test/index.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe('Frontend', () => {
2626
let http;
2727
let browser;
2828

29+
2930
before(() => {
3031
http = require('./../lib/server');
3132
})
@@ -45,6 +46,11 @@ describe('Frontend', () => {
4546
page.coverage.stopJSCoverage(),
4647
page.coverage.stopCSSCoverage(),
4748
]);
49+
50+
[...jsCoverage, ...cssCoverage].forEach((element) => {
51+
element.url = element.url.replace('?', '');
52+
});
53+
4854
pti.write([...jsCoverage, ...cssCoverage])
4955
await browser.close()
5056
})
@@ -56,7 +62,7 @@ describe('Frontend', () => {
5662
const title = await page.title()
5763
// We expect the page to return the correct title, making sure there isn't another server running on this port
5864
assert.equal(title, 'AliceO2 Logbook 2020')
59-
})
65+
}).timeout(5000)
6066

6167
describe('Overview', () => {
6268
it('can filter logs dynamically', async () => {
@@ -69,10 +75,10 @@ describe('Frontend', () => {
6975
assert.equal(id, 'filtersCheckbox1')
7076

7177
await page.click(`#${id}`)
72-
await page.waitFor(1750)
78+
await page.waitFor(1000)
7379
const newTableRows = await page.$$('table tr')
7480
// We expect the amount of logs in this filter to match the advertised amount in the filters component
7581
assert.equal(true, newTableRows.length - 1 === parseInt(amount.substring(1, amount.length - 1)))
7682
})
77-
})
83+
}).timeout(5000)
7884
})

0 commit comments

Comments
 (0)