Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIY Onboarding tests fix on 2.3.0 version bump PR #557

Merged
merged 3 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,64 +27,75 @@ describe( 'Get Started Site Type Secondary', function () {
CheckCardHeadingSubheading( true );
} );

if(GetPluginId()=='bluehost'){
if ( GetPluginId() == 'bluehost' ) {
it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => {
CheckIntroPanel( '__get-started-site-type', 'Site Type' );
CheckIllustrationPanel();
CheckInfoPanel();
CheckHelpPanelLinks();
} );
}
else{
} else {
it( 'Check to make sure Sidebar opens', () => {
BasicSidebarCheck();
} )
};
} );
}

it( 'Check for Event API call being made when different sub-categories are selected', ()=>{
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' );
cy.get( className ).should( 'be.visible', { timeout: 10000 } );
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(5000);
.then( ( $element ) => {
const dataSlugText = $element.attr( 'data-slug' );
if ( num >= 2 ) {
cy.wait( 5000 );
}
EventsAPI('secondary_type', dataSlugText, APIList.events_api_general_onb);
num+=1;
});
EventsAPI(
'secondary_type',
dataSlugText,
APIList.events_api_general_onb
);
num += 1;
} );
SubcategoryCount += 1;
} );
} );

it( 'Check for Event API call when we enter text in input box', ()=>{
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.events_api_general_onb);
EventsAPI( 'secondary_type', 'Test', APIList.events_api_general_onb );
} );

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');
const category_selected = cy.get(
'.category-scrolling-wrapper__type-text'
);
cy.get( '.category-scrolling-wrapper__left-btn' )
.scrollIntoView()
.should('be.visible')
.should( 'be.visible' )
.click();
cy.get( '.category-scrolling-wrapper__type-text' ).should('not.contain', category_selected);
cy.get( '.category-scrolling-wrapper__type-text' ).should(
'not.contain',
category_selected
);
cy.reload();
cy.get('.category-scrolling-wrapper__right-btn-icon')
.should('be.visible')
cy.get( '.category-scrolling-wrapper__right-btn-icon' )
.should( 'be.visible' )
.click();
cy.get( '.category-scrolling-wrapper__type-text' ).should('not.contain', category_selected);
});
cy.get( '.category-scrolling-wrapper__type-text' ).should(
'not.contain',
category_selected
);
} );

