diff --git a/lib/public/components/qcFlags/qcFlagsBreadcrumbs.js b/lib/public/components/qcFlags/qcFlagsBreadcrumbs.js index 111b47311d..8167699c08 100644 --- a/lib/public/components/qcFlags/qcFlagsBreadcrumbs.js +++ b/lib/public/components/qcFlags/qcFlagsBreadcrumbs.js @@ -22,29 +22,33 @@ export const qcFlagsBreadcrumbs = ({ remoteDataPass, remoteSimulationPass, remot } return breadcrumbs([ - h('h2', header), - remoteDataPass && remoteDataPass.match({ - Success: ({ id, name }) => h('h2', frontLink(name, 'runs-per-data-pass', { dataPassId: id })), + h('h2#breadcrumb-header', header), + remoteDataPass?.match({ + Success: ({ id, name }) => h('h2#breadcrumb-data-pass-name', frontLink(name, 'runs-per-data-pass', { dataPassId: id })), Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load data pass info'), Loading: () => h('', spinner({ size: 2, absolute: false })), NotAsked: () => tooltip(h('.f3', iconWarning()), 'No data pass data was asked for'), }), - remoteSimulationPass && remoteSimulationPass.match({ - Success: ({ id, name }) => h('h2', frontLink(name, 'runs-per-simulation-pass', { simulationPassId: id })), + remoteSimulationPass?.match({ + Success: ({ id, name }) => h( + 'h2#breadcrumb-simulation-pass-name', + frontLink(name, 'runs-per-simulation-pass', { simulationPassId: id }), + ), Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load simulation pass info'), Loading: () => h('', spinner({ size: 2, absolute: false })), NotAsked: () => tooltip(h('.f3', iconWarning()), 'No simulation pass data was asked for'), }), remoteRun.match({ - Success: ({ runNumber, runQuality }) => runQuality === RunQualities.BAD - ? h('h2.danger', frontLink(runNumber, 'run-detail', { runNumber })) - : h('h2', frontLink(runNumber, 'run-detail', { runNumber })), + Success: ({ runNumber, runQuality }) => h( + `h2#breadcrumb-run-number${runQuality === RunQualities.BAD ? '.danger' : ''}`, + frontLink(runNumber, 'run-detail', { runNumber }), + ), Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load run info'), Loading: () => h('', spinner({ size: 2, absolute: false })), NotAsked: () => tooltip(h('.f3', iconWarning()), 'No run data was asked for'), }), - remoteDplDetector && remoteDplDetector.match({ - Success: (dplDetector) => h('h2', dplDetector.name), + remoteDplDetector?.match({ + Success: (dplDetector) => h('h2#breadcrumb-detector-name', dplDetector.name), Failure: () => tooltip(h('.f3', iconWarning()), 'Not able to load detector info'), Loading: () => h('', spinner({ size: 2, absolute: false })), NotAsked: () => tooltip(h('.f3', iconWarning()), 'No detector data was asked for'), diff --git a/lib/public/views/DataPasses/PerSimulationPassOverview/DataPassesPerSimulationPassOverviewPage.js b/lib/public/views/DataPasses/PerSimulationPassOverview/DataPassesPerSimulationPassOverviewPage.js index 63934a9c82..7f342d5e9b 100644 --- a/lib/public/views/DataPasses/PerSimulationPassOverview/DataPassesPerSimulationPassOverviewPage.js +++ b/lib/public/views/DataPasses/PerSimulationPassOverview/DataPassesPerSimulationPassOverviewPage.js @@ -53,7 +53,7 @@ export const DataPassesPerSimulationPassOverviewPage = ({ dataPasses: { const { items, simulationPass, pagination } = dataPassesPerSimulationPassOverviewModel; - const commonTitle = h('h2', 'Data Passes per MC'); + const commonTitle = h('h2#breadcrumb-header', 'Data Passes per MC'); return h('', { onremove: () => dataPassesPerSimulationPassOverviewModel.reset(), @@ -63,7 +63,7 @@ export const DataPassesPerSimulationPassOverviewPage = ({ dataPasses: { h( '.flex-row.g1.items-center', simulationPass.match({ - Success: (payload) => breadcrumbs([commonTitle, h('h2', payload.name)]), + Success: (payload) => breadcrumbs([commonTitle, h('h2#breadcrumb-simulation-pass-name', payload.name)]), Failure: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'Not able to load simulation pass info')], Loading: () => [commonTitle, h('', spinner({ size: 2, absolute: false }))], NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')], diff --git a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js index 17812d641e..2708719ecc 100644 --- a/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js +++ b/lib/public/views/Runs/RunPerDataPass/RunsPerDataPassOverviewPage.js @@ -200,7 +200,7 @@ export const RunsPerDataPassOverviewPage = ({ ), }; - const commonTitle = h('h2', { style: 'white-space: nowrap;' }, 'Physics Runs'); + const commonTitle = h('h2#breadcrumb-header', { style: 'white-space: nowrap;' }, 'Physics Runs'); return h('', { onremove: () => perDataPassOverviewModel.reset(false) }, [ h('.flex-row.justify-between.items-center.g2', [ @@ -210,7 +210,7 @@ export const RunsPerDataPassOverviewPage = ({ '.flex-row.g1.items-center', remoteDataPass.match({ Success: (dataPass) => h('.flex-row.items-center.g1', [ - breadcrumbs([commonTitle, h('h2', dataPass.name)]), + breadcrumbs([commonTitle, h('h2#breadcrumb-data-pass-name', dataPass.name)]), h('#skimmableControl', skimmableControl( dataPass, () => { diff --git a/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js b/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js index c02da47369..21a0092dda 100644 --- a/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js +++ b/lib/public/views/Runs/RunsPerSimulationPass/RunsPerSimulationPassOverviewPage.js @@ -95,13 +95,13 @@ export const RunsPerSimulationPassOverviewPage = ({ ), }; - const commonTitle = h('h2', 'Runs per MC'); + const commonTitle = h('h2#breadcrumb-header', 'Runs per MC'); return h('', [ h('.flex-row.justify-between.items-center.g2', [ h( '.flex-row.g1.items-center', remoteSimulationPass.match({ - Success: ({ name }) => breadcrumbs([commonTitle, h('h2', name)]), + Success: ({ name }) => breadcrumbs([commonTitle, h('h2#breadcrumb-simulation-pass-name', name)]), Failure: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'Not able to load simulation pass info')], Loading: () => [commonTitle, h('', spinner({ size: 2, absolute: false }))], NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')], diff --git a/lib/public/views/SimulationPasses/AnchoredOverview/AnchoredSimulationPassesOverviewPage.js b/lib/public/views/SimulationPasses/AnchoredOverview/AnchoredSimulationPassesOverviewPage.js index 79abd39454..5894ba1a05 100644 --- a/lib/public/views/SimulationPasses/AnchoredOverview/AnchoredSimulationPassesOverviewPage.js +++ b/lib/public/views/SimulationPasses/AnchoredOverview/AnchoredSimulationPassesOverviewPage.js @@ -41,7 +41,7 @@ export const AnchoredSimulationPassesOverviewPage = ({ const { items, dataPass, pagination } = anchoredSimulationPassesOverviewModel; - const commonTitle = h('h2', { style: 'white-space: nowrap;' }, 'Anchored MC'); + const commonTitle = h('h2#breadcrumb-header', { style: 'white-space: nowrap;' }, 'Anchored MC'); return h( '', @@ -54,7 +54,7 @@ export const AnchoredSimulationPassesOverviewPage = ({ h( '.flex-row.g1.items-center', dataPass.match({ - Success: (payload) => breadcrumbs([commonTitle, h('h2', payload.name)]), + Success: (payload) => breadcrumbs([commonTitle, h('h2#breadcrumb-simulation-pass-name', payload.name)]), Failure: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'Not able to load data pass info')], Loading: () => [commonTitle, spinner({ size: 2, absolute: false })], NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')], diff --git a/lib/public/views/SimulationPasses/PerLhcPeriodOverview/SimulationPassesPerLhcPeriodOverviewPage.js b/lib/public/views/SimulationPasses/PerLhcPeriodOverview/SimulationPassesPerLhcPeriodOverviewPage.js index 998bac243b..3cc12756d0 100644 --- a/lib/public/views/SimulationPasses/PerLhcPeriodOverview/SimulationPassesPerLhcPeriodOverviewPage.js +++ b/lib/public/views/SimulationPasses/PerLhcPeriodOverview/SimulationPassesPerLhcPeriodOverviewPage.js @@ -40,7 +40,7 @@ export const SimulationPassesPerLhcPeriodOverviewPage = ({ simulationPasses: { const { items: simulationPasses, lhcPeriod } = simulationPassesPerLhcPeriodOverviewModel; - const commonTitle = h('h2', { style: 'white-space: nowrap;' }, 'Monte Carlo'); + const commonTitle = h('h2#breadcrumb-header', { style: 'white-space: nowrap;' }, 'Monte Carlo'); return h('', { onremove: () => simulationPassesPerLhcPeriodOverviewModel.reset(), @@ -50,7 +50,7 @@ export const SimulationPassesPerLhcPeriodOverviewPage = ({ simulationPasses: { h( '.flex-row.g1.items-center', lhcPeriod.match({ - Success: (payload) => breadcrumbs([commonTitle, h('h2', payload.name)]), + Success: (payload) => breadcrumbs([commonTitle, h('h2#breadcrumb-lhc-period-name', payload.name)]), Failure: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'Not able to load LHC Period info')], Loading: () => [commonTitle, spinner({ size: 2, absolute: false })], NotAsked: () => [commonTitle, tooltip(h('.f3', iconWarning()), 'No data was asked for')], diff --git a/test/public/qcFlags/forDataPassCreation.test.js b/test/public/qcFlags/forDataPassCreation.test.js index a65fccd62f..ceba6e5ce3 100644 --- a/test/public/qcFlags/forDataPassCreation.test.js +++ b/test/public/qcFlags/forDataPassCreation.test.js @@ -62,10 +62,10 @@ module.exports = () => { const title = await page.title(); expect(title).to.equal('AliceO2 Bookkeeping'); - await expectInnerText(page, 'h2:nth-of-type(1)', 'QC'); - await expectInnerText(page, 'h2:nth-of-type(2)', 'LHC22b_apass1'); - await expectInnerText(page, 'h2:nth-of-type(3)', '106'); - await expectInnerText(page, 'h2:nth-of-type(4)', 'CPV'); + await expectInnerText(page, '#breadcrumb-header', 'QC'); + await expectInnerText(page, '#breadcrumb-data-pass-name', 'LHC22b_apass1'); + await expectInnerText(page, '#breadcrumb-run-number', '106'); + await expectInnerText(page, '#breadcrumb-detector-name', 'CPV'); }); it('can navigate to runs per data pass page from breadcrumbs link', async () => { @@ -77,7 +77,7 @@ module.exports = () => { }, }); - await waitForNavigation(page, () => pressElement(page, '.breadcrumbs *:nth-child(3) a')); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-data-pass-name a')); expectUrlParams(page, { page: 'runs-per-data-pass', dataPassId: '1' }); }); @@ -90,7 +90,7 @@ module.exports = () => { }, }); - await waitForNavigation(page, () => pressElement(page, '.breadcrumbs *:nth-child(5) a')); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-run-number a')); expectUrlParams(page, { page: 'run-detail', runNumber: '106' }); }); diff --git a/test/public/qcFlags/forDataPassOverview.test.js b/test/public/qcFlags/forDataPassOverview.test.js index e93f95b386..6de965cbc4 100644 --- a/test/public/qcFlags/forDataPassOverview.test.js +++ b/test/public/qcFlags/forDataPassOverview.test.js @@ -59,10 +59,10 @@ module.exports = () => { const title = await page.title(); expect(title).to.equal('AliceO2 Bookkeeping'); - await expectInnerText(page, 'h2:nth-of-type(1)', 'QC'); - await expectInnerText(page, 'h2:nth-of-type(2)', 'LHC22b_apass1'); - await expectInnerText(page, 'h2:nth-of-type(3)', '106'); - await expectInnerText(page, 'h2:nth-of-type(4)', 'CPV'); + await expectInnerText(page, '#breadcrumb-header', 'QC'); + await expectInnerText(page, '#breadcrumb-data-pass-name', 'LHC22b_apass1'); + await expectInnerText(page, '#breadcrumb-run-number', '106'); + await expectInnerText(page, '#breadcrumb-detector-name', 'CPV'); }); it('can navigate to runs per data pass page from breadcrumbs link', async () => { @@ -72,7 +72,7 @@ module.exports = () => { dplDetectorId: 1, } }); - await waitForNavigation(page, () => pressElement(page, 'h2:nth-of-type(2)')); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-data-pass-name')); expectUrlParams(page, { page: 'runs-per-data-pass', dataPassId: '1' }); }); @@ -83,7 +83,7 @@ module.exports = () => { dplDetectorId: 1, } }); - await waitForNavigation(page, () => pressElement(page, 'h2:nth-of-type(3)')); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-run-number')); expectUrlParams(page, { page: 'run-detail', runNumber: '106' }); }); @@ -118,7 +118,7 @@ module.exports = () => { dplDetectorId: 1, } }); - await page.waitForSelector('.breadcrumbs *:nth-child(5).danger a'); + await page.waitForSelector('#breadcrumb-run-number.danger a'); const title = 'Quality of the run was changed to bad so it is no more subject to QC'; await page.waitForSelector(`button.btn.btn-primary[disabled][title="${title}"]`); }); diff --git a/test/public/qcFlags/forSimulationPassCreation.test.js b/test/public/qcFlags/forSimulationPassCreation.test.js index 46bc65365c..8d0bd21d01 100644 --- a/test/public/qcFlags/forSimulationPassCreation.test.js +++ b/test/public/qcFlags/forSimulationPassCreation.test.js @@ -62,10 +62,10 @@ module.exports = () => { const title = await page.title(); expect(title).to.equal('AliceO2 Bookkeeping'); - await expectInnerText(page, 'h2:nth-of-type(1)', 'QC'); - await expectInnerText(page, 'h2:nth-of-type(2)', 'LHC23k6c'); - await expectInnerText(page, 'h2:nth-of-type(3)', '106'); - await expectInnerText(page, 'h2:nth-of-type(4)', 'CPV'); + await expectInnerText(page, '#breadcrumb-header', 'QC'); + await expectInnerText(page, '#breadcrumb-simulation-pass-name', 'LHC23k6c'); + await expectInnerText(page, '#breadcrumb-run-number', '106'); + await expectInnerText(page, '#breadcrumb-detector-name', 'CPV'); }); it('can navigate to runs per simulation pass page from breadcrumbs link', async () => { @@ -77,7 +77,7 @@ module.exports = () => { }, }); - await waitForNavigation(page, () => pressElement(page, '.breadcrumbs *:nth-child(3) a')); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-simulation-pass-name a')); expectUrlParams(page, { page: 'runs-per-simulation-pass', simulationPassId: '1' }); }); @@ -90,7 +90,7 @@ module.exports = () => { }, }); - await waitForNavigation(page, () => pressElement(page, '.breadcrumbs *:nth-child(5) a')); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-run-number a')); expectUrlParams(page, { page: 'run-detail', runNumber: '106' }); }); diff --git a/test/public/qcFlags/forSimulationPassOverview.test.js b/test/public/qcFlags/forSimulationPassOverview.test.js index 1ee083d70d..1160bd229a 100644 --- a/test/public/qcFlags/forSimulationPassOverview.test.js +++ b/test/public/qcFlags/forSimulationPassOverview.test.js @@ -60,10 +60,10 @@ module.exports = () => { const title = await page.title(); expect(title).to.equal('AliceO2 Bookkeeping'); - await expectInnerText(page, 'h2:nth-of-type(1)', 'QC'); - await expectInnerText(page, 'h2:nth-of-type(2)', 'LHC23k6c'); - await expectInnerText(page, 'h2:nth-of-type(3)', '106'); - await expectInnerText(page, 'h2:nth-of-type(4)', 'CPV'); + await expectInnerText(page, '#breadcrumb-header', 'QC'); + await expectInnerText(page, '#breadcrumb-simulation-pass-name', 'LHC23k6c'); + await expectInnerText(page, '#breadcrumb-run-number', '106'); + await expectInnerText(page, '#breadcrumb-detector-name', 'CPV'); }); it('can navigate to runs per simulation pass page from breadcrumbs link', async () => { @@ -73,7 +73,7 @@ module.exports = () => { dplDetectorId: 1, } }); - await waitForNavigation(page, () => pressElement(page, 'h2:nth-of-type(2)')); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-simulation-pass-name')); expectUrlParams(page, { page: 'runs-per-simulation-pass', simulationPassId: '1' }); }); @@ -84,7 +84,7 @@ module.exports = () => { dplDetectorId: 1, } }); - await waitForNavigation(page, () => pressElement(page, 'h2:nth-of-type(3)')); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-run-number')); expectUrlParams(page, { page: 'run-detail', runNumber: '106' }); }); diff --git a/test/public/qcFlags/gaqOverview.test.js b/test/public/qcFlags/gaqOverview.test.js index 356c5d6c3f..fb0497fbbe 100644 --- a/test/public/qcFlags/gaqOverview.test.js +++ b/test/public/qcFlags/gaqOverview.test.js @@ -57,9 +57,9 @@ module.exports = () => { const title = await page.title(); expect(title).to.equal('AliceO2 Bookkeeping'); - await expectInnerText(page, 'h2:nth-of-type(1)', 'GAQ'); - await expectInnerText(page, 'h2:nth-of-type(2)', 'LHC22b_apass1'); - await expectInnerText(page, 'h2:nth-of-type(3)', '106'); + await expectInnerText(page, '#breadcrumb-header', 'GAQ'); + await expectInnerText(page, '#breadcrumb-data-pass-name', 'LHC22b_apass1'); + await expectInnerText(page, '#breadcrumb-run-number', '106'); }); it('shows correct datatypes in respective columns', async () => { @@ -98,7 +98,7 @@ module.exports = () => { ], ]); - await waitForNavigation(page, () => pressElement(page, 'h2:nth-of-type(2) a', true)); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-data-pass-name a', true)); await waitForNavigation(page, () => pressElement(page, '#row106-EMC a', true)); await pressElement(page, '#flag-type-panel .popover-trigger', true); await pressElement(page, '#flag-type-dropdown-option-3', true); @@ -106,7 +106,7 @@ module.exports = () => { await page.waitForSelector('button#submit[disabled]', { hidden: true, timeout: 250 }); await waitForNavigation(page, () => pressElement(page, 'button#submit', true)); - await waitForNavigation(page, () => pressElement(page, 'h2:nth-of-type(2) a', true)); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-data-pass-name a', true)); await waitForNavigation(page, () => pressElement(page, '#row106-globalAggregatedQuality a', true)); await waitForTableLength(page, 7); diff --git a/test/public/qcFlags/synchronousOverview.test.js b/test/public/qcFlags/synchronousOverview.test.js index ea3f8acd45..5b366c2a8a 100644 --- a/test/public/qcFlags/synchronousOverview.test.js +++ b/test/public/qcFlags/synchronousOverview.test.js @@ -52,9 +52,9 @@ module.exports = () => { expect(response.status()).to.equal(200); expect(await page.title()).to.equal('AliceO2 Bookkeeping'); - await expectInnerText(page, 'h2:nth-of-type(1)', 'Sync QC'); - await expectInnerText(page, 'h2:nth-of-type(2)', '56'); - await expectInnerText(page, 'h2:nth-of-type(3)', 'FT0'); + await expectInnerText(page, '#breadcrumb-header', 'Sync QC'); + await expectInnerText(page, '#breadcrumb-run-number', '56'); + await expectInnerText(page, '#breadcrumb-detector-name', 'FT0'); }); it('shows correct datatypes in respective columns', async () => { @@ -81,7 +81,7 @@ module.exports = () => { }); it('can navigate to run details page from breadcrumbs link', async () => { - await waitForNavigation(page, () => pressElement(page, 'h2:nth-of-type(2)')); + await waitForNavigation(page, () => pressElement(page, '#breadcrumb-run-number')); expectUrlParams(page, { page: 'run-detail', runNumber: '56' }); }); }; diff --git a/test/public/simulationPasses/overviewAnchoredSimulationPasses.test.js b/test/public/simulationPasses/overviewAnchoredSimulationPasses.test.js index a78c4998c6..2693c2000c 100644 --- a/test/public/simulationPasses/overviewAnchoredSimulationPasses.test.js +++ b/test/public/simulationPasses/overviewAnchoredSimulationPasses.test.js @@ -49,8 +49,8 @@ module.exports = () => { const title = await page.title(); expect(title).to.equal('AliceO2 Bookkeeping'); - await expectInnerText(page, 'h2:nth-of-type(1)', 'Anchored MC'); - await expectInnerText(page, 'h2:nth-of-type(2)', 'LHC22a_apass1'); + await expectInnerText(page, '#breadcrumb-header', 'Anchored MC'); + await expectInnerText(page, '#breadcrumb-simulation-pass-name', 'LHC22a_apass1'); }); it('shows correct datatypes in respective columns', async () => {