Skip to content

Commit

Permalink
✅(frontend) update existing tests to align with the new interface cha…
Browse files Browse the repository at this point in the history
…nges

- Adjust selectors and assertions to reflect updates in the UI layout and
design.
- Ensure all modified tests maintain compatibility with the updated structure.
- Fix any broken test cases caused by the redesign.
  • Loading branch information
PanchoutNathan committed Nov 19, 2024
1 parent e2ed87b commit c252269
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 282 deletions.
18 changes: 8 additions & 10 deletions src/frontend/apps/e2e/__tests__/app-impress/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,24 +97,22 @@ export const goToGridDoc = async (
const header = page.locator('header').first();
await header.locator('h2').getByText('Docs').click();

const datagrid = page.getByLabel('Datagrid of the documents page 1');
const datagridTable = datagrid.getByRole('table');
const docsGrid = page.getByTestId('docs-grid');
await expect(docsGrid).toBeVisible();
await expect(page.getByTestId('docs-grid-loader')).toBeHidden();

await expect(datagrid.getByLabel('Loading data')).toBeHidden({
timeout: 10000,
});

const rows = datagridTable.getByRole('row');
const rows = docsGrid.getByRole('row');
expect(await rows.count()).toEqual(20);
const row = title
? rows.filter({
hasText: title,
})
: rows.nth(nthRow);

const docTitleCell = row.getByRole('cell').nth(1);

const docTitle = await docTitleCell.textContent();
await expect(row).toBeVisible();

const docTitleContent = row.locator('[aria-describedby="doc-title"]').first();
const docTitle = await docTitleContent.textContent();
expect(docTitle).toBeDefined();

await row.getByRole('link').first().click();
Expand Down
13 changes: 5 additions & 8 deletions src/frontend/apps/e2e/__tests__/app-impress/doc-create.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ test.describe('Doc Create', () => {
const header = page.locator('header').first();
await header.locator('h2').getByText('Docs').click();

const datagrid = page.getByLabel('Datagrid of the documents page 1');
const datagridTable = datagrid.getByRole('table');
await expect(page.getByTestId('docs-grid-loader')).toBeVisible();

await expect(datagrid.getByLabel('Loading data')).toBeHidden({
timeout: 10000,
});
await expect(datagridTable.getByText(docTitle)).toBeVisible({
timeout: 5000,
});
const docsGrid = page.getByTestId('docs-grid');
await expect(docsGrid).toBeVisible();
await expect(page.getByTestId('docs-grid-loader')).toBeHidden();
await expect(docsGrid.getByText(docTitle)).toBeVisible();
});
});
Loading

0 comments on commit c252269

Please sign in to comment.