it( 'Check different subCategories exist and is selectable', () => {
let categoryCount = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ describe( 'Get Started Site Type Secondary', function () {
CheckCardHeadingSubheading( true );
} );

if(GetPluginId()=='bluehost'){
if ( GetPluginId() == 'bluehost' ) {
it( 'Check if `store` appears in heading', () => {
cy.get('.nfd-step-card-heading')
.should('be.visible')
.contains('store');
cy.get( '.nfd-step-card-heading' )
.should( 'be.visible' )
.contains( 'store' );
} );

it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => {
CheckIntroPanel( '__get-started-site-type', 'Store Type' );
CheckIllustrationPanel();
Expand All @@ -48,14 +48,13 @@ describe( 'Get Started Site Type Secondary', function () {
'Business'
);
} );
}
else{
} else {
it( 'Check to make sure Sidebar opens', () => {
BasicSidebarCheck();
} );
};
}

it( 'Check for Event API call being made when different sub-categories are selected', ()=>{
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';
Expand All @@ -65,24 +64,28 @@ describe( 'Get Started Site Type Secondary', function () {
cy.get( className )
.eq( SubcategoryCount )
.click()
.then(($element) => {
const dataSlugText = $element.attr('data-slug');
if(num>=2){
cy.wait(5000);
.then( ( $element ) => {
const dataSlugText = $element.attr( 'data-slug' );
if ( num >= 2 ) {
cy.wait( 5000 );
}
EventsAPI('secondary_type', dataSlugText, APIList.events_api_ecomm);
num+=1;
});
EventsAPI(
'secondary_type',
dataSlugText,
APIList.events_api_ecomm
);
num += 1;
} );
SubcategoryCount += 1;
} );
} );

it( 'Check for Event API call when we enter text in input box', ()=>{
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.events_api_ecomm);
EventsAPI( 'secondary_type', 'Test', APIList.events_api_ecomm );
} );

it( 'Check different subCategories exist and is selectable', () => {
Expand Down
14 changes: 7 additions & 7 deletions tests/cypress/integration/4-design-steps/colors-step.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ import {
CheckIllustrationPanel,
CheckInfoPanel,
CheckIntroPanel,
continueSetup,
} from '../wp-module-support/sidebar.cy';

describe( 'Colors Step Test', function () {
before( () => {
cy.exec('npx wp-env run cli wp theme activate yith-wonder');
cy.wait(5000);
cy.wait( 5000 );
cy.visit(
'wp-admin/?page=nfd-onboarding#/wp-setup/step/design/colors'
);
cy.wait(6000);
cy.wait( 5000 );
continueSetup();
} );

it( 'Check Drawer Activity', () => {
Expand All @@ -28,20 +30,18 @@ describe( 'Colors Step Test', function () {
);
} );

if(GetPluginId()=='bluehost'){
if ( GetPluginId() == 'bluehost' ) {
it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => {
CheckIntroPanel( '__design-colors', 'Colors' );
CheckIllustrationPanel();
CheckInfoPanel();
CheckHelpPanelLinks();
} );
}
else{
} else {
it( 'Check to make sure Sidebar opens', () => {
BasicSidebarCheck();
} );
};

}

it( 'Check if Default Color variations exists and are selectable', () => {
let previewCount = 0;
Expand Down
10 changes: 5 additions & 5 deletions tests/cypress/integration/4-design-steps/header-menu.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
CheckIllustrationPanel,
CheckInfoPanel,
CheckIntroPanel,
continueSetup,
} from '../wp-module-support/sidebar.cy';

describe( 'Header menu Page', function () {
Expand All @@ -15,6 +16,7 @@ describe( 'Header menu Page', function () {
'wp-admin/?page=nfd-onboarding#/wp-setup/step/design/header-menu'
);
cy.wait( 10000 );
continueSetup();
} );

it( 'Check Drawer Activity', () => {
Expand All @@ -30,28 +32,26 @@ describe( 'Header menu Page', function () {
cy.contains( 'button', 'Design' ).should( 'be.visible' );
} );

if(GetPluginId()=='bluehost'){
if ( GetPluginId() == 'bluehost' ) {
it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => {
CheckIntroPanel( '__design-header-menu', 'Header & Menu' );
CheckIllustrationPanel();
CheckInfoPanel( 2 );
CheckHelpPanelLinks();
} );
}
else{
} else {
it( 'Check to make sure Sidebar opens', () => {
BasicSidebarCheck();
} );
}


it( 'Check to make sure different design is selected', () => {
let previewCount = 0;
const classname = '.theme-header-menu-preview--drawer__list__item';
const arr = cy.get( classname );
arr.each( () => {
cy.get( classname ).eq( previewCount ).click();
cy.wait(3000);
cy.wait( 3000 );
cy.get( classname )
.eq( previewCount )
.find( classname.concat( '__title-bar--selected' ) )
Expand Down
21 changes: 11 additions & 10 deletions tests/cypress/integration/4-design-steps/homepage-styles.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
CheckIllustrationPanel,
CheckInfoPanel,
CheckIntroPanel,
continueSetup,
} from '../wp-module-support/sidebar.cy';

describe( 'Homepage Styles Page', function () {
Expand All @@ -17,6 +18,7 @@ describe( 'Homepage Styles Page', function () {
'wp-admin/?page=nfd-onboarding#/wp-setup/step/design/homepage-menu'
);
cy.wait( 15000 );
continueSetup();
} );

it( 'Check if Header and Subheader shows up', () => {
Expand All @@ -31,19 +33,18 @@ describe( 'Homepage Styles Page', function () {
);
} );

if(GetPluginId()=='bluehost'){
it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => {
CheckIntroPanel( '__design-homepage', 'Home Page' );
CheckIllustrationPanel();
CheckInfoPanel( 2 );
CheckHelpPanelLinks();
} );
}
else{
if ( GetPluginId() == 'bluehost' ) {
it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => {
CheckIntroPanel( '__design-homepage', 'Home Page' );
CheckIllustrationPanel();
CheckInfoPanel( 2 );
CheckHelpPanelLinks();
} );
} else {
it( 'Check to make sure Sidebar opens', () => {
BasicSidebarCheck();
} );
};
}

it( 'Check if Homepage Styles exist and are selectable', () => {
let previewCount = 0;
Expand Down
27 changes: 12 additions & 15 deletions tests/cypress/integration/4-design-steps/site-pages.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
CheckIllustrationPanel,
CheckInfoPanel,
CheckIntroPanel,
continueSetup,
} from '../wp-module-support/sidebar.cy';

describe( 'Site Pages', function () {
Expand All @@ -16,29 +17,25 @@ describe( 'Site Pages', function () {
'wp-admin/?page=nfd-onboarding#/wp-setup/step/design/site-pages'
);
cy.wait( 10000 );
continueSetup();
} );

it( 'Check if Header and Subheader shows up', () => {
CheckHeadingSubheading();
} );

it( 'Check Drawer Activity', () => {
DrawerActivityForMenu(
'Onboarding',
':nth-child(6)',
'Page Layouts'
);
DrawerActivityForMenu( 'Onboarding', ':nth-child(6)', 'Page Layouts' );
} );

if(GetPluginId()=='bluehost'){
it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => {
CheckIntroPanel( '__site-pages', 'Pages' );
CheckIllustrationPanel();
CheckInfoPanel();
CheckHelpPanelLinks();
} );
}
else{
if ( GetPluginId() == 'bluehost' ) {
it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => {
CheckIntroPanel( '__site-pages', 'Pages' );
CheckIllustrationPanel();
CheckInfoPanel();
CheckHelpPanelLinks();
} );
} else {
it( 'Check to make sure Sidebar opens', () => {
BasicSidebarCheck();
} );
Expand All @@ -55,7 +52,7 @@ describe( 'Site Pages', function () {
.scrollIntoView()
.find( '.components-checkbox-control' )
.find( 'label' )
.click({ force: true });
.click( { force: true } );
previewCount += 1;
} );
} );
Expand Down
Loading
Loading