Skip to content
Snippets Groups Projects
Unverified Commit 6350342a authored by Ariya Hidayat's avatar Ariya Hidayat Committed by GitHub
Browse files

MySQL E2E test: wait for dataset and table view before assertions (#21115)

parent 5d100b0e
Branches
Tags
No related merge requests found
......@@ -5,6 +5,7 @@ const MYSQL_DB_NAME = "QA MySQL8";
describe("scenatios > question > native > mysql", () => {
beforeEach(() => {
cy.intercept("POST", "/api/card").as("createQuestion");
cy.intercept("POST", "/api/dataset").as("dataset");
restore("mysql-8");
cy.signInAsAdmin();
......@@ -24,9 +25,13 @@ describe("scenatios > question > native > mysql", () => {
);
cy.get(".NativeQueryEditor .Icon-play").click();
cy.wait("@dataset");
cy.get(".Visualization").as("queryPreview");
cy.get("@queryPreview").contains("Widget");
cy.get("@queryPreview")
.should("be.visible")
.contains("Widget");
// Filter by Product ID = 1 (its category is Gizmo)
cy.findByPlaceholderText(/Id/i)
......@@ -45,6 +50,10 @@ describe("scenatios > question > native > mysql", () => {
it("can save a native MySQL query", () => {
cy.get(".ace_content").type(`SELECT * FROM ORDERS`);
cy.get(".NativeQueryEditor .Icon-play").click();
cy.wait("@dataset");
cy.findByTextEnsureVisible("SUBTOTAL");
cy.contains("37.65");
// Save the query
......@@ -62,7 +71,7 @@ describe("scenatios > question > native > mysql", () => {
cy.wait("@createQuestion");
cy.findByText("Not now").click();
cy.findByTextEnsureVisible("Not now").click();
cy.contains("Save").should("not.exist");
cy.url().should("match", /\/question\/\d+-[a-z0-9-]*$/);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment