Skip to content

Commit

Permalink
fix: flaky workspace test (#9931)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkim-det authored Sep 13, 2024
1 parent 867eb31 commit 6f36969
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions webui/react/src/e2e/tests/projectsWorkspaces.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -354,13 +354,16 @@ test.describe('Workspace List', () => {
test('View Toggle', async ({ authedPage }) => {
const workspaceList = new WorkspaceList(authedPage);

await workspaceList.gridListRadioGroup.list.pwLocator.click();
const firstCard = workspaceList.workspaceCards.nth(0);
const firstRow = workspaceList.table.table.rows.nth(0);

const idSortedWorkspaceNames = _.orderBy(workspaces, 'id', 'desc').map((w) => w.name);
await workspaceList.gridListRadioGroup.list.pwLocator.click();
await firstCard.pwLocator.waitFor({ state: 'hidden' });
await firstRow.pwLocator.waitFor();

expect(await workspaceList.table.table.rows.nth(0).name.pwLocator.textContent()).toEqual(
idSortedWorkspaceNames[0],
);
await workspaceList.gridListRadioGroup.grid.pwLocator.click();
await firstRow.pwLocator.waitFor({ state: 'hidden' });
await firstCard.pwLocator.waitFor();
});
});

Expand Down

0 comments on commit 6f36969

Please sign in to comment.