Skip to content

Commit

Permalink
smoke: configurable testmail namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredh159 committed Apr 25, 2024
1 parent 35055f6 commit 2016f24
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions .github/workflows/smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ env:
CYPRESS_BASE_URL: https://parents.gertrude.app
CYPRESS_SMOKE_TEST_API_URL: https://api.gertrude.app
CYPRESS_SMOKE_TEST_EMAIL_INBOX_URL: ${{ secrets.SMOKE_TEST_EMAIL_INBOX_URL }}
CYPRESS_SMOKE_TEST_TESTMAIL_NAMESPACE: ${{ secrets.SMOKE_TEST_TESTMAIL_NAMESPACE }}
SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }}
5 changes: 3 additions & 2 deletions smoke/cypress/e2e/smoke.cy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/// <reference types="cypress" />
describe(`Smoke test`, () => {
const email = `82uii.smoke-test-${Date.now()}@inbox.testmail.app`;
const namespace = Cypress.env(`SMOKE_TEST_TESTMAIL_NAMESPACE`);
const email = `${namespace}.smoke-test-${Date.now()}@inbox.testmail.app`;
const password = `_pw_${Date.now()}`;

it(`verify download dmg is reachable`, () => {
Expand All @@ -22,7 +23,7 @@ describe(`Smoke test`, () => {

// verify email
cy.request({ url: Cypress.env(`SMOKE_TEST_EMAIL_INBOX_URL`) }).then((response) => {
const body: string = response.body;
const body = JSON.stringify(response.body);
if (!body.includes(email)) {
throw new Error(`Expected to find email ${email} in ${body}`);
}
Expand Down
3 changes: 2 additions & 1 deletion smoke/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ For local testing, add a `./smoke/cypress.env.json` with values like:

```json
{
"SMOKE_TEST_EMAIL_INBOX_URL": "http://localhost:1111/test-email-inbox",
"SMOKE_TEST_TESTMAIL_NAMESPACE": "your-ns",
"SMOKE_TEST_EMAIL_INBOX_URL": "https://api.testmail.app/api/json?apikey=not-real&namespace=your-ns",
"SMOKE_TEST_API_URL": "http://localhost:2222"
}
```

0 comments on commit 2016f24

Please sign in to comment.