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

#17450 Repro: New databases with "This is a large database ..." still uses the...

#17450 Repro: New databases with "This is a large database ..." still uses the default sync+scan settings (#17476)

* Add helper function to choose/select a database

* Apply helper function to BigQuery and GA

* Add repro for #17450
parent baed054f
No related branches found
No related tags found
No related merge requests found
......@@ -184,18 +184,43 @@ describe("scenarios > admin > databases > add", () => {
);
});
it.skip("should respect users' decision to manually sync large database (metabase#17450)", () => {
const H2_CONNECTION_STRING =
"zip:./target/uberjar/metabase.jar!/sample-dataset.db;USER=GUEST;PASSWORD=guest";
const databaseName = "Another H2";
cy.visit("/admin/databases/create");
chooseDatabase("H2");
typeField("Name", databaseName);
typeField("Connection String", H2_CONNECTION_STRING);
cy.findByLabelText(
"This is a large database, so let me choose when Metabase syncs and scans",
)
.click()
.should("have.attr", "aria-checked", "true");
cy.button("Next").click();
isSyncOptionSelected("Never, I'll do this manually if I need to");
cy.button("Save").click();
cy.findByText("I'm good thanks").click();
cy.findByText(databaseName).click();
cy.findByText("Scheduling").click();
isSyncOptionSelected("Never, I'll do this manually if I need to");
});
describe("BigQuery", () => {
it("should let you upload the service account json from a file", () => {
cy.visit("/admin/databases/create");
// select BigQuery
cy.contains("Database type")
.parents(".Form-field")
.find(".AdminSelect")
.click();
popover()
.contains("BigQuery")
.click({ force: true });
chooseDatabase("BigQuery");
// enter text
typeField("Name", "bq db");
......@@ -261,13 +286,7 @@ describe("scenarios > admin > databases > add", () => {
describe("Google Analytics ", () => {
it("should generate well-formed external auth URLs", () => {
cy.visit("/admin/databases/create");
cy.contains("Database type")
.parents(".Form-field")
.find(".AdminSelect")
.click();
popover()
.contains("Google Analytics")
.click({ force: true });
chooseDatabase("Google Analytics");
typeField("Client ID", " 999 ");
......@@ -281,3 +300,20 @@ describe("scenarios > admin > databases > add", () => {
});
});
});
function chooseDatabase(database) {
cy.contains("Database type")
.parents(".Form-field")
.find(".AdminSelect")
.click();
popover()
.contains(database)
.click({ force: true });
}
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");
}
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