From 783bca5172ad08e46d54b31817e36b599718ac0a Mon Sep 17 00:00:00 2001 From: Robb Hamilton Date: Tue, 24 Oct 2023 08:31:08 -0400 Subject: [PATCH] CONSOLE-3740: fix bug where renamed tests weren't updated --- INTERNATIONALIZATION.md | 2 +- .../packages/integration-tests-cypress/README.md | 12 ++++++------ test-prow-e2e.sh | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/INTERNATIONALIZATION.md b/INTERNATIONALIZATION.md index 47db268e5a2..db5dace1fde 100644 --- a/INTERNATIONALIZATION.md +++ b/INTERNATIONALIZATION.md @@ -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. diff --git a/frontend/packages/integration-tests-cypress/README.md b/frontend/packages/integration-tests-cypress/README.md index 3d48ffad5c8..a1279934dd9 100644 --- a/frontend/packages/integration-tests-cypress/README.md +++ b/frontend/packages/integration-tests-cypress/README.md @@ -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 @@ -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 ``` diff --git a/test-prow-e2e.sh b/test-prow-e2e.sh index 5cc06a7ce41..03d5b84fa3a 100755 --- a/test-prow-e2e.sh +++ b/test-prow-e2e.sh @@ -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