Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,14 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel

const lhcPeriodName = remoteLhcPeriodStatistics?.match({
Success: (lhcPeriodStatistics) => lhcPeriodStatistics.lhcPeriod.name,
Other: () => '',
Other: () => spinner({ size: 1, absolute: false }),
});

return [
h('.flex-row.justify-between.items-center.g2', [
filtersPanelPopover(perLhcPeriodOverviewModel, activeColumns, { profile: 'runsPerLhcPeriod' }),
h('.pl2#runOverviewFilter', runNumbersFilter(perLhcPeriodOverviewModel.filteringModel.get('runNumbers'))),
h('h2', ['Good physics runs of ', lhcPeriodName ?? spinner({ size: 1, absolute: false })]),
h('h2', ['Good physics runs of ', lhcPeriodName]),
mcReproducibleAsNotBadToggle(
mcReproducibleAsNotBad,
() => perLhcPeriodOverviewModel.setMcReproducibleAsNotBad(!mcReproducibleAsNotBad),
Expand Down
2 changes: 1 addition & 1 deletion test/public/runs/overview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -954,9 +954,9 @@ module.exports = () => {
await page.waitForSelector(badFilterSelector);
await page.$eval(badFilterSelector, (element) => element.click());
await page.waitForSelector('tbody tr:nth-child(2)');
await page.waitForSelector(EXPORT_RUNS_TRIGGER_SELECTOR);

///// Download
await waitForButtonToBecomeActive(page, EXPORT_RUNS_TRIGGER_SELECTOR);
await page.$eval(EXPORT_RUNS_TRIGGER_SELECTOR, (button) => button.click());
await page.waitForSelector('#export-data-modal', { timeout: 5000 });

Expand Down
13 changes: 4 additions & 9 deletions test/public/runs/runsPerLhcPeriod.overview.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,24 +201,19 @@ module.exports = () => {
// Revert changes for next test
await page.evaluate(() => {
// eslint-disable-next-line no-undef
model.runs.perLhcPeriodOverviewModel.pagination.itemsPerPage = 10;
model.runs.perLhcPeriodOverviewModel.pagination.itemsPerPage = 2;
});
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could do with an explanation.

What happened here before was:

  1. The number of Items was set
  2. The next test runs
  3. The page is loaded based on the previous number of items.
  4. The number of items is changed
  5. a. Sometimes, the waitForButtonToBecomeActive resolves immediately because the change in item number doesn't result in a UI change quick enough. This will result in a failure because the button might be inactive after the active check passed.
    b. Sometimes waitForButtonToBecomeActive doesn't immediately resolve because the UI would be loading, which would temporarily disable the button. This would result in a test pass

Moving the setting as well as the row check to a previous test solves this issue.

await waitForTableLength(page, 4);
await waitForTableLength(page, 2);
});


it('should successfully export all runs per lhc Period', async () => {
await page.evaluate(() => {
// eslint-disable-next-line no-undef
model.runs.perLhcPeriodOverviewModel.pagination.itemsPerPage = 2;
});

const targetFileName = 'data.json';
await waitForButtonToBecomeActive(page, EXPORT_RUNS_TRIGGER_SELECTOR);
// First export
await pressElement(page, EXPORT_RUNS_TRIGGER_SELECTOR, true);
await page.waitForSelector('select.form-control', { timeout: 200 });
await page.waitForSelector('option[value=runNumber]', { timeout: 200 });
await page.waitForSelector('select.form-control');
await page.waitForSelector('option[value=runNumber]');
await page.select('select.form-control', 'runQuality', 'runNumber', 'definition', 'lhcPeriod');
await expectInnerText(page, '#send:enabled', 'Export');

Expand Down
Loading