You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Onboard index management cypress test
Signed-off-by: bowenlan-amzn <[email protected]>
* Refactor plugin specific commands constants out
Signed-off-by: bowenlan-amzn <[email protected]>
* Prettier and documentation
Signed-off-by: bowenlan-amzn <[email protected]>
* Refactor the base constants to single file
So other plugins' constant file can directly import.
Signed-off-by: bowenlan-amzn <[email protected]>
* Refactor IM commands
Move general commands from IM commands to main commands.
Signed-off-by: bowenlan-amzn <[email protected]>
* Use open source terms
Signed-off-by: bowenlan-amzn <[email protected]>
@@ -68,12 +70,16 @@ These tests run in headless mode by default. You can also manually trigger the t
68
70
$ yarn cypress open
69
71
```
70
72
71
-
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:
73
+
And you can override certain [cypress config or environment variable](cypress.json) by applying additional cli arguments, for example to override the baseUrl and openSearchUrl to test a remote OpenSearch endpoint:
72
74
73
75
```
74
-
$ yarn cypress run --spec "cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js" --env "openSearchUrl=https://foo.com" --config "baseUrl=https://foo.com/_dashboards"
76
+
$ yarn cypress run --spec "cypress/integration/core-opensearch-dashboards/vanilla-opensearch-dashboards/*.js" --config "baseUrl=https://<endpoint>/_dashboards" --env "openSearchUrl=https://<endpoint>,SECURITY_ENABLED=true,username=admin,password=xxxxxxxx,ENDPOINT_WITH_PROXY=true"
75
77
```
76
78
79
+
`SECURITY_ENABLED`: if true, the `username` and `password` passing in are used as basic authentication credentials during `cy.visit` and `cy.request`. Also, please notice security enabled endpoint normally uses https protocol, so you may want to pass in different urls.
80
+
81
+
`ENDPOINT_WITH_PROXY`: for an OpenSearch endpoint wrapped with a proxy that redirects the visiting url to the login url, even with auth option provided in `cy.visit`, the redirection to the login url still happens. So a login request before tests and cache the security cookie are needed and can be switched on by this argument.
82
+
77
83
### Formatting
78
84
79
85
`prettier` is used to standardize formatting of files. You can format all files (new and existing) by running
@@ -96,9 +102,9 @@ The dir name shall be descriptive to identify your plugin. You can use the same
96
102
97
103
2. Place fixtures under `cypress/fixtures/plugins/<plugin-name>`
98
104
99
-
3. Place custom commands under `cypress/fixtures/plugins/<plugin-name>`
105
+
3. Place custom commands under `cypress/utils/plugins/<plugin-name>`, if it's a general command that could be reused by other plugins, place it under `cypress/utils/commands.js`
100
106
101
-
4. Place constants to`cypress/utils/constants.js`
107
+
4. Place custom constants under`cypress/utils/plugins/<plugin-name>`, reuse the constants in `cypress/utils/base_constants.js`
For the complete ways to run Cypress, you can refer to the Cypress official site https://docs.cypress.io/guides/getting-started/.installing-cypress#Opening-Cypress.
120
126
121
-
The env paramaters are defined in https://github.com/opensearch-project/opensearch-dashboards-functional-test/blob/main/cypress.json where you can look for or add the desired parameters. You can refer to the Cypress official site https://docs.cypress.io/guides/guides/environment-variables#Setting.
127
+
The env parameters are defined in https://github.com/opensearch-project/opensearch-dashboards-functional-test/blob/main/cypress.json where you can look for or add the desired parameters. You can refer to the Cypress official site https://docs.cypress.io/guides/guides/environment-variables#Setting.
122
128
123
129
6.[optional] Remove copied tests from your plugin and execute them remotely from your plugin
This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.
0 commit comments