Skip to content

Commit

Permalink
Update E2E tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ghengeveld committed Dec 23, 2024
1 parent a0702ec commit b82d3b0
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ test.describe("component testing", () => {

await expect(testingModuleDescription).toContainText('Not run');

const runTestsButton = await page.getByLabel('Start Component tests')
const runTestsButton = await page.getByLabel('Start test run')
await runTestsButton.click();

await expect(testingModuleDescription).toContainText('Testing', { timeout: 60000 });
Expand Down Expand Up @@ -136,7 +136,7 @@ test.describe("component testing", () => {

await expect(testingModuleDescription).toContainText('Not run');

const runTestsButton = await page.getByLabel('Start Component Tests')
const runTestsButton = await page.getByLabel('Start test run')
const watchModeButton = await page.getByLabel('Enable watch mode')
await expect(runTestsButton).toBeEnabled();
await expect(watchModeButton).toBeEnabled();
Expand Down Expand Up @@ -272,7 +272,7 @@ test.describe("component testing", () => {
// Wait for Vitest to have (re)started
await page.waitForTimeout(2000);

await page.getByLabel("Start Component tests").click();
await page.getByLabel("Start test run").click();

// Assert - Coverage report is collected and shown
await expect(page.getByLabel("Open coverage report")).toBeVisible({ timeout: 30000 });
Expand Down Expand Up @@ -324,7 +324,7 @@ test.describe("component testing", () => {
await page.locator('[data-item-id="addons-group-test--expected-failure"]').hover();
await page.locator('[data-item-id="addons-group-test--expected-failure"] div[data-testid="context-menu"] button').click();
const sidebarContextMenu = page.getByTestId('tooltip');
await sidebarContextMenu.getByLabel('Start Component tests').click();
await sidebarContextMenu.getByLabel('Start test run').click();

// Assert - Only one test is running and reported
await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test', { timeout: 30000 });
Expand Down Expand Up @@ -356,7 +356,7 @@ test.describe("component testing", () => {
await page.locator('[data-item-id="addons-group-test"]').hover();
await page.locator('[data-item-id="addons-group-test"] div[data-testid="context-menu"] button').click();
const sidebarContextMenu = page.getByTestId('tooltip');
await sidebarContextMenu.getByLabel('Start Component tests').click();
await sidebarContextMenu.getByLabel('Start test run').click();

// Assert - Tests are running and reported
await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 8 tests', { timeout: 30000 });
Expand Down Expand Up @@ -392,7 +392,7 @@ test.describe("component testing", () => {
await page.locator('[data-item-id="addons-group"]').hover();
await page.locator('[data-item-id="addons-group"] div[data-testid="context-menu"] button').click();
const sidebarContextMenu = page.getByTestId('tooltip');
await sidebarContextMenu.getByLabel('Start Component tests').click();
await sidebarContextMenu.getByLabel('Start test run').click();

// Assert - Tests are running and reported
await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 10 test', { timeout: 30000 });
Expand Down Expand Up @@ -436,7 +436,7 @@ test.describe("component testing", () => {
await page.locator('[data-item-id="example-button--csf-3-primary"]').hover();
await page.locator('[data-item-id="example-button--csf-3-primary"] div[data-testid="context-menu"] button').click();
const sidebarContextMenu = page.getByTestId('tooltip');
await sidebarContextMenu.getByLabel('Start Component tests').click();
await sidebarContextMenu.getByLabel('Start test run').click();

// Arrange - Wait for test to finish and unfocus sidebar context menu
await expect(sidebarContextMenu.locator('#testing-module-description')).toContainText('Ran 1 test', { timeout: 30000 });
Expand All @@ -446,7 +446,7 @@ test.describe("component testing", () => {
await expect(page.getByLabel("Open coverage report")).not.toBeVisible();

// Act - Run ALL tests
await page.getByLabel("Start Component tests").click();
await page.getByLabel("Start test run").click();

// Arrange - Wait for tests to finish
await expect(page.locator('#testing-module-description')).toContainText(/Ran \d{2,} tests/, { timeout: 30000 });
Expand Down

0 comments on commit b82d3b0

Please sign in to comment.