-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experiment/create ephemeral UI test accts (#1898)
* fix: simplify email address names to avoid issues with IMAP * fix: modify Login method to accept email alias to check for when connecting to IMAP * fix: new accounts go to /services page since they only belong to one service * feat: new plugin to generate a random email alias, then call an endpoint on the API to create a UI testing account with it * fix: update cypress config to expose the create-account plugin, and store the email address while cypress is running * feat: update the login command to get the ephemeral email account before logging in * feat(create-account): update create account task and pass notify test user pw * fix(tou_test): success can either be the /accounts page or a /services/ page * chore(email-account): refactor and clean up code a bit; ensure connections are always closed and not dangling * feat(config): simplify config * fix up ids * chore(refactor): refactor login command; add login command for platform admin * task(cypress config): add back SMS template ID * fix(tou_prompt test): add assertion to ensure success of agreeing to terms * fix(create-account): simplify call to api; remove posting of the password since API already has this secret * chore(email-account): remove debug logging * fix: add template category to the test that will be empty for email * fix(create-account): remove pw prop * chore: remove debug log * fix: dont try to delete emails when there is none * fix: update calls to login across tests * chore: update test and get values from config * chore: add README, extra npm script * chore: formatting * fix(cypress): update tests to use updated, simplified `cy.login()` command * chore: formatting * chore: update config to use staging * fix(remaining_messages_summary test): add assert to ensure test waits for language to change * chore: remove debug code * fix(template_filters test): make sure the scenario ends in no results * fix(cypress login): use cypress auth to get new user * fix failing tests * fix(cypress config): add back retries * please [review] me * fix: change secret name for new user password so this wont conflict with existing PRs * chore: README updates * chore: remove unused import * chore: removed comments * chore: update README * fix(cypress/README): remove duplicate info
- Loading branch information
1 parent
46d557f
commit 76a5502
Showing
30 changed files
with
267 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Notify + Cypress 🎉 | ||
|
||
## Setup | ||
This folder contains Cypress tests suites. In order to run them, you'll need to install cypress and its dependencies. If you're running inside the dev container, rebuild your dev container to get the necessary packages. | ||
|
||
## Running the tests | ||
### In your devcontainer | ||
There are some issues getting the cypress UI to launch within the devcontainer. For now, you can run the headless tests inside the dev container but if you want to launch the cypress UI you will need to do that outside of the dev container. | ||
|
||
There are 3 helper scripts in `package.json` to run 2 of the test suites. Run these from the `tests_cypress/` folder: | ||
- `npm run cypress`: this will open Cypress with its UI and you can choose any test suite to run | ||
- `npm run a11y`: this will run the accessibility tests in headless mode using the electron browser | ||
- `npm run ci`: this will run the headless CI tests in headless mode using the electron browser | ||
|
||
### Outside of your devcontainer | ||
To launch the cypress UI, where you can choose your test suite and visually debug and inspect tests, run (from the `tests_cypress/` folder): | ||
- `npm run cypress`: this will open the cypress UI where you can choose which tests to run and in which browser | ||
|
||
### Local installation | ||
To install cypress locally, use the following command, from the `tests_cypress/` folder: | ||
```bash | ||
npm install | ||
npx cypress install | ||
``` | ||
|
||
## Configuration | ||
- `cypress.env.json`: this file contains sensitive items like api keys and passphrases that you'll need to run the tests. You'll need to add the file `cypress.env.json` into the `tests_cypress/` folder and its contents can be found in 1password. | ||
- `config.js`: this file contains non-sensitive items like template ids and hostnames that you'll need to run the tests | ||
|
||
### `cypress.env.json` contents | ||
| key | description | | ||
| -------------------------- | ----------------------------------------------- | | ||
| ADMIN_SECRET | Secret admin uses to authenticate against API | | ||
| ADMIN_USERNAME | Username admin uses to authenticate against API | | ||
| NOTIFY_USER | Notify user used by the tests | | ||
| NOTIFY_PASSWORD | Password of NOTIFY_USER (deprecated) | | ||
| IMAP_PASSWORD | IMAP password of gmail account for NOTIFY_USER | | ||
| CYPRESS_AUTH_USER_NAME | Username for the Cypress auth client | | ||
| CYPRESS_AUTH_CLIENT_SECRET | Secret for the Cypress auth client | | ||
| CYPRESS_USER_PASSWORD | Password for the Cypress user | | ||
| IMAP_PASSWORD | IMAP password of gmail account for NOTIFY_USER | | ||
|
||
### Target environment 🎯 | ||
The tests are configured to run against the staging environment by default. To run the tests against your local environment, you will need to update the `ConfigToUse` variable in `config.js` file to use `LOCAL` instead of `STAGING`. For example: | ||
```js | ||
const ConfigToUse = { ...config.COMMON, ...config.LOCAL }; | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.