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

Enable editor step tests #601

Merged
merged 16 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from 9 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 @@ -50,7 +50,7 @@ describe( 'SiteGen Site Details Step', function () {
cy.get( '.nfd-sg-input-box__hint' ).should( 'be.visible' );
});

it.skip( 'Check for back button and go back', () => {
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 @@ -44,7 +44,7 @@ describe( 'SiteGen Site Logo Step', function () {
ProgressBarCheck( '33.3333%' );
} );

it.skip( 'Check for back button and go back', () => {
it( 'Check for back button and go back', () => {
BackButtonCheck( 'sitegen/step/site-logo' );
} );

Expand Down Expand Up @@ -96,4 +96,11 @@ describe( 'SiteGen Site Logo Step', function () {
.click();
cy.url().should( 'not.contain', 'sitegen/step/site-logo' );
} );

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' );
} )
officiallygod marked this conversation as resolved.
Show resolved Hide resolved
} );
officiallygod marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ describe( 'SiteGen Site Preview Step', function () {
.should( 'have.length', 3 );
} );

it.skip( 'Check for the favourited theme versions', () => {
it( 'Check for the favourited theme versions', () => {
cy.get( 'g[clip-path="url(#heart-filled_svg__a)"]' ).should(
'not.exist'
); // when no fav theme is selected
Expand Down Expand Up @@ -80,7 +80,7 @@ describe( 'SiteGen Site Preview Step', function () {
cy.get( '@fav' ).click();
} );

it.skip( 'Check for regenerating the new theme versions', () => {
it( 'Check for regenerating the new theme versions', () => {
cy.intercept( apiList.homepagesRegenerate, ( req ) => {
homePagesRegenerate( req );
officiallygod marked this conversation as resolved.
Show resolved Hide resolved
}).as('regenerate');
Expand All @@ -96,7 +96,7 @@ describe( 'SiteGen Site Preview Step', function () {
.should( 'have.length', 4 );
} );

it.skip( 'Check for the preview note at the bottom', () => {
it( 'Check for the preview note at the bottom', () => {
cy.get( '.nfd-onboarding-step--site-gen__preview__note' )
.scrollIntoView()
.should( 'be.visible' );
Expand All @@ -106,7 +106,7 @@ describe( 'SiteGen Site Preview Step', function () {
.contains( 'Favorite' );
officiallygod marked this conversation as resolved.
Show resolved Hide resolved
} );

it.skip( 'Select any theme and go forward to the next step', () => {
it( 'Select any theme and go forward to the next step', () => {
cy.get(
'.live-preview-sitegen--selectable-card__live-preview-container__overlay',
{ timeout: 10000 }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import {
} from '../wp-module-support/MockApi.cy';
import {
AdminBarCheck,
DarkBGCheck,
LightBGCheck,
ProgressBarCheck,
} from '../wp-module-support/siteGen.cy';
import { getAppId } from '../wp-module-support/pluginID.cy';

describe.skip( 'SiteGen Site Editor Step', function () {
describe( 'SiteGen Site Editor Step', function () {
before( () => {
cy.visit(
'wp-admin/index.php?page=nfd-onboarding#/sitegen/step/preview'
Expand All @@ -34,19 +35,19 @@ describe.skip( 'SiteGen Site Editor Step', function () {
AdminBarCheck();
} );

it( 'Check for the existing dark background', () => {
DarkBGCheck();
it( 'Check for the existing light background', () => {
LightBGCheck();
} );

it( 'Check if we cannot change to light background', () => {
cy.get( '.nfd-onboarding-toggle__theme__button__dark' ).should(
it( 'Check if we cannot change to dark background', () => {
cy.get( '.nfd-onboarding-toggle__theme__button__light' ).should(
'not.exist'
);
cy.get( '.nfd-onboarding-sitegen-light' ).should( 'not.exist' );
cy.get( '.nfd-onboarding-sitegen-dark' ).should( 'not.exist' );
} );

it( 'Check the Progress Bar Value', () => {
ProgressBarCheck( '85.7143%' );
ProgressBarCheck( '83.3333%' );
} );

it( 'Check if the sidebar is closed upon landing', () => {
Expand Down Expand Up @@ -103,7 +104,7 @@ describe.skip( 'SiteGen Site Editor Step', function () {
'.nfd-onboarding-sidebar--sitegen-editor-patterns__header__tab-panel__versions-tab__preview-container'
)
.should( 'be.visible' )
.should( 'have.length', 3 ); // as we are not regenrating new themes
.should( 'have.length', 4 ); // Regenrating new themes
officiallygod marked this conversation as resolved.
Show resolved Hide resolved
} );

it( 'Check for favoriting a theme and it appears everywhere', () => {
Expand Down Expand Up @@ -153,12 +154,6 @@ describe.skip( 'SiteGen Site Editor Step', function () {
.should( 'be.visible' );
} );

it( 'Check existence of Save & Continue button', () => {
cy.get( '.nfd-onboarding-header--sitegen__editor__end__save-button' )
.scrollIntoView()
.should( 'exist' );
} );

it( 'Check changing the existing fonts from sidebar', () => {
cy.intercept( apiList.themestyle, ( req ) => {
themeStyleMock( req );
Expand Down Expand Up @@ -282,4 +277,11 @@ describe.skip( '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 } )
officiallygod marked this conversation as resolved.
Show resolved Hide resolved

} );
} );
4 changes: 4 additions & 0 deletions tests/cypress/integration/wp-module-support/pluginID.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ export const GetPluginName = () => {
cy.get( '.nfd-step-card-subheading', {timeout:20000} ).should( 'contain', 'Crazy Domains');
};
}

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