From 74597d69f4ce977f587ed25583985a441099096a Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Mon, 14 Aug 2023 14:26:20 -0700 Subject: [PATCH 1/7] fix(ITC): initialize ITC in `created()` hook --- .../timeConductor/independent/IndependentTimeConductor.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/timeConductor/independent/IndependentTimeConductor.vue b/src/plugins/timeConductor/independent/IndependentTimeConductor.vue index 844ae9a45ad..c0c9b01d41a 100644 --- a/src/plugins/timeConductor/independent/IndependentTimeConductor.vue +++ b/src/plugins/timeConductor/independent/IndependentTimeConductor.vue @@ -194,7 +194,7 @@ export default { deep: true } }, - mounted() { + created() { this.initialize(); }, beforeUnmount() { From f9c5a6d926396b13bd2a0e0d66eb66afb3d7f4c9 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Mon, 14 Aug 2023 14:28:55 -0700 Subject: [PATCH 2/7] fix(e2e): stabilize ITC tests --- e2e/appActions.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/e2e/appActions.js b/e2e/appActions.js index e22379bf9fa..07c3eda1305 100644 --- a/e2e/appActions.js +++ b/e2e/appActions.js @@ -495,8 +495,7 @@ async function setIndependentTimeConductorBounds(page, startDate, endDate) { // Bring up the time conductor popup await page.click('.c-conductor-holder--compact .c-compact-tc'); - - await expect(page.locator('.itc-popout')).toBeVisible(); + await expect(page.locator('.itc-popout')).toBeInViewport(); await setTimeBounds(page, startDate, endDate); From ec8b11b8110cd0c1a890116385a5db10c1bbabab Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Mon, 14 Aug 2023 14:29:07 -0700 Subject: [PATCH 3/7] docs: add JSDocs --- e2e/appActions.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/e2e/appActions.js b/e2e/appActions.js index 07c3eda1305..6086e2fc0c8 100644 --- a/e2e/appActions.js +++ b/e2e/appActions.js @@ -480,6 +480,12 @@ async function setEndOffset(page, offset) { await setTimeConductorOffset(page, offset); } +/** + * Set the time conductor bounds in fixed time mode + * @param {import('@playwright/test').Page} page + * @param {string} startDate + * @param {string} endDate + */ async function setTimeConductorBounds(page, startDate, endDate) { // Bring up the time conductor popup await page.click('.l-shell__time-conductor.c-compact-tc'); @@ -489,6 +495,12 @@ async function setTimeConductorBounds(page, startDate, endDate) { await page.keyboard.press('Enter'); } +/** + * Set the independent time conductor bounds in fixed time mode + * @param {import('@playwright/test').Page} page + * @param {string} startDate + * @param {string} endDate + */ async function setIndependentTimeConductorBounds(page, startDate, endDate) { // Activate Independent Time Conductor in Fixed Time Mode await page.getByRole('switch').click(); @@ -502,6 +514,12 @@ async function setIndependentTimeConductorBounds(page, startDate, endDate) { await page.keyboard.press('Enter'); } +/** + * Set the bounds of the visible conductor in fixed time mode + * @param {import('@playwright/test').Page} page + * @param {string} startDate + * @param {string} endDate + */ async function setTimeBounds(page, startDate, endDate) { if (startDate) { // Fill start time From 5e607b438605fa2ae3c8175cc196cad49b1dd7e7 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Mon, 14 Aug 2023 14:44:57 -0700 Subject: [PATCH 4/7] refactor: lint:fix --- e2e/appActions.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/appActions.js b/e2e/appActions.js index 6086e2fc0c8..3544dc940f4 100644 --- a/e2e/appActions.js +++ b/e2e/appActions.js @@ -516,9 +516,9 @@ async function setIndependentTimeConductorBounds(page, startDate, endDate) { /** * Set the bounds of the visible conductor in fixed time mode - * @param {import('@playwright/test').Page} page - * @param {string} startDate - * @param {string} endDate + * @param {import('@playwright/test').Page} page + * @param {string} startDate + * @param {string} endDate */ async function setTimeBounds(page, startDate, endDate) { if (startDate) { From 9b9898c6c3000b315fe3490c7943d186d01f3e07 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Wed, 16 Aug 2023 10:51:21 -0700 Subject: [PATCH 5/7] test(e2e): add comment and assertion --- e2e/appActions.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/e2e/appActions.js b/e2e/appActions.js index 3544dc940f4..9df198ef341 100644 --- a/e2e/appActions.js +++ b/e2e/appActions.js @@ -482,12 +482,16 @@ async function setEndOffset(page, offset) { /** * Set the time conductor bounds in fixed time mode + * + * NOTE: Unless explicitly testing the Time Conductor itself, it is advised to instead + * navigate directly to the object with the desired time bounds using `navigateToObjectWithFixedTimeBounds()`. * @param {import('@playwright/test').Page} page * @param {string} startDate * @param {string} endDate */ async function setTimeConductorBounds(page, startDate, endDate) { // Bring up the time conductor popup + expect(await page.locator('.l-shell__time-conductor.c-compact-tc').count()).toBe(1); await page.click('.l-shell__time-conductor.c-compact-tc'); await setTimeBounds(page, startDate, endDate); From f576ffd0b3bf24d1a0850d85af57624a3d5f26a3 Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Wed, 16 Aug 2023 10:59:26 -0700 Subject: [PATCH 6/7] refactor: lint:fix --- e2e/appActions.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/appActions.js b/e2e/appActions.js index 9df198ef341..98a39bb5c6b 100644 --- a/e2e/appActions.js +++ b/e2e/appActions.js @@ -482,7 +482,7 @@ async function setEndOffset(page, offset) { /** * Set the time conductor bounds in fixed time mode - * + * * NOTE: Unless explicitly testing the Time Conductor itself, it is advised to instead * navigate directly to the object with the desired time bounds using `navigateToObjectWithFixedTimeBounds()`. * @param {import('@playwright/test').Page} page From d0b3279e87e5a55efc3e7c74902c3e64c7e427ab Mon Sep 17 00:00:00 2001 From: Jesse Mazzella Date: Wed, 16 Aug 2023 11:46:17 -0700 Subject: [PATCH 7/7] test(e2e): attempt to stabilize tagging test --- e2e/tests/functional/plugins/plot/tagging.e2e.spec.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js b/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js index d8bcd3c1fed..c92f775b7cf 100644 --- a/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js +++ b/e2e/tests/functional/plugins/plot/tagging.e2e.spec.js @@ -91,8 +91,10 @@ test.describe('Plot Tagging', () => { await expect(page.getByText('No tags to display for this item')).toBeVisible(); const canvas = page.locator('canvas').nth(1); - //Wait for canvas to stabilize. + await waitForPlotsToRender(page); + + await expect(canvas).toBeInViewport(); await canvas.hover({ trial: true }); // click on the tagged plot point