Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions client/cypress/integration/dashboard/dashboard_tags_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ describe("Dashboard Tags", () => {

cy.getByTestId("TagsControl").contains(".label", "Unpublished");

cy.getByTestId("EditTagsButton")
.should("contain", "Add tag")
.click();
cy.getByTestId("EditTagsButton").should("contain", "Add tag");
cy.getByTestId("EditTagsButton").click();

typeInTagsSelectAndSave("tag1{enter}tag2{enter}tag3{enter}");

Expand Down
5 changes: 2 additions & 3 deletions client/cypress/integration/query/create_query_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ describe("Create Query", () => {
.get(".ace_text-input")
.type("SELECT id, name FROM organizations{esc}", { force: true });

cy.getByTestId("ExecuteButton")
.should("be.enabled")
.click();
cy.getByTestId("ExecuteButton").should("be.enabled");
cy.getByTestId("ExecuteButton").click();

cy.getByTestId("TableVisualization").should("exist");
cy.percySnapshot("Edit Query");
Expand Down
5 changes: 2 additions & 3 deletions client/cypress/integration/query/query_tags_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ describe("Query Tags", () => {

cy.getByTestId("TagsControl").contains(".label", "Unpublished");

cy.getByTestId("EditTagsButton")
.should("contain", "Add tag")
.click();
cy.getByTestId("EditTagsButton").should("contain", "Add tag");
cy.getByTestId("EditTagsButton").click();

typeInTagsSelectAndSave("tag1{enter}tag2{enter}tag3{enter}");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ describe("Settings", () => {
query: "SELECT NOW()",
}).then(({ id: queryId }) => {
cy.visit(`/queries/${queryId}/source`);
cy.getByTestId("ExecuteButton").should("not.be.disabled").click();
cy.getByTestId("ExecuteButton").should("not.be.disabled");
cy.getByTestId("ExecuteButton").click();

// "created at" field is formatted with the date format.
cy.getByTestId("TableVisualization")
Expand Down
5 changes: 2 additions & 3 deletions client/cypress/integration/user/logout_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ describe("Logout", () => {
cy.getByTestId("ProfileDropdown").click();
// Wait until submenu appears and become interactive
cy.wait(500); // eslint-disable-line cypress/no-unnecessary-waiting
cy.getByTestId("LogOutButton")
.should("be.visible")
.click();
cy.getByTestId("LogOutButton").should("be.visible");
cy.getByTestId("LogOutButton").click();

cy.title().should("eq", "Login to Redash");
});
Expand Down
3 changes: 2 additions & 1 deletion client/cypress/integration/visualizations/box_plot_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ describe("Box Plot", () => {
.then(({ id }) => cy.createVisualization(id, "BOXPLOT", "Boxplot (Deprecated)", {}))
.then(({ id: visualizationId, query_id: queryId }) => {
cy.visit(`queries/${queryId}/source#${visualizationId}`);
cy.getByTestId("ExecuteButton").should("not.be.disabled").click();
cy.getByTestId("ExecuteButton").should("not.be.disabled");
cy.getByTestId("ExecuteButton").click();
});
});

Expand Down
3 changes: 2 additions & 1 deletion client/cypress/integration/visualizations/chart_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ describe("Chart", () => {

it("creates Bar charts", function() {
cy.visit(`queries/${this.queryId}/source`);
cy.getByTestId("ExecuteButton").should("not.be.disabled").click();
cy.getByTestId("ExecuteButton").should("not.be.disabled");
cy.getByTestId("ExecuteButton").click();

const getBarChartAssertionFunction = (specificBarChartAssertionFn = () => {}) => () => {
// checks for TabbedEditor standard tabs
Expand Down
3 changes: 2 additions & 1 deletion client/cypress/integration/visualizations/choropleth_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ describe("Choropleth", () => {
cy.login();
cy.createQuery({ query: SQL }).then(({ id }) => {
cy.visit(`queries/${id}/source`);
cy.getByTestId("ExecuteButton").should("not.be.disabled").click();
cy.getByTestId("ExecuteButton").should("not.be.disabled");
cy.getByTestId("ExecuteButton").click();
});
cy.getByTestId("NewVisualization").click();
cy.getByTestId("VisualizationType").selectAntdOption("VisualizationType.CHOROPLETH");
Expand Down
3 changes: 2 additions & 1 deletion client/cypress/integration/visualizations/cohort_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ describe("Cohort", () => {
cy.login();
cy.createQuery({ query: SQL }).then(({ id }) => {
cy.visit(`queries/${id}/source`);
cy.getByTestId("ExecuteButton").should("not.be.disabled").click();
cy.getByTestId("ExecuteButton").should("not.be.disabled");
cy.getByTestId("ExecuteButton").click();
});
cy.getByTestId("NewVisualization").click();
cy.getByTestId("VisualizationType").selectAntdOption("VisualizationType.COHORT");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@ describe("Edit visualization dialog", () => {
});

it("opens New Visualization dialog", () => {
cy.getByTestId("NewVisualization")
.should("exist")
.click();
cy.getByTestId("NewVisualization").should("exist");
cy.getByTestId("NewVisualization").click();
cy.getByTestId("EditVisualizationDialog").should("exist");
// Default visualization should be selected
cy.getByTestId("VisualizationType")
Expand Down
3 changes: 2 additions & 1 deletion client/cypress/integration/visualizations/funnel_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ describe("Funnel", () => {
cy.login();
cy.createQuery({ query: SQL }).then(({ id }) => {
cy.visit(`queries/${id}/source`);
cy.getByTestId("ExecuteButton").should("not.be.disabled").click();
cy.getByTestId("ExecuteButton").should("not.be.disabled");
cy.getByTestId("ExecuteButton").click();
});
});

Expand Down
5 changes: 2 additions & 3 deletions client/cypress/integration/visualizations/pivot_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,8 @@ describe("Pivot", () => {
cy.wait(200);

cy.getByTestId("SaveButton").click();
cy.getByTestId("ExecuteButton")
.should("be.enabled")
.click();
cy.getByTestId("ExecuteButton").should("be.enabled");
cy.getByTestId("ExecuteButton").click();

// assert number of rows is 12
cy.getByTestId("PivotTableVisualization").contains(".pvtGrandTotal", "12");
Expand Down
9 changes: 6 additions & 3 deletions client/cypress/integration/visualizations/table/table_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ function prepareVisualization(query, type, name, options) {
// free more space for visualizations. Also, we'll hide schema browser (via shortcut)
cy.visit(`queries/${queryId}#${visualizationId}`);

cy.getByTestId("ExecuteButton").first().should("not.be.disabled").click();
cy.getByTestId("ExecuteButton").first().should("not.be.disabled");
cy.getByTestId("ExecuteButton").first().click();
cy.get("body").type("{alt}D");

// do some pre-checks here to ensure that visualization was created and is visible
Expand All @@ -42,8 +43,10 @@ describe("Table", () => {
const { query, config } = AllCellTypes;
prepareVisualization(query, "TABLE", "All cell types", config).then(() => {
// expand JSON cell
cy.get(".jvi-item.jvi-root .jvi-toggle").should("be.visible").click();
cy.get(".jvi-item.jvi-root .jvi-item .jvi-toggle").should("be.visible").click({ multiple: true });
cy.get(".jvi-item.jvi-root .jvi-toggle").should("be.visible");
cy.get(".jvi-item.jvi-root .jvi-toggle").click();
cy.get(".jvi-item.jvi-root .jvi-item .jvi-toggle").should("be.visible");
cy.get(".jvi-item.jvi-root .jvi-item .jvi-toggle").click({ multiple: true });

cy.percySnapshot("Visualizations - Table (All cell types)", { widths: [viewportWidth] });
});
Expand Down