Skip to content

Commit

Permalink
Fix failing tests with new fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
clari182 committed Dec 6, 2024
1 parent a1e9a06 commit 37e1278
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ test.describe('Incidents App', () => {
await page.locator('[data-cy="table-view"] button:has-text("Issue Reports")').click();

await page.waitForSelector('[data-cy="row"]');
await expect(page.locator('[data-cy="row"]')).toHaveCount(1);
await expect(page.locator('[data-cy="row"]')).toHaveCount(2);

const firstRowLink = await page.locator('[data-cy="row"] td a').first().getAttribute('href');
expect(firstRowLink).toMatch(/^\/reports\/\d+$/);
Expand Down
12 changes: 9 additions & 3 deletions site/gatsby-site/playwright/e2e-full/incidents/new.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ test.describe('New Incident page', () => {

test('Should successfully create a new incident', async ({ page, login }) => {

await init();
await init({
customData: {
users: [
{ userId: 'johndoe', first_name: 'John', last_name: 'Doe', roles: ['admin'] },
]
}
});

await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'], first_name: 'John', last_name: 'Doe' } });

Expand Down Expand Up @@ -39,7 +45,7 @@ test.describe('New Incident page', () => {

await page.getByText('Save').click();

await page.getByText(`You have successfully create Incident 4. View incident`).waitFor();
await page.getByText(`You have successfully create Incident 5. View incident`).waitFor();
});

test('Should clone an incident', async ({ page, login }) => {
Expand All @@ -48,7 +54,7 @@ test.describe('New Incident page', () => {

await login(process.env.E2E_ADMIN_USERNAME, process.env.E2E_ADMIN_PASSWORD, { customData: { roles: ['admin'], first_name: 'John', last_name: 'Doe' } });

const newIncidentId = 4;
const newIncidentId = 5;

await page.goto(`${url}/?incident_id=3`);

Expand Down

0 comments on commit 37e1278

Please sign in to comment.