Skip to content

Commit

Permalink
refactor: Try to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
CvdL-UM committed Oct 3, 2024
1 parent 4aded88 commit e5f11cc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lawnotation-ui/tests/01-assignments-loggedin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ test('Annotator creates project, task, uploads document and assigns task', async
await annotatorPage.goto('localhost:3000');

// Annotator assert if there are no assignments
await annotatorPage.getByTestId('assigned-tasks-menu-item').waitFor();
await annotatorPage.getByTestId('assigned-tasks-menu-item').click();
await expect(annotatorPage.getByText('Showing 0 of 0')).toBeVisible();

Expand All @@ -25,6 +26,7 @@ test('Annotator creates project, task, uploads document and assigns task', async
await delay(3000);
const row = editorPage.getByRole('table').locator('tbody').locator('tr').first();
const viewButton = row.getByRole('button', { name: 'View' });
await viewButton.waitFor();
await expect(viewButton).toBeVisible();
await viewButton.click();
await expect(editorPage.getByText("Upload dataset", { exact: true })).toBeVisible()
Expand Down
1 change: 1 addition & 0 deletions lawnotation-ui/tests/02-labelsets-loggedin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ test('Editor creates, edits, and deletes labelset', async ({ browser }) => {
const editorContext = await browser.newContext({ storageState: 'playwright/.auth/editor.json' });
const editorPage = await editorContext.newPage();
await editorPage.goto('localhost:3000');
await editorPage.getByTestId('labelset-link').waitFor();
await editorPage.getByTestId('labelset-link').click();
await editorPage.getByTestId('create-new-labelset').click();
await editorPage.getByLabel('Breadcrumb').waitFor();
Expand Down
7 changes: 4 additions & 3 deletions lawnotation-ui/tests/03-projects-loggedin.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ test('editor creates project, task, a new labelset and edits project and task',


// Editor creates project
await editorPage.getByTestId('projects-link').click();
await editorPage.getByTestId('projects-link').waitFor();
await editorPage.getByTestId('projects-link').click();
await editorPage.getByText("Don't show again", { exact: true }).waitFor();
await editorPage.getByTestId('open-projects-modal').click();
await editorPage.getByTestId('open-projects-modal').click();
await editorPage.getByTestId('project-name').fill('Test project v2');
await editorPage.getByTestId('project-description').fill('This is the description');
await editorPage.getByTestId('add-project').click();
Expand Down Expand Up @@ -56,7 +57,7 @@ test('editor creates project, task, a new labelset and edits project and task',
await delay(3000);

// Editor edits project
await editorPage.getByTestId('projects-link').click();
await editorPage.getByTestId('projects-link').click();
const projectRow = editorPage.getByRole('table').locator('tbody').locator('tr').first();
const editedButton = projectRow.getByLabel('Edit');
await expect(editedButton).toBeVisible();
Expand Down

0 comments on commit e5f11cc

Please sign in to comment.