Skip to content

Commit

Permalink
merge prev
Browse files Browse the repository at this point in the history
  • Loading branch information
xsalonx committed Aug 1, 2024
2 parents 599472b + 8111374 commit b8f2fd4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions test/public/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,16 @@ const waitForTableToLength = async (page, expectedSize) => {

module.exports.waitForTableLength = waitForTableToLength;

/**
* Waits for table to be loaded
*
* @param {puppeteer.Page} page - The puppeteer page where the table is located.
* @return {Promise<void>} resolves once the table is loaded
*/
const waitForTableToBeLoaded = async (page) => page.waitForSelector('table tbody tr:not(.loading-row):not(.empty-row)');

module.exports.waitForTableToBeLoaded = waitForTableToBeLoaded;

/**
* Wait for the total number of elements to be the expected one
*
Expand Down
4 changes: 3 additions & 1 deletion test/public/qcFlags/gaqOverview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const {
getPopoverInnerText,
setConfirmationDialogToBeAccepted,
unsetConfirmationDialogActions,
waitForTableToBeLoaded,
} = require('../defaults.js');

const { expect } = chai;
Expand Down Expand Up @@ -72,7 +73,7 @@ module.exports = () => {

await validateTableData(page, new Map(Object.entries(tableDataValidators)));

await page.waitForSelector('tr:nth-of-type(2)');
await waitForTableToBeLoaded(page);
expect(await getTableContent(page)).to.have.all.deep.ordered.members([
[
'MC.R',
Expand Down Expand Up @@ -108,6 +109,7 @@ module.exports = () => {
await waitForNavigation(page, () => pressElement(page, 'h2:nth-of-type(2) a', true));
await waitForNavigation(page, () => pressElement(page, '#row106-globalAggregatedQuality a', true));

await waitForTableToBeLoaded(page);
expect(await getTableContent(page)).to.have.all.deep.ordered.members([
[
'good',
Expand Down

0 comments on commit b8f2fd4

Please sign in to comment.