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

Move over remaining AD tests; clean up cypress run scripts #89

Merged
merged 3 commits into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Make scripts more verbose; updated CONTRIBUTING with examples
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
  • Loading branch information
ohltyler committed Feb 9, 2022
commit 03b59b3d310e89431ce0766ff746d5e1f8ba101a
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
uses: cypress-io/github-action@v2
with:
working-directory: monetery-test
command: yarn cypress:run --spec 'cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js'
command: yarn cypress:run-without-security --spec 'cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js'
wait-on: 'http://localhost:5601'
# Screenshots are only captured on failure, will change this once we do visual regression tests
- uses: actions/upload-artifact@v1
Expand Down
18 changes: 10 additions & 8 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ opensearch-dashboards-test-library is the test utility library used by this proj
"@opensearch-dashboards-test/opensearch-dashboards-test-library": "^1.0.1"
```

You can aslo import from the git repository target branch to use the development code directly
You can also import from the git repository target branch to use the development code directly

```
"@opensearch-dashboards-test/opensearch-dashboards-test-library": "opensearch-project/opensearch-dashboards-test-library#main"
Expand All @@ -48,28 +48,30 @@ $ npm uninstall @opensearch-dashboards-test/opensearch-dashboards-test-library &

### Run Tests

You can run the cypress tests by cli:
You can run the cypress tests by cli. There are some handy sripts in [package.json](package.json) to run the tests with some pre-set configurations.

To run without security:

```
$ npx cypress run --spec "cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js"
$ yarn cypress run-without-security --spec "cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js"
```

By default, it uses headless mode (hide the broswer) You can turn on the browser display by:
To run with security:

```
$ npx cypress run --spec "cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js --headed"
$ yarn cypress run-with-security --spec "cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js"
```

You can also manually trigger the test via browser UI by:
These tests run in headless mode by default. You can also manually trigger the test via browser UI by running:

```
$ npx cypress open
$ yarn cypress open
```

And you can override certain cypress config or environment variable by appling additional cli arguments, for example to override the baseUrl and OpensearchUrl to test a remote endpoint:

```
$ npx cypress run --spec "cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js" --env "openSearchUrl=https://foo.com" --config "baseUrl=https://foo.com/_dashboards"
$ yarn cypress run --spec "cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js" --env "openSearchUrl=https://foo.com" --config "baseUrl=https://foo.com/_dashboards"
```

### Formatting
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"cypress:open": "cypress open",
"cypress:run": "env TZ=America/Los_Angeles cypress run --browser chrome --headless --env SECURITY_ENABLED=false",
"cypress:run-without-security": "env TZ=America/Los_Angeles cypress run --browser chrome --headless --env SECURITY_ENABLED=false",
"cypress:run-with-security": "env TZ=America/Los_Angeles cypress run --browser chrome --headless --env SECURITY_ENABLED=true",
"cypress:run-plugin-tests": "yarn cypress:run --spec 'cypress/integration/plugins/*/*.js'",
"cypress:run-plugin-tests-without-security": "yarn cypress:run-without-security --spec 'cypress/integration/plugins/*/*.js'",
"cypress:run-plugin-tests-with-security": "yarn cypress:run-with-security --spec 'cypress/integration/plugins/*/*.js'"
},
"repository": {
Expand Down