Skip to content
Snippets Groups Projects
Unverified Commit e6c518a9 authored by Mark Bastian's avatar Mark Bastian Committed by GitHub
Browse files

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
parent b0c471ef
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment