From c8ffcfd18443596f1179693c755207b627814523 Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Mon, 23 Oct 2023 18:06:39 +0530 Subject: [PATCH 1/5] Add Tests events API for top priority --- .../get-started-experience.cy.js | 28 ++----------- .../top-priority.cy.js | 24 ++++++++++++ .../get-started-experience.cy.js | 28 ++----------- .../wp-module-support/EventsApi.cy.js | 39 ++++++++++++++++++- 4 files changed, 70 insertions(+), 49 deletions(-) diff --git a/tests/cypress/integration/2-general-onboarding-flow/get-started-experience.cy.js b/tests/cypress/integration/2-general-onboarding-flow/get-started-experience.cy.js index a506e7b8f..a0cb39cf8 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/get-started-experience.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/get-started-experience.cy.js @@ -7,7 +7,7 @@ import { CheckInfoPanel, CheckIntroPanel, } from '../wp-module-support/sidebar.cy'; -import { APIList } from '../wp-module-support/EventsApi.cy'; +import { APIList, EventsAPI } from '../wp-module-support/EventsApi.cy'; describe( 'Start Setup WP Experience Page', function () { before( () => { @@ -52,26 +52,6 @@ describe( 'Start Setup WP Experience Page', function () { cy.url().should( 'contain', 'get-started/experience' ); } ); - const EventsAPI = ( experience_val ) => { - cy.intercept( APIList.get_started_experience ).as( 'events' ); - cy.wait( '@events' ).then( ( requestObject ) => { - const responseBody = requestObject.request.body; - const responseData1 = responseBody[ 0 ].data; - if ( 'experience_level' in responseData1 ) { - expect( responseData1.experience_level ).equal( - experience_val - ); - } else { - const responseData2 = responseBody[ 1 ].data; - if ( 'experience_level' in responseData2 ) { - expect( responseData2.experience_level ).equal( - experience_val - ); - } - } - } ); - }; - it( 'Check if events API call being made after radio buttons are clicked', () => { let radioCount = 0; const className = '.components-radio-control__option'; @@ -81,14 +61,14 @@ describe( 'Start Setup WP Experience Page', function () { .eq( radioCount ) .click( { force: true } ); if ( radioCount == 0 ) { - EventsAPI( 'novice' ); + EventsAPI( 'experience_level', 'novice', APIList.get_started_experience ); } if ( radioCount == 1 ) { - EventsAPI( 'intermediate' ); + EventsAPI( 'experience_level', 'intermediate', APIList.get_started_experience ); } if ( radioCount > 1 ) { cy.wait( 5000 ); - EventsAPI( 'expert' ); + EventsAPI( 'experience_level', 'expert', APIList.get_started_experience ); } radioCount += 1; } ); diff --git a/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js b/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js index 1bff16d5f..8980a2b0c 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/top-priority.cy.js @@ -1,6 +1,7 @@ // import { DrawerActivityForMenu } from '../wp-module-support/drawer.cy'; import { CheckHeadingSubheading } from '../wp-module-support/header.cy'; +import { EventsAPI, APIList } from '../wp-module-support/EventsApi.cy'; describe( 'Top Priority Page', function () { before( () => { @@ -27,6 +28,29 @@ describe( 'Top Priority Page', function () { cy.get( '.components-button.skip-button' ).should( 'be.visible' ); } ); + it( 'Check for API events when different cards are selected', ()=> { + let previewCount = 0; + const className = '.components-surface.components-card.nfd-card'; + const arr = cy.get( className ); + arr.each( () => { + cy.get( className ) + .eq( previewCount ) + .should( 'be.visible' ) + .click(); + if ( previewCount == 0 ) { + EventsAPI( 'top_priority', 'content', APIList.top_priority ); + } + if ( previewCount == 1 ) { + EventsAPI( 'top_priority', 'store', APIList.top_priority ); + } + if ( previewCount > 1 ) { + cy.wait( 5000 ); + EventsAPI( 'top_priority', 'design', APIList.top_priority ); + } + previewCount += 1; + }); + } ); + it.skip( 'Click on different cards and move on to next page', () => { let previewCount = 0; const className = '.components-surface.components-card.nfd-card'; diff --git a/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-experience.cy.js b/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-experience.cy.js index b14420fa6..a6dc70e3b 100644 --- a/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-experience.cy.js +++ b/tests/cypress/integration/3-ecommerce-onboarding-flow/get-started-experience.cy.js @@ -7,7 +7,7 @@ import { CheckInfoPanel, CheckIntroPanel, } from '../wp-module-support/sidebar.cy'; -import { APIList } from '../wp-module-support/EventsApi.cy'; +import { APIList, EventsAPI } from '../wp-module-support/EventsApi.cy'; describe( 'Start Setup WP Experience Page', function () { before( () => { @@ -52,26 +52,6 @@ describe( 'Start Setup WP Experience Page', function () { cy.url().should( 'contain', 'get-started/experience' ); } ); - const EventsAPI = ( experience_val ) => { - cy.intercept( APIList.get_started_experience_ecomm ).as( 'events' ); - cy.wait( '@events' ).then( ( requestObject ) => { - const responseBody = requestObject.request.body; - const responseData1 = responseBody[ 0 ].data; - if ( 'experience_level' in responseData1 ) { - expect( responseData1.experience_level ).equal( - experience_val - ); - } else { - const responseData2 = responseBody[ 1 ].data; - if ( 'experience_level' in responseData2 ) { - expect( responseData2.experience_level ).equal( - experience_val - ); - } - } - } ); - }; - it( 'Check if events API call being made after radio buttons are clicked', () => { let radioCount = 0; const className = '.components-radio-control__option'; @@ -81,14 +61,14 @@ describe( 'Start Setup WP Experience Page', function () { .eq( radioCount ) .click( { force: true } ); if ( radioCount == 0 ) { - EventsAPI( 'novice' ); + EventsAPI( 'experience_level', 'novice', APIList.get_started_experience_ecomm ); } if ( radioCount == 1 ) { - EventsAPI( 'intermediate' ); + EventsAPI( 'experience_level', 'intermediate', APIList.get_started_experience_ecomm ); } if ( radioCount > 1 ) { cy.wait( 5000 ); - EventsAPI( 'expert' ); + EventsAPI( 'experience_level', 'expert', APIList.get_started_experience_ecomm ); } radioCount += 1; } ); diff --git a/tests/cypress/integration/wp-module-support/EventsApi.cy.js b/tests/cypress/integration/wp-module-support/EventsApi.cy.js index 7c0e7a8a3..3a6af17f9 100644 --- a/tests/cypress/integration/wp-module-support/EventsApi.cy.js +++ b/tests/cypress/integration/wp-module-support/EventsApi.cy.js @@ -1,4 +1,41 @@ export const APIList = { 'get_started_experience' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', - 'get_started_experience_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user' + 'get_started_experience_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user', + 'top_priority' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user' } + +export const EventsAPI = ( events_name, card_val, api_name ) => { + cy.intercept( api_name ).as( 'events' ); + cy.wait( '@events' ).then( ( requestObject ) => { + const responseBody = requestObject.request.body; + const responseData1 = responseBody[ 0 ].data; + if(events_name == 'experience_level'){ + if ( events_name in responseData1 ) { + expect( responseData1.experience_level ).equal( + card_val + ); + } else { + const responseData2 = responseBody[ 1 ].data; + if ( events_name in responseData2 ) { + expect( responseData2.experience_level ).equal( + card_val + ); + } + } + }; + if(events_name == 'top_priority'){ + if ( events_name in responseData1 ) { + expect( responseData1.top_priority ).equal( + card_val + ); + } else { + const responseData2 = responseBody[ 1 ].data; + if ( events_name in responseData2 ) { + expect( responseData2.top_priority ).equal( + card_val + ); + } + } + }; + }); +}; From 551220f1d7aa080bfd3f8e1beaa252a597137993 Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Mon, 30 Oct 2023 15:06:34 +0530 Subject: [PATCH 2/5] add cypress events API for site-primary page --- .../sitetype-primary.cy.js | 31 +++++++++++++++++++ .../sitetype-primary.cy.js | 31 +++++++++++++++++++ .../wp-module-support/EventsApi.cy.js | 19 +++++++++++- 3 files changed, 80 insertions(+), 1 deletion(-) diff --git a/tests/cypress/integration/2-general-onboarding-flow/sitetype-primary.cy.js b/tests/cypress/integration/2-general-onboarding-flow/sitetype-primary.cy.js index 0586f895b..72b24062b 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/sitetype-primary.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/sitetype-primary.cy.js @@ -1,4 +1,5 @@ // +import { APIList, EventsAPI } from '../wp-module-support/EventsApi.cy'; import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; import { @@ -31,6 +32,36 @@ describe( 'Get Started Site Type Primary', function () { CheckHelpPanelLinks(); } ); + it( 'Check for Event API call being made when different categories are selected', ()=>{ + let categoryCount = 0; + let num = 0; + const className = '.nfd-card-pri-category'; + cy.get( className ).should( 'be.visible' ); + const arr = cy.get( className ); + arr.each( () => { + cy.get( className ) + .eq( categoryCount ) + .click() + .then(($element) => { + const dataSlugText = $element.attr('data-slug'); + if(num>=2){ + cy.wait(4000); + } + EventsAPI('primary_type', dataSlugText, APIList.site_primary); + num+=1; + }); + categoryCount += 1; + } ); + } ); + + it( 'Check for Event API call when we enter text in input box', ()=>{ + cy.get( '.nfd-setup-primary-custom__tellus-input' ) + .scrollIntoView() + .should( 'be.visible' ) + .type( 'Test' ); + EventsAPI('primary_type', 'Test', APIList.site_primary); + } ); + it( 'Check different Categories exist and is selectable', () => { let categoryCount = 0; const className = '.nfd-card-pri-category'; diff --git a/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-primary.cy.js b/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-primary.cy.js index c68040672..d6e58d4f0 100644 --- a/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-primary.cy.js +++ b/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-primary.cy.js @@ -1,4 +1,5 @@ // +import { APIList, EventsAPI } from '../wp-module-support/EventsApi.cy'; import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; import { @@ -43,6 +44,36 @@ describe( 'Get Started Site Type Primary', function () { .should( 'have.text', 'Business' ); } ); + it( 'Check for Event API call being made when different categories are selected', ()=>{ + let categoryCount = 0; + let num = 0; + const className = '.nfd-card-pri-category'; + cy.get( className ).should( 'be.visible' ); + const arr = cy.get( className ); + arr.each( () => { + cy.get( className ) + .eq( categoryCount ) + .click() + .then(($element) => { + const dataSlugText = $element.attr('data-slug'); + if(num>=2){ + cy.wait(4000); + } + EventsAPI('primary_type', dataSlugText, APIList.site_primary_ecomm); + num+=1; + }); + categoryCount += 1; + } ); + } ); + + it( 'Check for Event API call when we enter text in input box', ()=>{ + cy.get( '.nfd-setup-primary-custom__tellus-input' ) + .scrollIntoView() + .should( 'be.visible' ) + .type( 'Test' ); + EventsAPI('primary_type', 'Test', APIList.site_primary_ecomm); + } ); + it( 'Check different Categories exist and is selectable', () => { let categoryCount = 0; const className = '.nfd-card-pri-category'; diff --git a/tests/cypress/integration/wp-module-support/EventsApi.cy.js b/tests/cypress/integration/wp-module-support/EventsApi.cy.js index 3a6af17f9..a5c3cd53e 100644 --- a/tests/cypress/integration/wp-module-support/EventsApi.cy.js +++ b/tests/cypress/integration/wp-module-support/EventsApi.cy.js @@ -1,7 +1,9 @@ export const APIList = { 'get_started_experience' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', 'get_started_experience_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user', - 'top_priority' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user' + 'top_priority' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', + 'site_primary' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', + 'site_primary_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user' } export const EventsAPI = ( events_name, card_val, api_name ) => { @@ -37,5 +39,20 @@ export const EventsAPI = ( events_name, card_val, api_name ) => { } } }; + + if(events_name == 'primary_type'){ + if ( events_name in responseData1 ) { + expect( responseData1.primary_type ).equal( + card_val + ); + } else { + const responseData2 = responseBody[ 1 ].data; + if ( events_name in responseData2 ) { + expect( responseData2.primary_type ).equal( + card_val + ); + } + } + }; }); }; From ac34916a344942390729d93b6c16911919e09ba8 Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Tue, 31 Oct 2023 15:12:11 +0530 Subject: [PATCH 3/5] Initial commit --- .../sitetype-secondary.cy.js | 36 +++++++++++++++++-- .../sitetype-secondary.cy.js | 31 ++++++++++++++++ .../wp-module-support/EventsApi.cy.js | 22 ++++++++++-- 3 files changed, 85 insertions(+), 4 deletions(-) diff --git a/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js b/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js index 2cbad8dd1..66e882a7e 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js @@ -1,4 +1,5 @@ // +import { APIList, EventsAPI } from '../wp-module-support/EventsApi.cy'; import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; import { @@ -31,10 +32,41 @@ describe( 'Get Started Site Type Secondary', function () { CheckHelpPanelLinks(); } ); + it( 'Check for Event API call being made when different sub-categories are selected', ()=>{ + let SubcategoryCount = 0; + let num = 0; + const className = '.nfd-card-sec-category'; + cy.get( className ).should( 'be.visible' ); + const arr = cy.get( className ); + arr.each( () => { + cy.get( className ) + .eq( SubcategoryCount ) + .click() + .then(($element) => { + const dataSlugText = $element.attr('data-slug'); + if(num>=2){ + cy.wait(4000); + } + EventsAPI('secondary_type', dataSlugText, APIList.site_secondary); + num+=1; + }); + SubcategoryCount += 1; + } ); + } ); + + it( 'Check for Event API call when we enter text in input box', ()=>{ + cy.get( '.nfd-setup-primary-custom__tellus-input' ) + .scrollIntoView() + .should( 'be.visible' ) + .type( 'Test' ); + EventsAPI('secondary_type', 'Test', APIList.site_secondary); + } ); + it( 'Check different categories exist using `<` and `>`', () => { cy.get( '.nfd-setup-secondary-categories' ).should( 'be.visible' ); const category_selected = cy.get('.category-scrolling-wrapper__type-text'); cy.get( '.category-scrolling-wrapper__left-btn' ) + .scrollIntoView() .should('be.visible') .click(); cy.get( '.category-scrolling-wrapper__type-text' ).should('not.contain', category_selected); @@ -106,7 +138,7 @@ describe( 'Get Started Site Type Secondary', function () { cy.get( '.navigation-buttons_back' ).click(); } ); - it.skip( 'Go to the previous step on clicking navigation Back', () => { + it( 'Go to the previous step on clicking navigation Back', () => { cy.get( '.navigation-buttons_back' ).click(); cy.url().should( 'not.include', @@ -115,7 +147,7 @@ describe( 'Get Started Site Type Secondary', function () { cy.get( '.navigation-buttons_next' ).click(); } ); - it.skip( 'Go to next step on Continue Setup', () => { + it( 'Go to next step on Continue Setup', () => { cy.get( '.nfd-nav-card-button' ).click(); cy.url().should( 'not.include', diff --git a/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js b/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js index 06dc5b45f..9fa35402c 100644 --- a/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js +++ b/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js @@ -1,4 +1,5 @@ // +import { APIList, EventsAPI } from '../wp-module-support/EventsApi.cy'; import { CheckDrawerDisabled } from '../wp-module-support/drawer.cy'; import { CheckCardHeadingSubheading } from '../wp-module-support/header.cy'; import { @@ -45,6 +46,36 @@ describe( 'Get Started Site Type Secondary', function () { ); } ); + it( 'Check for Event API call being made when different sub-categories are selected', ()=>{ + let SubcategoryCount = 0; + let num = 0; + const className = '.nfd-card-sec-category'; + cy.get( className ).should( 'be.visible' ); + const arr = cy.get( className ); + arr.each( () => { + cy.get( className ) + .eq( SubcategoryCount ) + .click() + .then(($element) => { + const dataSlugText = $element.attr('data-slug'); + if(num>=2){ + cy.wait(4000); + } + EventsAPI('secondary_type', dataSlugText, APIList.site_secondary_ecomm); + num+=1; + }); + SubcategoryCount += 1; + } ); + } ); + + it( 'Check for Event API call when we enter text in input box', ()=>{ + cy.get( '.nfd-setup-primary-custom__tellus-input' ) + .scrollIntoView() + .should( 'be.visible' ) + .type( 'Test' ); + EventsAPI('secondary_type', 'Test', APIList.site_secondary_ecomm); + } ); + it( 'Check different subCategories exist and is selectable', () => { let categoryCount = 0; const className = '.subCategoriesSection'; diff --git a/tests/cypress/integration/wp-module-support/EventsApi.cy.js b/tests/cypress/integration/wp-module-support/EventsApi.cy.js index a5c3cd53e..b8b8cdb74 100644 --- a/tests/cypress/integration/wp-module-support/EventsApi.cy.js +++ b/tests/cypress/integration/wp-module-support/EventsApi.cy.js @@ -3,7 +3,9 @@ export const APIList = { 'get_started_experience_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user', 'top_priority' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', 'site_primary' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', - 'site_primary_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user' + 'site_primary_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user', + 'site_secondary' : 'http://localhost:10028/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', + 'site_secondary_ecomm' : 'http://localhost:10028/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user' } export const EventsAPI = ( events_name, card_val, api_name ) => { @@ -54,5 +56,21 @@ export const EventsAPI = ( events_name, card_val, api_name ) => { } } }; - }); + + + if(events_name == 'secondary_type'){ + if ( events_name in responseData1 ) { + expect( responseData1.secondary_type ).equal( + card_val + ); + } else { + const responseData2 = responseBody[ 1 ].data; + if ( events_name in responseData2 ) { + expect( responseData2.secondary_type ).equal( + card_val + ); + } + } + }; +}); }; From 57fe9f4450da198bc6cc955b201f538dcf41026b Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Tue, 31 Oct 2023 15:33:48 +0530 Subject: [PATCH 4/5] update ecom events with extra wait time --- .../3-ecommerce-onboarding-flow/sitetype-secondary.cy.js | 6 +++--- tests/cypress/integration/wp-module-support/EventsApi.cy.js | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js b/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js index 9fa35402c..b5236fd34 100644 --- a/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js +++ b/tests/cypress/integration/3-ecommerce-onboarding-flow/sitetype-secondary.cy.js @@ -59,7 +59,7 @@ describe( 'Get Started Site Type Secondary', function () { .then(($element) => { const dataSlugText = $element.attr('data-slug'); if(num>=2){ - cy.wait(4000); + cy.wait(5000); } EventsAPI('secondary_type', dataSlugText, APIList.site_secondary_ecomm); num+=1; @@ -137,7 +137,7 @@ describe( 'Get Started Site Type Secondary', function () { cy.get( '.navigation-buttons_back' ).click(); } ); - it.skip( 'Go to the previous step on clicking navigation Back', () => { + it( 'Go to the previous step on clicking navigation Back', () => { cy.get( '.navigation-buttons_back' ).click(); cy.url().should( 'not.include', @@ -146,7 +146,7 @@ describe( 'Get Started Site Type Secondary', function () { cy.get( '.navigation-buttons_next' ).click(); } ); - it.skip( 'Go to next step on Continue Setup', () => { + it( 'Go to next step on Continue Setup', () => { cy.get( '.nfd-nav-card-button' ).click(); cy.url().should( 'not.include', diff --git a/tests/cypress/integration/wp-module-support/EventsApi.cy.js b/tests/cypress/integration/wp-module-support/EventsApi.cy.js index b8b8cdb74..4f4ca54af 100644 --- a/tests/cypress/integration/wp-module-support/EventsApi.cy.js +++ b/tests/cypress/integration/wp-module-support/EventsApi.cy.js @@ -4,8 +4,8 @@ export const APIList = { 'top_priority' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', 'site_primary' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', 'site_primary_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user', - 'site_secondary' : 'http://localhost:10028/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', - 'site_secondary_ecomm' : 'http://localhost:10028/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user' + 'site_secondary' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', + 'site_secondary_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user' } export const EventsAPI = ( events_name, card_val, api_name ) => { From 5bb431b7cc15ed5cb59e0d2aa6006ea58e7e5e75 Mon Sep 17 00:00:00 2001 From: Avneet Raj Date: Mon, 6 Nov 2023 17:00:47 +0530 Subject: [PATCH 5/5] Updating the API URLs with regex exp. --- .../sitetype-secondary.cy.js | 2 +- .../integration/wp-module-support/EventsApi.cy.js | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js b/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js index 66e882a7e..2489b518a 100644 --- a/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js +++ b/tests/cypress/integration/2-general-onboarding-flow/sitetype-secondary.cy.js @@ -45,7 +45,7 @@ describe( 'Get Started Site Type Secondary', function () { .then(($element) => { const dataSlugText = $element.attr('data-slug'); if(num>=2){ - cy.wait(4000); + cy.wait(5000); } EventsAPI('secondary_type', dataSlugText, APIList.site_secondary); num+=1; diff --git a/tests/cypress/integration/wp-module-support/EventsApi.cy.js b/tests/cypress/integration/wp-module-support/EventsApi.cy.js index 4f4ca54af..04cccbeb0 100644 --- a/tests/cypress/integration/wp-module-support/EventsApi.cy.js +++ b/tests/cypress/integration/wp-module-support/EventsApi.cy.js @@ -1,11 +1,11 @@ export const APIList = { - 'get_started_experience' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', - 'get_started_experience_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user', - 'top_priority' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', - 'site_primary' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', - 'site_primary_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user', - 'site_secondary' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', - 'site_secondary_ecomm' : 'http://localhost:8882/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user' + 'get_started_experience' : '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', + 'get_started_experience_ecomm' : '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user', + 'top_priority' : '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', + 'site_primary' : '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', + 'site_primary_ecomm' : '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user', + 'site_secondary' : '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=wp-setup&_locale=user', + 'site_secondary_ecomm' : '/index.php?rest_route=%2Fnewfold-onboarding%2Fv1%2Fevents%2Fbatch&flow=ecommerce&_locale=user' } export const EventsAPI = ( events_name, card_val, api_name ) => {