Fix specs (#3577)
This commit is contained in:
parent
8aca378028
commit
0e3901953b
|
|
@ -70,36 +70,29 @@ describe("GlobalSearch", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("navigatesToDatasourceHavingAQuery", () => {
|
it("navigatesToDatasourceHavingAQuery", () => {
|
||||||
cy.window()
|
cy.createPostgresDatasource();
|
||||||
.its("store")
|
cy.get("@createDatasource").then((httpResponse) => {
|
||||||
.invoke("getState")
|
const expectedDatasource = httpResponse.response.body.data;
|
||||||
.then((state) => {
|
cy.NavigateToQueryEditor();
|
||||||
cy.createPostgresDatasource();
|
cy.contains(".t--datasource-name", expectedDatasource.name)
|
||||||
cy.NavigateToQueryEditor();
|
.find(queryLocators.createQuery)
|
||||||
|
.click();
|
||||||
|
|
||||||
const { datasources } = state.entities;
|
cy.get(commonlocators.globalSearchTrigger).click({ force: true });
|
||||||
const expectedDatasource =
|
cy.wait(1000); // modal open transition should be deterministic
|
||||||
datasources.list[datasources.list.length - 1];
|
cy.get(commonlocators.globalSearchClearInput).click({ force: true });
|
||||||
|
cy.get(commonlocators.globalSearchInput).type("Page1");
|
||||||
|
cy.get("body").type("{enter}");
|
||||||
|
|
||||||
cy.contains(".t--datasource-name", expectedDatasource.name)
|
cy.get(commonlocators.globalSearchTrigger).click({ force: true });
|
||||||
.find(queryLocators.createQuery)
|
cy.wait(1000); // modal open transition should be deterministic
|
||||||
.click();
|
cy.get(commonlocators.globalSearchClearInput).click({ force: true });
|
||||||
|
cy.get(commonlocators.globalSearchInput).type(expectedDatasource.name);
|
||||||
cy.get(commonlocators.globalSearchTrigger).click({ force: true });
|
cy.get("body").type("{enter}");
|
||||||
cy.wait(1000);
|
cy.location().should((loc) => {
|
||||||
cy.get(commonlocators.globalSearchClearInput).click({ force: true });
|
expect(loc.pathname).includes(expectedDatasource.id);
|
||||||
cy.get(commonlocators.globalSearchInput).type("Page1");
|
|
||||||
cy.get("body").type("{enter}");
|
|
||||||
|
|
||||||
cy.get(commonlocators.globalSearchTrigger).click({ force: true });
|
|
||||||
cy.wait(1000);
|
|
||||||
cy.get(commonlocators.globalSearchClearInput).click({ force: true });
|
|
||||||
cy.get(commonlocators.globalSearchInput).type(expectedDatasource.name);
|
|
||||||
cy.get("body").type("{enter}");
|
|
||||||
cy.location().should((loc) => {
|
|
||||||
expect(loc.pathname).includes(expectedDatasource.id);
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("navigatesToPage", () => {
|
it("navigatesToPage", () => {
|
||||||
|
|
|
||||||
|
|
@ -15,49 +15,59 @@ describe("Onboarding", function() {
|
||||||
201,
|
201,
|
||||||
);
|
);
|
||||||
cy.wait("@getDataSources");
|
cy.wait("@getDataSources");
|
||||||
cy.wait("@getPluginForm").should(
|
|
||||||
"have.nested.property",
|
|
||||||
"response.body.responseMeta.status",
|
|
||||||
200,
|
|
||||||
);
|
|
||||||
cy.get(".t--start-building")
|
|
||||||
.should("be.visible")
|
|
||||||
.click({ force: true });
|
|
||||||
// Create and run query
|
|
||||||
cy.get(".t--onboarding-indicator").should("be.visible");
|
|
||||||
cy.get(".t--create-query").click();
|
|
||||||
cy.runQuery();
|
|
||||||
|
|
||||||
// Add widget
|
cy.window()
|
||||||
cy.get(".t--add-widget").click();
|
.its("store")
|
||||||
cy.dragAndDropToCanvas("tablewidget", { x: 30, y: -30 });
|
.invoke("getState")
|
||||||
|
.then((state) => {
|
||||||
// Click on "Show me how" and then copy hint
|
const datasources = state.entities.datasources.list;
|
||||||
cy.get(".t--onboarding-action").click();
|
let onboardingDatasource = datasources.find((datasource) => {
|
||||||
cy.get(".t--onboarding-snippet").click({ force: true });
|
const name = datasource.name;
|
||||||
|
return name === "Super Updates DB";
|
||||||
cy.get(".t--property-control-tabledata" + " .CodeMirror textarea")
|
|
||||||
.first()
|
|
||||||
.focus({ force: true })
|
|
||||||
.type("{uparrow}", { force: true })
|
|
||||||
.type("{ctrl}{shift}{downarrow}", { force: true });
|
|
||||||
cy.focused().then(() => {
|
|
||||||
cy.get(".t--property-control-tabledata" + " .CodeMirror")
|
|
||||||
.first()
|
|
||||||
.then((editor) => {
|
|
||||||
editor[0].CodeMirror.setValue("{{fetch_standup_updates.data}}");
|
|
||||||
});
|
});
|
||||||
});
|
|
||||||
cy.closePropertyPane();
|
|
||||||
cy.get(explorer.closeWidgets).click();
|
|
||||||
|
|
||||||
cy.openPropertyPane("tablewidget");
|
if (!onboardingDatasource) {
|
||||||
cy.closePropertyPane();
|
cy.wait("@createDatasource");
|
||||||
cy.get(".t--application-feedback-btn").should("not.exist");
|
}
|
||||||
|
|
||||||
cy.contains(".t--onboarding-helper-title", "Capture Hero Updates");
|
cy.get(".t--start-building").click();
|
||||||
cy.get(".t--onboarding-cheat-action").click();
|
|
||||||
cy.contains(".t--onboarding-helper-title", "Deploy the Standup Dashboard");
|
// Create and run query
|
||||||
|
cy.get(".t--onboarding-indicator").should("be.visible");
|
||||||
|
cy.get(".t--create-query").click();
|
||||||
|
cy.runQuery();
|
||||||
|
|
||||||
|
// Add widget
|
||||||
|
cy.get(".t--add-widget").click();
|
||||||
|
cy.dragAndDropToCanvas("tablewidget", { x: 30, y: -30 });
|
||||||
|
|
||||||
|
// Click on "Show me how" and then copy hint
|
||||||
|
cy.get(".t--onboarding-action").click();
|
||||||
|
cy.get(".t--onboarding-snippet").click({ force: true });
|
||||||
|
|
||||||
|
cy.get(".t--property-control-tabledata" + " .CodeMirror textarea")
|
||||||
|
.first()
|
||||||
|
.focus({ force: true })
|
||||||
|
.type("{uparrow}", { force: true })
|
||||||
|
.type("{ctrl}{shift}{downarrow}", { force: true });
|
||||||
|
cy.focused().then(() => {
|
||||||
|
cy.get(".t--property-control-tabledata" + " .CodeMirror")
|
||||||
|
.first()
|
||||||
|
.then((editor) => {
|
||||||
|
editor[0].CodeMirror.setValue("{{fetch_standup_updates.data}}");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
cy.closePropertyPane();
|
||||||
|
cy.get(explorer.closeWidgets).click();
|
||||||
|
|
||||||
|
cy.openPropertyPane("tablewidget");
|
||||||
|
cy.closePropertyPane();
|
||||||
|
cy.get(".t--application-feedback-btn").should("not.exist");
|
||||||
|
|
||||||
|
cy.contains(".t--onboarding-helper-title", "Capture Hero Updates");
|
||||||
|
cy.get(".t--onboarding-cheat-action").click();
|
||||||
|
cy.contains(".t--onboarding-helper-title", "Deploy the Standup Dashboard");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// Similar to PublishtheApp command with little changes
|
// Similar to PublishtheApp command with little changes
|
||||||
|
|
|
||||||
|
|
@ -1656,8 +1656,7 @@ Cypress.Commands.add(
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get(widgetsPage.menubar)
|
cy.get(widgetsPage.menubar)
|
||||||
.contains("Show Message")
|
.contains("Show Message")
|
||||||
.click({ force: true })
|
.click({ force: true });
|
||||||
.should("have.text", "Show Message");
|
|
||||||
|
|
||||||
cy.get(alertcss)
|
cy.get(alertcss)
|
||||||
.click({ force: true })
|
.click({ force: true })
|
||||||
|
|
@ -1960,7 +1959,7 @@ Cypress.Commands.add("openPropertyPane", (widgetType) => {
|
||||||
const selector = `.t--draggable-${widgetType}`;
|
const selector = `.t--draggable-${widgetType}`;
|
||||||
cy.get(selector)
|
cy.get(selector)
|
||||||
.first()
|
.first()
|
||||||
.trigger("mouseover")
|
.trigger("mouseover", { force: true })
|
||||||
.wait(500);
|
.wait(500);
|
||||||
cy.get(`${selector}:first-of-type .t--widget-propertypane-toggle`)
|
cy.get(`${selector}:first-of-type .t--widget-propertypane-toggle`)
|
||||||
.first()
|
.first()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user