mirror of
https://github.com/getredash/redash.git
synced 2025-12-21 10:25:33 -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>
59 lines
1.6 KiB
JavaScript
59 lines
1.6 KiB
JavaScript
/* global cy */
|
|
|
|
describe("Edit visualization dialog", () => {
|
|
beforeEach(() => {
|
|
cy.login();
|
|
cy.createQuery().then(({ id }) => {
|
|
cy.visit(`queries/${id}/source`);
|
|
cy.getByTestId("ExecuteButton").click();
|
|
});
|
|
});
|
|
|
|
it("opens New Visualization dialog", () => {
|
|
cy.getByTestId("NewVisualization")
|
|
.should("exist")
|
|
.click();
|
|
cy.getByTestId("EditVisualizationDialog").should("exist");
|
|
// Default visualization should be selected
|
|
cy.getByTestId("VisualizationType")
|
|
.should("exist")
|
|
.should("contain", "Chart");
|
|
cy.getByTestId("VisualizationName")
|
|
.should("exist")
|
|
.should("have.value", "Chart");
|
|
});
|
|
|
|
it("opens Edit Visualization dialog", () => {
|
|
cy.getByTestId("EditVisualization").click();
|
|
cy.getByTestId("EditVisualizationDialog").should("exist");
|
|
// Default `Table` visualization should be selected
|
|
cy.getByTestId("VisualizationType")
|
|
.should("exist")
|
|
.should("contain", "Table");
|
|
cy.getByTestId("VisualizationName")
|
|
.should("exist")
|
|
.should("have.value", "Table");
|
|
});
|
|
|
|
it("creates visualization with custom name", () => {
|
|
const visualizationName = "Custom name";
|
|
|
|
cy.clickThrough(`
|
|
NewVisualization
|
|
VisualizationType
|
|
VisualizationType.TABLE
|
|
`);
|
|
|
|
cy.getByTestId("VisualizationName")
|
|
.clear()
|
|
.type(visualizationName);
|
|
|
|
cy.getByTestId("EditVisualizationDialog")
|
|
.contains("button", "Save")
|
|
.click();
|
|
cy.getByTestId("QueryPageVisualizationTabs")
|
|
.contains("span", visualizationName)
|
|
.should("exist");
|
|
});
|
|
});
|