Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5c263a0
[O2B-1517] Fix table row loading check
isaachilly Dec 18, 2025
dc37b4f
Merge branch 'main' into improv/O2B-1517/fix-failing-runs-test
isaachilly Dec 18, 2025
33150af
[O2B-1517] Fix order of assertions in runs per data pass test
isaachilly Dec 18, 2025
59063b3
Merge branch 'improv/O2B-1517/fix-failing-runs-test' of github.com:Al…
isaachilly Dec 18, 2025
ced5111
[O2b-1517] Add table length wait in runsPerLhcPeriod overview test
isaachilly Dec 18, 2025
1f0b5d0
[O2B-1517] Add timeout option to waitForTableToLength helper
isaachilly Dec 18, 2025
bd03df7
[O2B-1517] Fix selector for loading row in table test
isaachilly Dec 18, 2025
d147e66
[O2B-1517] Add table length wait after filter resets in tests
isaachilly Dec 19, 2025
c923f31
[O2B-1517] Update expected table length in env overview tests
isaachilly Jan 7, 2026
63b1e8d
Improve selector usage and reliability in overview tests
isaachilly Jan 12, 2026
397c6b6
Fix tests to make more reliable
isaachilly Jan 12, 2026
334963d
Fix test with a timeout
isaachilly Jan 12, 2026
d19e3c9
Add polling option to expectInnerText in test
isaachilly Jan 12, 2026
13f1458
Removed a redundant expectInnerText call...
isaachilly Jan 12, 2026
4395aee
[O2B-1517] Improve waitForTableToLength to avoid false positives
isaachilly Jan 13, 2026
d4d226e
[O2B-1517] Improve table update checks
isaachilly Jan 13, 2026
4c25d3c
[O2B-1517] Set longer timeout in mcRepod tests
isaachilly Jan 13, 2026
b1ee503
[O2B-1517] Improve error message in waitForTableToLength
isaachilly Jan 13, 2026
439522b
[O2B-1517] Remove incorrect waitFortTableLength usage
isaachilly Jan 13, 2026
d2eff6e
[O2B-1517] Fix order of actions in mcReproducibleAsNotBad test
isaachilly Jan 13, 2026
3c125df
[O2B-1517] Improve local runs test reliability
isaachilly Jan 13, 2026
9ed9bcc
Merge branch 'main' into improv/O2B-1517/fix-failing-runs-test
isaachilly Jan 13, 2026
6ac9e55
[O2B-1517] Refactor waitForTableToLength
isaachilly Jan 14, 2026
d7e414e
Merge branch 'main' into improv/O2B-1517/fix-failing-runs-test
graduta Jan 20, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions test/public/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,18 +145,20 @@ module.exports.waitForTimeout = waitForTimeout;
*
* @param {puppeteer.Page} page - The puppeteer page where the table is located.
* @param {number} expectedSize - The expected number of table rows, excluding rows marked as loading or empty.
* @param {number} [timeout] - Max wait time in ms; if omitted, uses the page default timeout.
* @return {Promise<void>} Resolves once the expected number of rows is met, or the timeout is reached.
*/
const waitForTableToLength = async (page, expectedSize) => {
const waitForTableToLength = async (page, expectedSize, timeout) => {
try {
const waitOptions = timeout === undefined ? {} : { timeout };
await page.waitForFunction(
(expectedSize) => document.querySelectorAll('table tbody tr:not(.loading-row):not(.empty-row)').length === expectedSize,
{},
waitOptions,
expectedSize,
);
} catch {
const actualSize = (await page.$$('tbody tr')).length;
const isThereLoadingRow = !!(await page.$$('table body tr.loading-row'))
const isThereLoadingRow = (await page.$$('table tbody tr.loading-row')).length > 0;
throw new Error(`Expected table of length ${expectedSize}, but got ${actualSize} ${isThereLoadingRow ? ', loading-row' : ''}`);
}
};
Expand Down
2 changes: 1 addition & 1 deletion test/public/envs/overview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ module.exports = () => {
await fillInput(page, selector.fromDateSelector, fromDate, ['change']);
await fillInput(page, selector.toDateSelector, toDate, ['change']);

await waitForTableLength(page, expectedIds.length);
await waitForTableLength(page, expectedIds.length, 5000);
expect(await page.$$eval('tbody tr', (rows) => rows.map((row) => row.id))).to.eql(expectedIds.map(id => `row${id}`));
};

Expand Down
2 changes: 1 addition & 1 deletion test/public/runs/runsPerDataPass.overview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ module.exports = () => {
await pressElement(page, amountItems5);

// Expect the amount of visible runs to reduce when the first option (5) is selected
await expectInnerText(page, '.dropup button', 'Rows per page: 5 ');
await waitForTableLength(page, 4);
await expectInnerText(page, '.dropup button', 'Rows per page: 5 ');

// Expect the custom per page input to have red border and text color if wrong value typed
const customPerPageInput = await page.$(`${amountSelectorId} input[type=number]`);
Expand Down
8 changes: 8 additions & 0 deletions test/public/runs/runsPerLhcPeriod.overview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ module.exports = () => {
...Object.fromEntries(DETECTORS.map((detectorName) => [detectorName, (quality) => expect(quality).oneOf([...RUN_QUALITIES, ''])])),
};

await waitForTableLength(page, 4);
await validateTableData(page, new Map(Object.entries(tableDataValidatorsWithDetectorQualities)));

await waitForNavigation(page, () => pressElement(page, '#synchronousFlags-tab'));
Expand All @@ -122,6 +123,7 @@ module.exports = () => {
])),
};

await waitForTableLength(page, 4);
await validateTableData(page, new Map(Object.entries(tableDataValidatorsWithQualityFromSynchronousFlags)));
await expectInnerText(page, '#row56-FT0', '83');
});
Expand Down Expand Up @@ -153,10 +155,16 @@ module.exports = () => {
const amountSelectorButtonSelector = `${amountSelectorId} button`;
await pressElement(page, amountSelectorButtonSelector);

await fillInput(page, `${amountSelectorId} input[type=number]`, '3', ['input', 'change']);
await waitForTableLength(page, 3);
await expectInnerText(page, '.dropup button', 'Rows per page: 3 ');

await pressElement(page, amountSelectorButtonSelector);
await page.waitForSelector(`${amountSelectorId} .dropup-menu`);

const amountItems5 = `${amountSelectorId} .dropup-menu .menu-item:first-child`;
await pressElement(page, amountItems5, true);
// only 4 runs in LHC Period 1
await waitForTableLength(page, 4);
await expectInnerText(page, '.dropup button', 'Rows per page: 5 ');

Expand Down
Loading