Skip to content
Snippets Groups Projects
Unverified Commit c6a80fe5 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

[E2E] Handle #17450 failures (#25179)

* Temporarily skip repro for #17450 for H2 database

* Reproduce #17450 using Postgres
parent 482b061e
No related branches found
No related tags found
No related merge requests found
......@@ -8,12 +8,19 @@ describe("admin > database > add > external databases", () => {
cy.intercept("POST", "/api/database").as("createDatabase");
});
it("should add Postgres database and redirect to listing", () => {
it("should add Postgres database and redirect to listing (metabase#17450)", () => {
cy.visit("/admin/databases/create");
cy.contains("Database type").closest(".Form-field").find("a").click();
cy.contains("PostgreSQL").click({ force: true });
cy.findByText("Show advanced options").click();
cy.contains("Additional JDBC connection string options");
// Reproduces metabase#17450
cy.findByLabelText("Choose when syncs and scans happen")
.click()
.should("have.attr", "aria-checked", "true");
isSyncOptionSelected("Never, I'll do this manually if I need to");
typeAndBlurUsingLabel("Display name", "QA Postgres12");
typeAndBlurUsingLabel("Host", "localhost");
......@@ -22,20 +29,31 @@ describe("admin > database > add > external databases", () => {
typeAndBlurUsingLabel("Username", "metabase");
typeAndBlurUsingLabel("Password", "metasample123");
cy.findByText("Save").should("not.be.disabled").click();
cy.button("Save").should("not.be.disabled").click();
cy.wait("@createDatabase");
cy.url().should("match", /\/admin\/databases\?created=true$/);
cy.findByRole("table").within(() => {
cy.findByText("QA Postgres12");
});
cy.findByText("We're taking a look at your database!");
cy.findByLabelText("close icon").click();
cy.findByRole("status").within(() => {
cy.findByText("Syncing…");
cy.findByText("Done!");
});
cy.findByRole("table").within(() => {
cy.findByText("QA Postgres12").click();
});
cy.findByLabelText("Choose when syncs and scans happen").should(
"have.attr",
"aria-checked",
"true",
);
isSyncOptionSelected("Never, I'll do this manually if I need to");
});
it("should add Mongo database and redirect to listing", () => {
......@@ -106,3 +124,8 @@ describe("admin > database > add > external databases", () => {
});
});
});
function isSyncOptionSelected(option) {
// This is a really bad way to assert that the text element is selected/active. Can it be fixed in the FE code?
cy.findByText(option).parent().should("have.class", "text-brand");
}
......@@ -165,7 +165,9 @@ describe("scenarios > admin > databases > add", () => {
cy.findByText("Need help connecting?");
});
it("should respect users' decision to manually sync large database (metabase#17450)", () => {
// TODO:
// Enable once https://github.com/metabase/metabase/issues/24900 gets fixed!
it.skip("should respect users' decision to manually sync large database (metabase#17450)", () => {
const H2_CONNECTION_STRING =
"zip:./target/uberjar/metabase.jar!/sample-database.db;USER=GUEST;PASSWORD=guest";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment