This is an example app that shows how to use Cypress to test password reset functionality. It uses Mailisk and it's Cypress library.
This example includes a simple full stack React (NextJS) and Express application. The Express server uses Mailisk SMTP to send emails, these emails can only be sent to an address that ends in @{namespace}.mailisk.net
.
You will need to install packages in all directories. Run the following command in the root directory:
npm --prefix ./server install ./server \
npm --prefix ./app install ./app
The Api Key and namespace can be found in your dashboard. See the Getting Started guide for detailed steps
Create a .env
file in the root project directory. Add the following lines from your settings:
API_KEY=<api key>
NAMESPACE=<yournamespace>
To be able to use the API you will need to add your API key to cypress.config.js
. You will also need to set your namespace:
module.exports = defineConfig({
env: {
MAILISK_API_KEY: "YOUR_API_KEY",
MAILISK_NAMESPACE: "YOUR_NAMESPACE",
},
});
Head into the app
folder and run:
npm run dev
Then go into the server
folder and run:
npm run dev
To run the test open Cypress by running the following command in the app
folder:
npx cypress run
Alternatively you can run the tests using the GUI version by running the following command and going under E2E tests:
npx cypress open