mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-04 20:58:36 +00:00
fix(cypress): fix ingestion_source cypress test (#15154)
This commit is contained in:
parent
46d2063091
commit
2bcbd76ede
@ -1,3 +1,5 @@
|
||||
import { hasOperationName } from "../utils";
|
||||
|
||||
const number = crypto.getRandomValues(new Uint32Array(1))[0];
|
||||
const accound_id = `account${number}`;
|
||||
const warehouse_id = `warehouse${number}`;
|
||||
@ -6,7 +8,21 @@ const password = `password${number}`;
|
||||
const role = `role${number}`;
|
||||
const ingestion_source_name = `ingestion source ${number}`;
|
||||
|
||||
export const setIngestionRedesignFlag = (isOn) => {
|
||||
cy.intercept("POST", "/api/v2/graphql", (req) => {
|
||||
if (hasOperationName(req, "appConfig")) {
|
||||
req.reply((res) => {
|
||||
res.body.data.appConfig.featureFlags.showIngestionPageRedesign = isOn;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
describe("ingestion source creation flow", () => {
|
||||
beforeEach(() => {
|
||||
setIngestionRedesignFlag(false); // Set the ingestion redesign flag to false
|
||||
});
|
||||
|
||||
it("create a ingestion source using ui, verify ingestion source details saved correctly, remove ingestion source", () => {
|
||||
// Go to ingestion page, create a snowflake source
|
||||
cy.loginWithCredentials();
|
||||
@ -45,8 +61,8 @@ describe("ingestion source creation flow", () => {
|
||||
.should("be.visible");
|
||||
|
||||
// Verify ingestion source details are saved correctly
|
||||
cy.get('[data-testid="ingestion-source-table-edit-button"]')
|
||||
.first()
|
||||
cy.contains("tr", ingestion_source_name)
|
||||
.find('[data-testid="ingestion-source-table-edit-button"]')
|
||||
.click();
|
||||
cy.waitTextVisible("Edit Data Source");
|
||||
cy.get("#account_id").should("have.value", accound_id);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user