Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(e2e): Stabilize ITC tests #6933

Merged
merged 9 commits into from
Aug 16, 2023
Merged
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
25 changes: 23 additions & 2 deletions e2e/appActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -480,29 +480,50 @@ async function setEndOffset(page, offset) {
await setTimeConductorOffset(page, offset);
}

/**
* Set the time conductor bounds in fixed time mode
ozyx marked this conversation as resolved.
Show resolved Hide resolved
*
* 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);

await page.keyboard.press('Enter');
}

/**
* Set the independent time conductor bounds in fixed time mode
ozyx marked this conversation as resolved.
Show resolved Hide resolved
* @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();

// 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);

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
Expand Down
4 changes: 3 additions & 1 deletion e2e/tests/functional/plugins/plot/tagging.e2e.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default {
deep: true
}
},
mounted() {
created() {
this.initialize();
},
beforeUnmount() {
Expand Down