PSP-9839: e2e automation test for Check file type on document upload form (frontend)#5340
Conversation
| await this.page.goto('/mapview/sidebar/research/new', { waitUntil: 'domcontentloaded' }); | ||
| } | ||
|
|
||
| async fillMinimumResearchForm() { |
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
NIT: This works, but I would have liked to see the complete error message: "File type not suppored!"
There was a problem hiding this comment.
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 () => { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Bonus points for intercepting the POST and storing the JSON research file on a test variable.
There was a problem hiding this comment.
Spliting this test coming up in next PR.
|
Tick the box to add this pull request to the merge queue (same as
|
|



No description provided.