1+ import { hasOperationName } from "../utils" ;
2+
13const number = crypto . getRandomValues ( new Uint32Array ( 1 ) ) [ 0 ] ;
24const accound_id = `account${ number } ` ;
35const warehouse_id = `warehouse${ number } ` ;
@@ -6,7 +8,21 @@ const password = `password${number}`;
68const role = `role${ number } ` ;
79const 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+
921describe ( "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