Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable local cypress configuration #3417

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
petermakowski marked this conversation as resolved.
Show resolved Hide resolved
```

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