-
- Downloads
Fixing E2E Cross-version Tests (#39285)
* Fixing E2E Cross-version Tests E2E cross version tests were broken for multiple reasons, primarily due to changes made in UI layout, cypress testing, and data changes. Overall, the basic workflows still work, but subtle click order differences and other small changes made the entire job consistently fail. To fix this, this PR: - Provides a function, `parseVersionString`, which computes version information provided a test version string. This information includes the raw string version, the edition (ee or oss), and the major, minor, and patch version of the version string. - In the same file, `cross-version-helpers.js`, adds constants identifying versions in which certain breaking UI or Cypress changes occurred. - Finally, a set of exported functions are provided which take a version object and execute conditional logic based on the provided version so that behavior is consistent across Metabase versions. The versions are computed in `cross-version-source-helpers.js` and `cross-version-target-helpers.js` and are used in js files as shown: ```js import { visualize } from "e2e/support/helpers"; import { fillAreaUnderLineChart, newQuestion, saveQuestion, } from "e2e/test/scenarios/cross-version/helpers/cross-version-helpers.js"; ``` This then allows logic like the below, where the high level call is made and the right logic is dispatched based on the version information. ```js it("should create questions", () => { cy.signInAsAdmin(); cy.visit("/question/new"); newQuestion(version); // eslint-disable-next-line no-unscoped-text-selectors -- deprecated usage cy.findByText("Orders").click(); }) ``` Other smaller changes were also made that created a more universal sequence of UI actions. Fixes #39229 * clear -> click * Fixing area icon selection * Restoring scheduling to align with master * fe lint
Showing
- .github/workflows/e2e-cross-version.yml 2 additions, 0 deletions.github/workflows/e2e-cross-version.yml
- e2e/test/scenarios/cross-version/helpers/cross-version-helpers.js 175 additions, 0 deletions.../scenarios/cross-version/helpers/cross-version-helpers.js
- e2e/test/scenarios/cross-version/source/00-setup.cy.spec.js 7 additions, 4 deletionse2e/test/scenarios/cross-version/source/00-setup.cy.spec.js
- e2e/test/scenarios/cross-version/source/02-datamodel.cy.spec.js 26 additions, 5 deletions...st/scenarios/cross-version/source/02-datamodel.cy.spec.js
- e2e/test/scenarios/cross-version/source/03-questions.cy.spec.js 41 additions, 9 deletions...st/scenarios/cross-version/source/03-questions.cy.spec.js
- e2e/test/scenarios/cross-version/source/helpers/cross-version-source-helpers.js 2 additions, 44 deletions...ss-version/source/helpers/cross-version-source-helpers.js
- e2e/test/scenarios/cross-version/target/helpers/cross-version-target-helpers.js 3 additions, 1 deletion...ss-version/target/helpers/cross-version-target-helpers.js
- e2e/test/scenarios/cross-version/target/smoke.cy.spec.js 8 additions, 9 deletionse2e/test/scenarios/cross-version/target/smoke.cy.spec.js
Loading
Please register or sign in to comment