Files
redash/client/cypress/integration/query/create_query_spec.js
Omer Lachish de052ff02b Cypress touch-ups (#5109)
* allow non-sequential IDs for DataSources in Cypress tests

* refactor redash-api to a set of Cypress commands

* support mounting Redash endpoints in Cypress routes

* fix some parameter specs by waiting for schema to load

* extract baseUrl from cypress.json

* Restyled by prettier (#5110)

Co-authored-by: Restyled.io <commits@restyled.io>

Co-authored-by: restyled-io[bot] <32688539+restyled-io[bot]@users.noreply.github.com>
Co-authored-by: Restyled.io <commits@restyled.io>
2020-08-19 21:00:06 +03:00

28 lines
678 B
JavaScript

describe("Create Query", () => {
beforeEach(() => {
cy.login();
cy.visit("/queries/new");
});
it("executes and saves a query", () => {
cy.clickThrough(`
SelectDataSource
SelectDataSource${Cypress.env("dataSourceId")}
`);
cy.getByTestId("QueryEditor")
.get(".ace_text-input")
.type("SELECT id, name FROM organizations{esc}", { force: true });
cy.getByTestId("ExecuteButton")
.should("be.enabled")
.click();
cy.getByTestId("TableVisualization").should("exist");
cy.percySnapshot("Edit Query");
cy.getByTestId("SaveButton").click();
cy.url().should("match", /\/queries\/.+\/source/);
});
});