Skip to content

Commit

Permalink
add test docs
Browse files Browse the repository at this point in the history
  • Loading branch information
vincanger committed Jul 18, 2024
1 parent f7e91c6 commit cf0b10e
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
1 change: 1 addition & 0 deletions opensaas-sh/blog/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export default defineConfig({
{ label: 'Email Sending', link: '/guides/email-sending/' },
{ label: 'File Uploading', link: '/guides/file-uploading/' },
{ label: 'Cookie Consent', link: '/guides/cookie-consent/' },
{ label: 'Tests', link: '/guides/tests/' },
{ label: 'Deploying', link: '/guides/deploying/' },
],
},
Expand Down
36 changes: 36 additions & 0 deletions opensaas-sh/blog/src/content/docs/guides/tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Tests
banner:
content: |
Open SaaS is now running on <a href='https://wasp-lang.dev'>Wasp v0.14</a>! <br/>🐝🚀<br/>If you're running an older version, please follow the <a href="https://wasp-lang.dev/docs/migrate-from-0-13-to-0-14">migration instructions.</a>
---

This guide will show you how to use the included end-to-end (e2e) tests for your Open SaaS application.

## The Tests Directory

In the root of your project, you'll find an `e2e-tests` directory which contains the [Playwright](https://playwright.dev) tests for your Open SaaS application.:

```
.
├── e2e-tests/
│ ├── tests/ # Directory containing the test files
│ ├── README.md # Instructions on how to run the tests
│ ├── ci-start-app-and-db.js # Script to start the app and db for CI
│ ├── playwright.config.ts # Playwright configuration
│ ├── package.json
│ ├── ...
```

To run the tests locally, or in a CI pipeline, follow the instructions in the `README.md` file in the `e2e-tests` directory.

## Using Tests in CI with GitHub Actions
Although the Open SaaS template does not come with an example workflow, you can find one at `.github/workflows/e2e-tests.yml` of the [remote repo](https://github.com/wasp-lang/open-saas).

You can copy and paste the `.github/` directory containing the `e2e-tests.yml` workflow into the root of your own repository to run the tests as part of your CI pipeline.

:::caution[WASP_VERSION]
Please make sure to update the `WASP_VERSION` environment variable in the `e2e-tests.yml` file to match the version of Wasp you are using in your project.
:::

In order for these tests to run correctly on GitHub, you need to provide the environment variables mentioned in the `e2e-tests.yml` file within your GitHub repository's "Actions" secrets so that they can be accessed by the tests.
2 changes: 1 addition & 1 deletion template/e2e-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ To exit the local e2e tests, go back to the terminal were you started your tests

## CI/CD

In `.github/workflows/e2e-tests.yml`, you can see the workflow that runs the headless e2e tests in a CI/CD pipeline via GitHub actions.
In `.github/workflows/e2e-tests.yml` of the [remote repo](https://github.com/wasp-lang/open-saas), you can see the workflow that runs the headless e2e tests in a CI/CD pipeline via GitHub actions.

In order for these tests to run correctly, you need to provide the environment variables mentioned in the `e2e-tests.yml` file within your GitHub repository's "Actions" secrets so that they can be accessed by the tests.

Expand Down

0 comments on commit cf0b10e

Please sign in to comment.