Skip to content

Commit

Permalink
Merge pull request #13275 from rhamilto/CONSOLE-3740
Browse files Browse the repository at this point in the history
CONSOLE-3740: fix bug where renamed tests weren't updated
  • Loading branch information
openshift-ci[bot] committed Oct 24, 2023
2 parents 175a6a2 + 783bca5 commit 15d809e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion INTERNATIONALIZATION.md
Expand Up @@ -118,4 +118,4 @@ These scripts can all be found in `./frontend/i18n-scripts`.
For more information, please review the [README](./frontend/i18n-scripts/README.md).

#### Testing
We test that internationalization is working for various pages and components using the [i18next-pseudo](https://github.com/MattBoatman/i18next-pseudo) JavaScript library, which returns translated strings in "pseudolocalization" format. Our Cypress custom commands [cy.isPseudoLocalized()](https://github.com/openshift/console/blob/9c930b7b411f5e88f2f890639159e09bdadb78dc/frontend/packages/integration-tests-cypress/support/i18n.ts#L45) and [cy.testI18n()](https://github.com/openshift/console/blob/9c930b7b411f5e88f2f890639159e09bdadb78dc/frontend/packages/integration-tests-cypress/support/i18n.ts#L13) append query params to URLs to invoke "pseudolocalization" and are used in various test suites such as [pseudolocalization.spec.ts](https://github.com/openshift/console/blob/1072d1bf6007fcd50dffd57219c300d3fe882e8b/frontend/packages/integration-tests-cypress/tests/i18n/pseudolocalization.spec.ts#L29) and [resource-crud.spec.ts](https://github.com/openshift/console/blob/12d9a30211a86a4979effb80c7cc8af8a68fd4a4/frontend/packages/integration-tests-cypress/tests/crud/resource-crud.spec.ts#L141) to verify strings in the masthead, dashboard, navigation menu, list views, and detail pages are translated.
We test that internationalization is working for various pages and components using the [i18next-pseudo](https://github.com/MattBoatman/i18next-pseudo) JavaScript library, which returns translated strings in "pseudolocalization" format. Our Cypress custom commands [cy.isPseudoLocalized()](https://github.com/openshift/console/blob/9c930b7b411f5e88f2f890639159e09bdadb78dc/frontend/packages/integration-tests-cypress/support/i18n.ts#L45) and [cy.testI18n()](https://github.com/openshift/console/blob/9c930b7b411f5e88f2f890639159e09bdadb78dc/frontend/packages/integration-tests-cypress/support/i18n.ts#L13) append query params to URLs to invoke "pseudolocalization" and are used in various test suites such as [pseudolocalization.cy.ts](https://github.com/openshift/console/blob/175a6a274204bbe44def1963daf572e4463c36f9/frontend/packages/integration-tests-cypress/tests/i18n/pseudolocalization.cy.ts#L27) to verify strings in the masthead, dashboard, navigation menu, list views, and detail pages are translated.
12 changes: 6 additions & 6 deletions frontend/packages/integration-tests-cypress/README.md
Expand Up @@ -5,9 +5,9 @@
#### Best Practices
- Each it() should be its own atomic test (run independently of other tests). Each it() should likely start with
cy.visit() or nav to page
- We are switching over our test ids from `< ... data-test-id=".."/>` to using the Cypress preferred
`< ... data-test=".."/>`. This allows us to better take advantage of certain Cypress tooling, like the
[Selector Playground](https://docs.cypress.io/guides/core-concepts/test-runner.html#Selector-Playground)
- We are switching over our test ids from `< ... data-test-id=".."/>` to using the Cypress preferred
`< ... data-test=".."/>`. This allows us to better take advantage of certain Cypress tooling, like the
[Selector Playground](https://docs.cypress.io/guides/core-concepts/test-runner.html#Selector-Playground)
- Use [Cypress's Best Practices for Selecting Elements](https://docs.cypress.io/guides/references/best-practices.html)

#### Migrating Protractor tests to Cypress
Expand All @@ -33,13 +33,13 @@ frontend/packages/integration-tests-cypress/
│   └── index.js <--- webpack-preprocessor, enviornment variables, baseUrl, custom tasks
├── tests <--- test suites
│   ├── crud
│   │   └── namespace-crud.spec.ts
│   │   └── namespace-crud.cy.ts
│   └── monitoring
│   └── monitoring.spec.ts
│   └── monitoring.cy.ts
└── views <--- helper objects containing assertions and commands
├── details-page.ts
├── list-page.ts
├── form.ts
├── form.ts
└── modal.ts
```

Expand Down
2 changes: 1 addition & 1 deletion test-prow-e2e.sh
Expand Up @@ -49,7 +49,7 @@ if [ "$SCENARIO" == "nightly-cypress" ]; then
elif [ "$SCENARIO" == "e2e" ] || [ "$SCENARIO" == "release" ]; then
./test-cypress.sh -h true
elif [ "$SCENARIO" == "login" ]; then
./test-cypress.sh -p console -s 'tests/app/auth-multiuser-login.spec.ts' -h true
./test-cypress.sh -p console -s 'tests/app/auth-multiuser-login.cy.ts' -h true
elif [ "$SCENARIO" == "olmFull" ]; then
./test-cypress.sh -p olm -h true
# elif [ "$SCENARIO" == "ceph" ]; then
Expand Down

0 comments on commit 15d809e

Please sign in to comment.