8by8-org / web-app

http://app.8by8.us
4 stars 15 forks source link

Writing tests #204

Open MazharulIslam-Naim opened 1 year ago

MazharulIslam-Naim commented 1 year ago

Using Percy and Cypress to write E2E tests to make sure the pages look the way their supposed to and user flow is correct. Then using react testing library to do unit tests for specific complex functionality.

MazharulIslam-Naim commented 1 year ago

To get started with Percy use this link. This will let you create an account connected to the 8BY8 team on BrowserStack which has Percy included. To run Percy locally you need to go to the web-app project, then Project settings. There you will see Project token. In the command line run:

Windows (cmd)

$ set PERCY_TOKEN=your token here

Windows (powershell)

$Env:PERCY_TOKEN="your-projects-token"

Unix (mac or git bash)

$ export PERCY_TOKEN=your token here

Finally run npm run cypress:run to run visual tests.

Percy-Cypress Docs Tutorial For reference on using Percy UI checkout Demo Web Project in the list of projects.

MazharulIslam-Naim commented 1 year ago

Some reference pages for working with Cypress: Introduction and Core Concepts Tutorial using Next.js

Also, I'm going to be using MailSlurp to test email verification. Here is a guide on that: Send and receive email in Cypress JS tests with MailSlurp