mattermost / mattermost-plugin-legal-hold

Plugin to create and manage legal holds in Mattermost
Other
5 stars 6 forks source link

Initial playwright setup for e2e tests #97

Closed yuney-worx4you closed 1 month ago

yuney-worx4you commented 2 months ago

Summary

Adding intial setup of Playwright e2e tests for the Legal Hold plugin.

Configurations are identical to the 'todo' plugin.

Current issues

Compared to the manual flow, I noticed a few anomalies in the automation flow.

  1. When the new user lands at the Legal Hold Plugin settings page, the "Create" table doesn't appear despite the plugin being set to true. This table appears only when the plugin is disabled (set to false) and back to true. The save in between also seem to take a while and can be flaky.
  2. When searching for usernames the loading takes a while and times out: Scenario 2 - Admin user can create a new legal hold. Also there aren't appropriate locators to refer to, other than #react-select-2-input.
  3. Edit and download icons also don't have good locators to reference, other than div:nth-child(10) > a:nth-child(2)
  4. The downloaded file name isn't currently checked for. I didn't have a good idea how the file name was generated. Do we want to check this?
wiggin77 commented 2 months ago

@yuney-worx4you I think to have the playwright test run for CI, a workflow file needs to be added. See here for an example. You can probably use that one as is.

yuney-worx4you commented 2 months ago

Yup just added it now! Thanks @wiggin77

wiggin77 commented 2 months ago

@yuney-worx4you it looks like there is some mattermost-plugin-todo specific paths in there that need to be updated for this plugin.

yuney-worx4you commented 2 months ago

Hi @saturninoabril thank you so much for your review! I have made the requested changes but can't run the tests successfully locally. Looks like it's due to Error: Cannot find module '@e2e-test.playwright-config' How can I fix this error? Would it be because my support folder is currently empty?

yuney-worx4you commented 2 months ago

Test passes locally! image @saturninoabril

saturninoabril commented 2 months ago

@yuney-worx4you in CI, it failed on ci/check in Playwright due to formatting issue. You may fix by npm run prettier:fix.

wiggin77 commented 1 month ago

@saturninoabril can you help with the remaining error?

saturninoabril commented 1 month ago

Now passed the previous error but failed on actual tests. The legal hold plugin is inactive during test and so it needs to activate/enable similar to how it's done here. I'll take a look next, just need to go offline for a while.

Screenshot 2024-09-18 at 6 59 56 AM
yuney-worx4you commented 1 month ago

Cool thanks Saturn!! I don't have write access to the repository so can't merge it myself. Would you be able to either give me access or merge it pleaes? Thank you!

saturninoabril commented 1 month ago

All passed now.

Let's wait for another review from @wiggin77.