Skip to content
Snippets Groups Projects
Unverified Commit daa805f3 authored by Alexander Lesnenko's avatar Alexander Lesnenko Committed by GitHub
Browse files

Fix table visualization flaky spec (#16041)


* hack table visualization flaky spec

* Fix the flake by waiting for the table to update

Co-authored-by: default avatarNemanja <31325167+nemanjaglumac@users.noreply.github.com>
parent b8c81d02
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,7 @@ describe("scenarios > visualizations > table", () => { ...@@ -15,6 +15,7 @@ describe("scenarios > visualizations > table", () => {
beforeEach(() => { beforeEach(() => {
restore(); restore();
cy.signInAsNormalUser(); cy.signInAsNormalUser();
cy.intercept("POST", "/api/dataset").as("dataset");
}); });
it("should allow to display any column as link with extrapolated url and text", () => { it("should allow to display any column as link with extrapolated url and text", () => {
...@@ -22,6 +23,7 @@ describe("scenarios > visualizations > table", () => { ...@@ -22,6 +23,7 @@ describe("scenarios > visualizations > table", () => {
dataset_query: testQuery, dataset_query: testQuery,
display: "table", display: "table",
}); });
cy.wait("@dataset");
cy.findByText("City").click(); cy.findByText("City").click();
...@@ -34,10 +36,15 @@ describe("scenarios > visualizations > table", () => { ...@@ -34,10 +36,15 @@ describe("scenarios > visualizations > table", () => {
popover().within(() => { popover().within(() => {
cy.findByText("Link").click(); cy.findByText("Link").click();
}); });
// There is a lag caused by update of the table visualization which breaks Cypress typing.
// Any field in the table will not be "actionable" (the whole table has an overlay with pointer-events set to none) so Cypress cannot click it.
// Adding this line makes sure the table finished updating, and solves the typing issue.
cy.findByText("Address").click();
cy.findByTestId("link_text").type("{{CITY}} {{ID}} fixed text", { cy.findByTestId("link_text").type("{{CITY}} {{ID}} fixed text", {
parseSpecialCharSequences: false, parseSpecialCharSequences: false,
}); });
cy.findByTestId("link_url").type("http://metabase.com/people/{{ID}}", { cy.findByTestId("link_url").type("http://metabase.com/people/{{ID}}", {
parseSpecialCharSequences: false, parseSpecialCharSequences: false,
}); });
......
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