Skip to content

Commit 2bcbd76

Browse files
authored
fix(cypress): fix ingestion_source cypress test (#15154)
1 parent 46d2063 commit 2bcbd76

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

smoke-test/tests/cypress/cypress/e2e/mutations/ingestion_source.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { hasOperationName } from "../utils";
2+
13
const number = crypto.getRandomValues(new Uint32Array(1))[0];
24
const accound_id = `account${number}`;
35
const warehouse_id = `warehouse${number}`;
@@ -6,7 +8,21 @@ const password = `password${number}`;
68
const role = `role${number}`;
79
const ingestion_source_name = `ingestion source ${number}`;
810

11+
export const setIngestionRedesignFlag = (isOn) => {
12+
cy.intercept("POST", "/api/v2/graphql", (req) => {
13+
if (hasOperationName(req, "appConfig")) {
14+
req.reply((res) => {
15+
res.body.data.appConfig.featureFlags.showIngestionPageRedesign = isOn;
16+
});
17+
}
18+
});
19+
};
20+
921
describe("ingestion source creation flow", () => {
22+
beforeEach(() => {
23+
setIngestionRedesignFlag(false); // Set the ingestion redesign flag to false
24+
});
25+
1026
it("create a ingestion source using ui, verify ingestion source details saved correctly, remove ingestion source", () => {
1127
// Go to ingestion page, create a snowflake source
1228
cy.loginWithCredentials();
@@ -45,8 +61,8 @@ describe("ingestion source creation flow", () => {
4561
.should("be.visible");
4662

4763
// Verify ingestion source details are saved correctly
48-
cy.get('[data-testid="ingestion-source-table-edit-button"]')
49-
.first()
64+
cy.contains("tr", ingestion_source_name)
65+
.find('[data-testid="ingestion-source-table-edit-button"]')
5066
.click();
5167
cy.waitTextVisible("Edit Data Source");
5268
cy.get("#account_id").should("have.value", accound_id);

0 commit comments

Comments
 (0)