diff --git a/e2e/helper/faultUtils.js b/e2e/helper/faultUtils.js index f4ffb6f036..5419f0a83e 100644 --- a/e2e/helper/faultUtils.js +++ b/e2e/helper/faultUtils.js @@ -58,8 +58,14 @@ async function navigateToFaultManagementWithoutExample(page) { async function navigateToFaultItemInTree(page) { await page.goto('./', { waitUntil: 'networkidle' }); - // Click text=Fault Management - await page.click('text=Fault Management'); // this verifies the plugin has been added + const faultManagementTreeItem = page.getByRole('tree', { + name: "Main Tree" + }).getByRole('treeitem', { + name: "Fault Management" + }); + + // Navigate to "Fault Management" from the tree + await faultManagementTreeItem.click(); } /** @@ -141,8 +147,7 @@ async function clearSearch(page) { * @param {import('@playwright/test').Page} page */ async function selectFaultItem(page, rowNumber) { - // eslint-disable-next-line playwright/no-force-option - await page.check(`.c-fault-mgmt-item > input >> nth=${rowNumber - 1}`, { force: true }); // this will not work without force true, saw this may be a pw bug + await page.locator(`.c-fault-mgmt-item > input >> nth=${rowNumber - 1}`).check(); } /** diff --git a/e2e/tests/visual/notification.visual.spec.js b/e2e/tests/visual/notification.visual.spec.js index 2f6a22bcb2..3b2280a44c 100644 --- a/e2e/tests/visual/notification.visual.spec.js +++ b/e2e/tests/visual/notification.visual.spec.js @@ -34,7 +34,7 @@ test.describe('Visual - Check Notification Info Banner of \'Save successful\'', await page.goto('./', { waitUntil: 'networkidle' }); }); - test('Create a clock, click on \'Save successful\' banner and dismiss it', async ({ page }) => { + test('Create a clock, click on \'Save successful\' banner and dismiss it', async ({ page, theme }) => { // Create a clock domain object await createDomainObjectWithDefaults(page, { type: 'Clock' }); // Verify there is a button with aria-label="Review 1 Notification" @@ -47,7 +47,7 @@ test.describe('Visual - Check Notification Info Banner of \'Save successful\'', expect(await page.locator('div[role="dialog"]').isVisible()).toBe(true); // Verify the div with role="dialog" contains text "Save successful" expect(await page.locator('div[role="dialog"]').innerText()).toContain('Save successful'); - await percySnapshot(page, 'Notification banner'); + await percySnapshot(page, `Notification banner - ${theme}`); // Verify there is a button with text "Dismiss" expect(await page.locator('button:has-text("Dismiss")').isVisible()).toBe(true); // Click on button with text "Dismiss" diff --git a/e2e/tests/visual/plan.visual.spec.js b/e2e/tests/visual/planning.visual.spec.js similarity index 79% rename from e2e/tests/visual/plan.visual.spec.js rename to e2e/tests/visual/planning.visual.spec.js index da3534ae5d..f90349abd9 100644 --- a/e2e/tests/visual/plan.visual.spec.js +++ b/e2e/tests/visual/planning.visual.spec.js @@ -24,7 +24,9 @@ const { test } = require('../../pluginFixtures'); const { setBoundsToSpanAllActivities } = require('../../helper/planningUtils'); const { createDomainObjectWithDefaults, createPlanFromJSON } = require('../../appActions'); const percySnapshot = require('@percy/playwright'); -const examplePlanLarge = require('../../test-data/examplePlans/ExamplePlan_Large.json'); +const examplePlanSmall = require('../../test-data/examplePlans/ExamplePlan_Small2.json'); + +const snapshotScope = '.c-object-view'; test.describe('Visual - Planning', () => { test.beforeEach(async ({ page }) => { @@ -32,21 +34,25 @@ test.describe('Visual - Planning', () => { }); test('Plan View', async ({ page, theme }) => { const plan = await createPlanFromJSON(page, { - json: examplePlanLarge + json: examplePlanSmall }); - await setBoundsToSpanAllActivities(page, examplePlanLarge, plan.url); - await percySnapshot(page, `Plan View (theme: ${theme})`); + await setBoundsToSpanAllActivities(page, examplePlanSmall, plan.url); + await percySnapshot(page, `Plan View (theme: ${theme})`, { + scope: snapshotScope + }); }); test('Gantt Chart View', async ({ page, theme }) => { const ganttChart = await createDomainObjectWithDefaults(page, { type: 'Gantt Chart' }); await createPlanFromJSON(page, { - json: examplePlanLarge, + json: examplePlanSmall, parent: ganttChart.uuid }); - await setBoundsToSpanAllActivities(page, examplePlanLarge, ganttChart.url); - await percySnapshot(page, `Gantt Chart View (theme: ${theme})`); + await setBoundsToSpanAllActivities(page, examplePlanSmall, ganttChart.url); + await percySnapshot(page, `Gantt Chart View (theme: ${theme})`, { + scope: snapshotScope + }); }); });