mirror of
https://github.com/getredash/redash.git
synced 2025-12-20 09:57:35 -05:00
* 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>
28 lines
678 B
JavaScript
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/);
|
|
});
|
|
});
|