diff --git a/e2e/auth.setup.ts b/e2e/auth.setup.ts index 41eb216..e78fc80 100644 --- a/e2e/auth.setup.ts +++ b/e2e/auth.setup.ts @@ -16,6 +16,7 @@ setup('authenticate', async ({ page }: { page: Page }) => { await page.getByLabel('Username input field').or(page.getByTestId(/Username input field/)).fill(credentials.username); await page.getByLabel('Login button').or(page.getByTestId(/Password input field/)).fill(credentials.password); await page.getByLabel('Login button').or(page.getByTestId(/Login button/)).click(); + await page.waitForLoadState('networkidle') skipBtn = page.getByLabel('Skip').or(page.getByTestId(/Skip change password button/)); } else { @@ -23,6 +24,7 @@ setup('authenticate', async ({ page }: { page: Page }) => { await page.getByLabel('Username input field').fill(credentials.username); await page.getByLabel('Password input field').fill(credentials.password); await page.getByLabel('Login button').click(); + await page.waitForLoadState('networkidle') skipBtn = page.getByLabel('Skip'); } diff --git a/e2e/plugin.spec.ts b/e2e/plugin.spec.ts index 24b8832..106d2e0 100644 --- a/e2e/plugin.spec.ts +++ b/e2e/plugin.spec.ts @@ -396,9 +396,7 @@ pluginTest.describe("plugin testing", () => { await page.waitForSelector("[aria-label='Panel editor content'] esnet-map-canvas"); // step 2: turn off edit mode - - const editEdgesToggleBtn = page.getByRole('button', { name: /edit edges/i}); - await editEdgesToggleBtn.click(); + await page.locator('#edge_edit_mode').click(); // step 3: check render of partial data @@ -437,12 +435,10 @@ pluginTest.describe("plugin testing", () => { // save dashboard changes and refresh page // TODO: @sanchezelton, check if initial grey state for edge coloration persists after merging refactoring of render code // if so, remove the following step - await page.getByTitle('Apply changes and save dashboard').click(); - await page.getByRole('button', { name: 'Save' }).click(); - await page.reload(); - await page.waitForSelector("[aria-label='Panel editor content'] esnet-map-canvas"); - const editEdgesToggleBtn = page.getByRole('button', { name: /edit edges/i}); - await editEdgesToggleBtn.click(); + await page.getByRole('button', { name: 'save' }).click(); + await page.getByRole('button', { name: 'Dashboard settings Save Dashboard Modal Save button' }).click(); + await page.getByTestId('fdc230').click(); + await page.getByTestId(/RefreshPicker/).click(); await disableAllQueries(); await enableTargetQuery(inFs); @@ -468,8 +464,11 @@ pluginTest.describe("plugin testing", () => { } for (const expectedFlowEdge of expectedFlowEdges) { - console.log(`[pluginTest.spec.testFlowSheet]: Testing edge stroke: ${await expectedFlowEdge?.getAttribute('stroke')}`); - expect(expectedFlowEdge).toHaveAttribute('stroke', visualization.getColorByName(expectedStroke)); + let foundStroke = await expectedFlowEdge.getAttribute('stroke'); + if (!foundStroke?.startsWith('#')) { + foundStroke = visualization.getColorByName(expectedStroke); + } + expect(visualization.getColorByName(expectedStroke)).toEqual(foundStroke); } };