Skip to content

Commit be50650

Browse files
NarrowsProjectsGuustMetz
andauthored
[O2B-1575] Fix missed failing tests (#2123)
* Properly set the rowCount before exporting to avoid race condition between item count updates and button state assertions * Fixed loading symbol whilst waiting for lhcPeriodname --------- Co-authored-by: GuustMetz <guust.metz@cern.ch>
1 parent c4052b4 commit be50650

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

lib/public/views/Runs/RunPerPeriod/RunsPerLhcPeriodOverviewPage.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,14 +102,14 @@ export const RunsPerLhcPeriodOverviewPage = ({ runs: { perLhcPeriodOverviewModel
102102

103103
const lhcPeriodName = remoteLhcPeriodStatistics?.match({
104104
Success: (lhcPeriodStatistics) => lhcPeriodStatistics.lhcPeriod.name,
105-
Other: () => '',
105+
Other: () => spinner({ size: 1, absolute: false }),
106106
});
107107

108108
return [
109109
h('.flex-row.justify-between.items-center.g2', [
110110
filtersPanelPopover(perLhcPeriodOverviewModel, activeColumns, { profile: 'runsPerLhcPeriod' }),
111111
h('.pl2#runOverviewFilter', runNumbersFilter(perLhcPeriodOverviewModel.filteringModel.get('runNumbers'))),
112-
h('h2', ['Good physics runs of ', lhcPeriodName ?? spinner({ size: 1, absolute: false })]),
112+
h('h2', ['Good physics runs of ', lhcPeriodName]),
113113
mcReproducibleAsNotBadToggle(
114114
mcReproducibleAsNotBad,
115115
() => perLhcPeriodOverviewModel.setMcReproducibleAsNotBad(!mcReproducibleAsNotBad),

test/public/runs/overview.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -954,9 +954,9 @@ module.exports = () => {
954954
await page.waitForSelector(badFilterSelector);
955955
await page.$eval(badFilterSelector, (element) => element.click());
956956
await page.waitForSelector('tbody tr:nth-child(2)');
957-
await page.waitForSelector(EXPORT_RUNS_TRIGGER_SELECTOR);
958957

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

test/public/runs/runsPerLhcPeriod.overview.test.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -201,24 +201,19 @@ module.exports = () => {
201201
// Revert changes for next test
202202
await page.evaluate(() => {
203203
// eslint-disable-next-line no-undef
204-
model.runs.perLhcPeriodOverviewModel.pagination.itemsPerPage = 10;
204+
model.runs.perLhcPeriodOverviewModel.pagination.itemsPerPage = 2;
205205
});
206-
await waitForTableLength(page, 4);
206+
await waitForTableLength(page, 2);
207207
});
208208

209209

210210
it('should successfully export all runs per lhc Period', async () => {
211-
await page.evaluate(() => {
212-
// eslint-disable-next-line no-undef
213-
model.runs.perLhcPeriodOverviewModel.pagination.itemsPerPage = 2;
214-
});
215-
216211
const targetFileName = 'data.json';
217212
await waitForButtonToBecomeActive(page, EXPORT_RUNS_TRIGGER_SELECTOR);
218213
// First export
219214
await pressElement(page, EXPORT_RUNS_TRIGGER_SELECTOR, true);
220-
await page.waitForSelector('select.form-control', { timeout: 200 });
221-
await page.waitForSelector('option[value=runNumber]', { timeout: 200 });
215+
await page.waitForSelector('select.form-control');
216+
await page.waitForSelector('option[value=runNumber]');
222217
await page.select('select.form-control', 'runQuality', 'runNumber', 'definition', 'lhcPeriod');
223218
await expectInnerText(page, '#send:enabled', 'Export');
224219

0 commit comments

Comments
 (0)