diff --git a/e2e/tests/functional/tooltips.e2e.spec.js b/e2e/tests/functional/tooltips.e2e.spec.js index ae50c9b79c..14f4476234 100644 --- a/e2e/tests/functional/tooltips.e2e.spec.js +++ b/e2e/tests/functional/tooltips.e2e.spec.js @@ -89,20 +89,6 @@ test.describe('Verify tooltips', () => { await expandEntireTree(page); }); - // LAD Tables - DONE - // Expanded collapsed plot legend - DONE - // Object Labels - DONE - // Display Layout headers - DONE - // Flexible Layout headers - DONE - // Tab View layout headers - DONE - // Search - DONE - // Gauge - - // Notebook Embed - DONE - // Telemetry Table - - // Timeline Objects - // Tree - DONE - // Recent Objects - test('display correct paths for LAD tables', async ({ page, openmctConfig }) => { // Create LAD table await createDomainObjectWithDefaults(page, { @@ -254,13 +240,13 @@ test.describe('Verify tooltips', () => { tooltipText = tooltipText.replace('\n', '').trim(); expect(tooltipText).toBe('My Items / Test Overlay Plot'); - // await page.keyboard.up('Control'); - // await page.locator('.c-plot-legend__view-control >> nth=0').click(); - // await page.keyboard.down('Control'); - // await page.locator('.plot-wrapper-expanded-legend .plot-series-name').first().hover(); - // tooltipText = await page.locator('.c-tooltip').textContent(); - // tooltipText = tooltipText.replace('\n', '').trim(); - // expect(tooltipText).toBe(sineWaveObject1.path); + await page.keyboard.up('Control'); + await page.locator('.c-plot-legend__view-control >> nth=0').click(); + await page.keyboard.down('Control'); + await page.locator('.plot-wrapper-expanded-legend .plot-series-name').first().hover(); + tooltipText = await page.locator('.c-tooltip').textContent(); + tooltipText = tooltipText.replace('\n', '').trim(); + expect(tooltipText).toBe(sineWaveObject1.path); await page.getByText('Test Stacked Plot').nth(2).hover(); tooltipText = await page.locator('.c-tooltip').textContent(); @@ -345,18 +331,18 @@ test.describe('Verify tooltips', () => { expect(tooltipText).toBe(sineWaveObject3.path); }); - test('display path for source telemetry when hovering over gauge', ({ page }) => { - expect(true).toBe(true); - // await createDomainObjectWithDefaults(page, { - // type: 'Gauge', - // name: 'Test Gauge' - // }); - // await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.c-gauge__wrapper'); - // await page.keyboard.down('Control'); - // await page.locator('.c-gauge__current-value-text-wrapper').hover(); - // let tooltipText = await page.locator('.c-tooltip').textContent(); - // tooltipText = tooltipText.replace('\n', '').trim(); - // expect(tooltipText).toBe(sineWaveObject3.path); + test('display path for source telemetry when hovering over gauge', async ({ page }) => { + await createDomainObjectWithDefaults(page, { + type: 'Gauge', + name: 'Test Gauge' + }); + await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.c-gauge__wrapper'); + await page.keyboard.down('Control'); + // eslint-disable-next-line playwright/no-force-option + await page.locator('.c-gauge.c-dial').hover({ position: { x: 0, y: 0 }, force: true }); + let tooltipText = await page.locator('.c-tooltip').textContent(); + tooltipText = tooltipText.replace('\n', '').trim(); + expect(tooltipText).toBe(sineWaveObject3.path); }); test('display tooltip path for notebook embeds', async ({ page }) => { @@ -373,26 +359,105 @@ test.describe('Verify tooltips', () => { expect(tooltipText).toBe(sineWaveObject3.path); }); - // test('display tooltip path for telemetry table names', async ({ page }) => { - // await setEndOffset(page, { secs: '10' }); - // await createDomainObjectWithDefaults(page, { - // type: 'Telemetry Table', - // name: 'Test Telemetry Table' - // }); + test('display tooltip path for telemetry table names', async ({ page }) => { + // set endBound to 10 seconds after start bound + const url = await page.url(); + const parsedUrl = new URL(url.replace('#', '!')); + const startBound = Number(parsedUrl.searchParams.get('tc.startBound')); + const tenSecondsInMilliseconds = 10 * 1000; + const endBound = startBound + tenSecondsInMilliseconds; + parsedUrl.searchParams.set('tc.endBound', endBound); + await page.goto(parsedUrl.href.replace('!', '#')); - // await page.dragAndDrop(`text=${sineWaveObject1.name}`, '.c-telemetry-table'); - // await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.c-telemetry-table'); + await createDomainObjectWithDefaults(page, { + type: 'Telemetry Table', + name: 'Test Telemetry Table' + }); - // await page.locator('button[title="Save"]').click(); - // await page.locator('text=Save and Finish Editing').click(); + await page.dragAndDrop(`text=${sineWaveObject1.name}`, '.c-telemetry-table'); + await page.dragAndDrop(`text=${sineWaveObject3.name}`, '.c-telemetry-table'); - // // .c-telemetry-table__body + await page.locator('button[title="Save"]').click(); + await page.locator('text=Save and Finish Editing').click(); + await page.keyboard.down('Control'); - // await page.keyboard.down('Control'); + await page.locator('.noselect > [title="SWG 3"]').first().hover(); + let tooltipText = await page.locator('.c-tooltip').textContent(); + tooltipText = tooltipText.replace('\n', '').trim(); + expect(tooltipText).toBe(sineWaveObject3.path); - // await page.locator('.noselect > [title="SWG 3"]').first().hover(); - // let tooltipText = await page.locator('.c-tooltip').textContent(); - // tooltipText = tooltipText.replace('\n', '').trim(); - // expect(tooltipText).toBe(sineWaveObject3.path); - // }); + await page.locator('.noselect > [title="SWG 1"]').first().hover(); + tooltipText = await page.locator('.c-tooltip').textContent(); + tooltipText = tooltipText.replace('\n', '').trim(); + expect(tooltipText).toBe(sineWaveObject1.path); + }); + + test('display tooltip path for recently viewed items', async ({ page }) => { + // drag up Recently Viewed pane + await page + .locator('.l-pane.l-pane--vertical-handle-before', { + hasText: 'Recently Viewed' + }) + .locator('.l-pane__handle') + .hover(); + await page.mouse.down(); + await page.mouse.move(0, 300); + await page.mouse.up(); + + await page.keyboard.down('Control'); + await page.getByLabel('Recent Objects').getByText(sineWaveObject3.name).hover(); + let tooltipText = await page.locator('.c-tooltip').textContent(); + tooltipText = tooltipText.replace('\n', '').trim(); + expect(tooltipText).toBe(sineWaveObject3.path); + + await page.getByLabel('Recent Objects').getByText(sineWaveObject2.name).hover(); + tooltipText = await page.locator('.c-tooltip').textContent(); + tooltipText = tooltipText.replace('\n', '').trim(); + expect(tooltipText).toBe(sineWaveObject2.path); + + await page.getByLabel('Recent Objects').getByText(sineWaveObject1.name).hover(); + tooltipText = await page.locator('.c-tooltip').textContent(); + tooltipText = tooltipText.replace('\n', '').trim(); + expect(tooltipText).toBe(sineWaveObject1.path); + }); + + test('display tooltip path for time strips', async ({ page }) => { + // Create Time Strip + await createDomainObjectWithDefaults(page, { + type: 'Time Strip', + name: 'Test Time Strip' + }); + // Edit Overlay Plot + await page.locator('[title="Edit"]').click(); + await page.dragAndDrop( + `text=${sineWaveObject1.name}`, + '.c-object-view.is-object-type-time-strip' + ); + await page.dragAndDrop( + `text=${sineWaveObject2.name}`, + '.c-object-view.is-object-type-time-strip' + ); + await page.dragAndDrop( + `text=${sineWaveObject3.name}`, + '.c-object-view.is-object-type-time-strip' + ); + await page.locator('button[title="Save"]').click(); + await page.locator('text=Save and Finish Editing').click(); + + await page.keyboard.down('Control'); + await page.getByText(sineWaveObject1.name).nth(2).hover(); + let tooltipText = await page.locator('.c-tooltip').textContent(); + tooltipText = tooltipText.replace('\n', '').trim(); + expect(tooltipText).toBe(sineWaveObject1.path); + + await page.getByText(sineWaveObject2.name).nth(2).hover(); + tooltipText = await page.locator('.c-tooltip').textContent(); + tooltipText = tooltipText.replace('\n', '').trim(); + expect(tooltipText).toBe(sineWaveObject2.path); + + await page.getByText(sineWaveObject3.name).nth(2).hover(); + tooltipText = await page.locator('.c-tooltip').textContent(); + tooltipText = tooltipText.replace('\n', '').trim(); + expect(tooltipText).toBe(sineWaveObject3.path); + }); }); diff --git a/src/plugins/gauge/components/GaugeComponent.vue b/src/plugins/gauge/components/GaugeComponent.vue index 3f4bec4ff8..b173388601 100644 --- a/src/plugins/gauge/components/GaugeComponent.vue +++ b/src/plugins/gauge/components/GaugeComponent.vue @@ -226,7 +226,7 @@