raimohanska / ourboard

An online whiteboard
Other
763 stars 58 forks source link

two users tests #157

Closed gborobio73 closed 3 years ago

gborobio73 commented 3 years ago

This PR is for adding a basic test to assert that two different users using different browsers, can see each others notes.

Cypress has no support for multiple browsers/tabs, so I'm using the next best thing: https://playwright.dev/. We could also write this test using Robot framework, but that would mean python, instead of TypeScript.

If it's decided to continue with Playwright, I can add its own jest config file and so, but for now I tried to add minimum dependencies and files to make it work.

Also, I'm not using the describe/it syntax, and using test from jest; hope that's ok.

I have added 2 scripts:

yarn test:playwright

and

yarn test:playwright:debug

This last one will open the Playwright tool, very similar to what Cypress does.

After this, I could improve the tests by creating a board instead of using the default, and deleting it at the end, so the shared DB gets cleaned up (as much as possible)

raimohanska commented 3 years ago

Looks good so far, on a brief look! To get benefits from this, we should still include the playwright tests into the Github Actions CI.

gborobio73 commented 3 years ago

@raimohanska I have added the playwright tests to the github actions and I could merge the branch if are ok with it 👌. Thanks!

raimohanska commented 3 years ago

Nice! Merging!