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 all 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
18 changes: 9 additions & 9 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,28 +30,26 @@ 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;
const className = '.color-palette ';
const arr = cy.get( className );

arr.each( () => {
cy.get( className ).eq( previewCount ).click();
cy.get( className , { timeout:15000 }).eq( previewCount ).click();
cy.get( '.color-palette-selected' )
.scrollIntoView()
.should( 'be.visible' );
Expand All @@ -59,7 +59,7 @@ describe( 'Colors Step Test', function () {

it( 'Check for Custom Colors', () => {
// Opens Custom Palette
cy.get( '.custom-palette__top' ).scrollIntoView().click();
cy.get( '.custom-palette__top' , { timeout:15000 }).scrollIntoView().click();

let previewCount = 0;
const className = '.custom-palette__below__row';
Expand Down
12 changes: 6 additions & 6 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 @@ -27,31 +29,29 @@ describe( 'Header menu Page', function () {
} );

it( 'Check to make sure design button is visble', () => {
cy.contains( 'button', 'Design' ).should( 'be.visible' );
cy.contains( 'button', 'Design' , { timeout:15000 }).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
23 changes: 12 additions & 11 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,24 +33,23 @@ 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;
const className = '.homepage_preview__list__item';
const arr = cy.get( className );
const arr = cy.get( className, { timeout:15000 } );

arr.each( () => {
cy.get( className ).eq( previewCount ).click();
Expand Down
Loading
Loading