Skip to content

Commit

Permalink
lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeetha-nayak committed Jul 26, 2024
1 parent c06ca7c commit 70e3e4c
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ describe( 'SiteGen Site Details Step', function () {
'Bean There Café - A cozy, sustainable coffee shop in Asheville, North Carolina, focused on fair-trade coffee and local pastries. Their site will feature their menu, special events, and a blog on coffee culture.'
);
cy.get( '.nfd-sg-input-box__hint' ).should( 'be.visible' );
});
} );

it( 'Check for back button and go back', () => {
BackButtonCheck( 'sitegen/step/site-details' );
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,19 @@ describe( 'SiteGen Site Logo Step', function () {
it( 'Check if the Next Button is disabled when there is no logo', () => {
DisabledNextButton();
} );

it('Verify Skip for now and go to next step', () => {
cy.get( '.nfd-onboarding-step--site-gen__site-logo__container__buttons__skip' )

it( 'Verify Skip for now and go to next step', () => {
cy.get(
'.nfd-onboarding-step--site-gen__site-logo__container__buttons__skip'
)
.should( 'not.be.disabled' )
.click();
cy.url().should( 'not.contain', 'sitegen/step/site-logo' );
// go back to site-logo step
cy.go( 'back' )
cy.get( '.nfd-onboarding-step--site-gen__site-logo__container' , { timeout: 10000 } )
.should( 'be.visible' )
cy.go( 'back' );
cy.get( '.nfd-onboarding-step--site-gen__site-logo__container', {
timeout: 10000,
} ).should( 'be.visible' );
} );

it.skip( 'Check if Image gets uploaded', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ describe( 'SiteGen Experience & Site Building Step', function () {
3
);
} );

it( 'Check if Back button is not visible' , () => {
cy.get( '.nfd-onboarding-button--dark' , { timeout : 20000 } ).should( 'not.exist' )
} )

it( 'Check if Back button is not visible', () => {
cy.get( '.nfd-onboarding-button--dark', { timeout: 20000 } ).should(
'not.exist'
);
} );

it( 'Check each experience cards', () => {
const className = '.nfd__option_heading_subheading__wrapper';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ describe( 'SiteGen Site Preview Step', function () {
it( 'Check the Progress Bar Value', () => {
ProgressBarCheck( '60%' );
} );
it( 'Check if Back button is not visible' , () => {
cy.get( '.nfd-onboarding-button--dark' ).should( 'not.exist' )

it( 'Check if Back button is not visible', () => {
cy.get( '.nfd-onboarding-button--dark' ).should( 'not.exist' );
} );

it( 'Check for by default 3 versions should be there', () => {
Expand All @@ -60,12 +60,12 @@ describe( 'SiteGen Site Preview Step', function () {
); // when no fav theme is selected
cy.get(
'.live-preview-sitegen--selectable-card__live-preview-container-buttons__button',
{ timeout : 20000 }
{ timeout: 20000 }
)
.eq( 0 )
.as( 'fav' )
.scrollIntoView()
.wait(2000)
.wait( 2000 )
.should( 'be.visible' )
.click();
cy.get( 'g[clip-path="url(#heart-filled_svg__a)"]', {
Expand All @@ -87,14 +87,14 @@ describe( 'SiteGen Site Preview Step', function () {
it( 'Check for regenerating the new theme versions', () => {
cy.intercept( apiList.homepagesRegenerate, ( req ) => {
homePagesRegenerate( req );
}).as('regenerate');
} ).as( 'regenerate' );

cy.get( '[aria-label="Regenerate Content"]', { timeout: 60000 } )
.eq(0)
.eq( 0 )
.scrollIntoView()
.wait( 2000 )
.click({ force: true });
cy.wait('@regenerate', {timeout: 60000})
.click( { force: true } );
cy.wait( '@regenerate', { timeout: 60000 } );
cy.get( '.live-preview-sitegen--selectable-card', { timeout: 20000 } )
.should( 'be.visible' )
.should( 'have.length', 4 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,11 @@ describe( 'SiteGen Site Editor Step', function () {

it( 'Check for favorite themes inside favorite tab', () => {
cy.get(
'.nfd-onboarding-sidebar--sitegen-editor-patterns__header__tab-panel__favorites-tab', {
timeout: 10000
} )
'.nfd-onboarding-sidebar--sitegen-editor-patterns__header__tab-panel__favorites-tab',
{
timeout: 10000,
}
)
.scrollIntoView()
.should( 'be.visible' )
.click();
Expand All @@ -155,7 +157,7 @@ describe( 'SiteGen Site Editor Step', function () {
} );

it( 'Check if Back button is not visible', () => {
cy.get( '.nfd-onboarding-button--dark' ).should( 'not.exist' )
cy.get( '.nfd-onboarding-button--dark' ).should( 'not.exist' );
} );

it( 'Check changing the existing fonts from sidebar', () => {
Expand Down Expand Up @@ -281,11 +283,12 @@ describe( 'SiteGen Site Editor Step', function () {
'.nfd-onboarding-sidebar--customize__design-colors-panel__custom__colors__container'
).should( 'not.exist' );
} );

it( 'Check Save & Continue button functionality', () => {
cy.get('.nfd-onboarding-header--sitegen__editor__end__save-button__text', { timeout : 20000 } )
.click();
cy.get(`.${getAppId()}-app-container`, { timeout : 90000 } )

cy.get(
'.nfd-onboarding-header--sitegen__editor__end__save-button__text',
{ timeout: 20000 }
).click();
cy.get( `.${ getAppId() }-app-container`, { timeout: 90000 } );
} );
} );
37 changes: 23 additions & 14 deletions tests/cypress/integration/wp-module-support/pluginID.cy.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,29 @@
// <reference types="Cypress" />
export const GetPluginId = () => {
return Cypress.env('pluginId');
}
return Cypress.env( 'pluginId' );
};

export const GetPluginName = () => {
if(GetPluginId()=='bluehost'){
cy.get( '.nfd-step-card-subheading', {timeout:20000} ).should( 'contain', 'Bluehost');
};
if(GetPluginId()=='hostgator'){
cy.get( '.nfd-step-card-subheading', {timeout:20000} ).should( 'contain', 'HostGator');
};
if(GetPluginId()=='crazy-domains'){
cy.get( '.nfd-step-card-subheading', {timeout:20000} ).should( 'contain', 'Crazy Domains');
};
}
if ( GetPluginId() == 'bluehost' ) {
cy.get( '.nfd-step-card-subheading', { timeout: 20000 } ).should(
'contain',
'Bluehost'
);
}
if ( GetPluginId() == 'hostgator' ) {
cy.get( '.nfd-step-card-subheading', { timeout: 20000 } ).should(
'contain',
'HostGator'
);
}
if ( GetPluginId() == 'crazy-domains' ) {
cy.get( '.nfd-step-card-subheading', { timeout: 20000 } ).should(
'contain',
'Crazy Domains'
);
}
};

export const getAppId = () => {
return Cypress.env('appId')
}
return Cypress.env( 'appId' );
};

0 comments on commit 70e3e4c

Please sign in to comment.