Skip to content

mailisk-app/email-attachments-cypress

Repository files navigation

Cypress email attachments - Mailisk

This is an example app that shows how to use Cypress to test email attachments functionality. This example uses the mailisk library.

This example includes a simple full stack React (Vite) and Express application. The Express server uses Mailisk SMTP to send emails.

Install packages

You will need to install packages in all directories. Run the following command in the root directory:

npm i
cd server && npm i

Setup

Get namespace and api key

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:

MAILISK_API_KEY=your_api_key
MAILISK_NAMESPACE=your_namespace

Setup Cypress env

To be able to use the API you will need to add your API key to cypress.config.ts. You will also need to set your namespace:

module.exports = defineConfig({
  env: {
    MAILISK_API_KEY: "YOUR_API_KEY",
    MAILISK_NAMESPACE: "YOUR_NAMESPACE",
  },
});

Running the app and server

In the root run:

npm run dev

Then go into the server folder and run:

npm run dev

Running tests

Once both the backend and frontend are running. You can run the tests.

To run the test run the following command in the root folder:

npx cypress run

Alternatively you can run the tests using the GUI version by running the following command:

npx cypress open

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published