Skip to content

Commit

Permalink
enable local cypress configuration (#3417)
Browse files Browse the repository at this point in the history
* setup local cypress configuration
- remove fixed baseUrl from npm scripts
- move the default baseUrl to cypress.json

* add info about overwriting cypress.json values
  • Loading branch information
petermakowski authored Dec 14, 2021
1 parent feb1998 commit 4b204af
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
1 change: 1 addition & 0 deletions integration/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ yarn.lock
# cypress
cypress/screenshots
cypress/videos
cypress.env.json

# misc
*.swp
Expand Down
13 changes: 13 additions & 0 deletions integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ yarn test-cypress

This will automatically start legacy, ui and proxy servers and run the Cypress tests, in which results are logged to the console. After running the tests, the servers and process will close.

## Edit local configuration

By default, cypress will run tests using the configuration defined in [cypress.json](/integration/cypress.json).

If you wish to overwrite any of the settings (e.g. MAAS URL or username/password) you can create a local configuration file:

```shell
cd integration
touch cypress.env.json
```

Values from `cypress.env.json` will overwrite conflicting variables in the main `cypress.json` configuration file.

## Developing cypress tests

### On your host machine
Expand Down
2 changes: 1 addition & 1 deletion integration/cypress.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"baseUrl": "http://localhost:8400",
"baseUrl": "http://0.0.0.0:8400",
"env": {
"username": "admin",
"password": "test"
Expand Down
4 changes: 2 additions & 2 deletions integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"cypress-test": "yarn --cwd ../shared build && start-server-and-test serve-frontends '8401|8402' serve-base 'tcp:8400|8404' cypress-run",
"serve-frontends": "yarn --cwd ../proxy serve-frontends",
"serve-base": "yarn --cwd ../proxy serve-base",
"cypress-run": "yarn cypress run -c baseUrl=http://0.0.0.0:8400",
"cypress-open": "yarn cypress open -c baseUrl=http://0.0.0.0:8400"
"cypress-run": "yarn cypress run",
"cypress-open": "yarn cypress open"
},
"devDependencies": {
"@maas-ui/maas-ui-shared": "3.2.0",
Expand Down

0 comments on commit 4b204af

Please sign in to comment.