Skip to content

PSP-9839: e2e automation test for Check file type on document upload form (frontend)#5340

Merged
stairaku merged 11 commits into
bcgov:devfrom
stairaku:automation-branch
Jun 23, 2026
Merged

PSP-9839: e2e automation test for Check file type on document upload form (frontend)#5340
stairaku merged 11 commits into
bcgov:devfrom
stairaku:automation-branch

Conversation

@stairaku

Copy link
Copy Markdown
Collaborator

No description provided.

@stairaku stairaku requested a review from eddherrera June 22, 2026 23:49
@stairaku stairaku self-assigned this Jun 22, 2026
@stairaku stairaku added the test-scripts Tag used for functional test scripts label Jun 22, 2026
await this.page.goto('/mapview/sidebar/research/new', { waitUntil: 'domcontentloaded' });
}

async fillMinimumResearchForm() {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This methods needs to be more abstract, 1) we pass the value to the desired input, and name it like 'setResearchNameValue(string researchName) or 2) even more abstract and return the element and fill it in the test.


//Verify warning message appears
const errorLabel = await documentUploadModalPage.getDocumentErrorLabel();
expect(errorLabel).toContain('File');

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: This works, but I would have liked to see the complete error message: "File type not suppored!"

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change it a little bit to grab the correct error message but using an xpath for now. Later today I will fix that XPath into something more robust.

await context.close();
});

test('verify documents invalid types', async () => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's try splitting these 2... 1) test for creating the Research file, 2) For validating the document.

Try applying the 'step'. https://playwright.dev/docs/api/class-test#test-step

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bonus points for intercepting the POST and storing the JSON research file on a test variable.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spliting this test coming up in next PR.

@mergify

mergify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@stairaku stairaku added this pull request to the merge queue Jun 23, 2026
Merged via the queue into bcgov:dev with commit b06f9b0 Jun 23, 2026
16 checks passed
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test-scripts Tag used for functional test scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants