Skip to content

Commit

Permalink
fix: Added code for coverage compatibility in the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
john-ghatas committed Apr 3, 2020
1 parent 2ae6781 commit 8301188
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions frontend/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('Frontend', () => {
let http;
let browser;


before(() => {
http = require('./../lib/server');
})
Expand All @@ -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()
})
Expand All @@ -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 () => {
Expand All @@ -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)
})

0 comments on commit 8301188

Please sign in to comment.