File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
smoke-test/tests/cypress/cypress Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -96,11 +96,13 @@ export const updateIngestionSource = (
9696 updatedSourceName ,
9797 options = undefined ,
9898) => {
99+ cy . interceptGraphQLOperation ( "getIngestionSource" ) ;
99100 cy . contains ( "td" , sourceName )
100101 . siblings ( "td" )
101102 . find ( '[data-testid="ingestion-more-options"]' )
102103 . click ( ) ;
103104 cy . get ( "body .ant-dropdown-menu" ) . contains ( "Edit" ) . click ( ) ;
105+ cy . waitForGraphQLOperation ( "getIngestionSource" ) ;
104106 cy . waitTextVisible ( "Edit Data Source" ) ;
105107 cy . get ( '[data-testid="recipe-builder-next-button"]' ) . scrollIntoView ( ) . click ( ) ;
106108 cy . waitTextVisible ( "Configure an Ingestion Schedule" ) ;
Original file line number Diff line number Diff line change @@ -12,6 +12,13 @@ export const aliasQuery = (req, operationName) => {
1212 }
1313} ;
1414
15+ // Alias graphql operation (query or mutation)
16+ export const aliasGraphQLOperation = ( req , operationName ) => {
17+ if ( hasOperationName ( req , operationName ) ) {
18+ req . alias = `gql${ operationName } ` ;
19+ }
20+ } ;
21+
1522export const getThemeV2Interceptor = ( isEnabled ) => ( req , res ) => {
1623 if ( hasOperationName ( req , "appConfig" ) ) {
1724 res . body . data . appConfig . featureFlags . themeV2Enabled = isEnabled ;
Original file line number Diff line number Diff line change 1212// -- This is a parent command --
1313
1414import dayjs from "dayjs" ;
15- import { hasOperationName } from "../e2e/utils" ;
15+ import { hasOperationName , aliasGraphQLOperation } from "../e2e/utils" ;
1616
1717function selectorWithtestId ( id ) {
1818 return `[data-testid="${ id } "]` ;
@@ -627,6 +627,19 @@ Cypress.Commands.add("setIsThemeV2Enabled", (isEnabled) => {
627627 } ) ;
628628} ) ;
629629
630+ Cypress . Commands . add ( "interceptGraphQLOperation" , ( operationName ) => {
631+ cy . intercept ( "POST" , "/api/v2/graphql" , ( req ) => {
632+ aliasGraphQLOperation ( req , operationName ) ;
633+ } ) ;
634+ } ) ;
635+
636+ Cypress . Commands . add (
637+ "waitForGraphQLOperation" ,
638+ ( operationName , options = { } ) => {
639+ cy . wait ( `@gql${ operationName } ` , options ) ;
640+ } ,
641+ ) ;
642+
630643Cypress . on ( "uncaught:exception" , ( err ) => {
631644 const resizeObserverLoopLimitErrMessage =
632645 "ResizeObserver loop limit exceeded" ;
You can’t perform that action at this time.
0 commit comments