-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #416 from newfold-labs/hotfix/fix-minor-bugs-2
Fix Minor Bugs 2
- Loading branch information
Showing
8 changed files
with
60 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 51 additions & 52 deletions
103
tests/cypress/integration/5-AI-SiteGen-onboarding-flow/site-logo.cy.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,69 @@ | ||
// <reference types="Cypress" /> | ||
|
||
import { AdminBarCheck, BackButtonCheck, DarkBGCheck, DisabledNextButton, LightBGChcek, ProgressBarCheck, SkipButtonCheck } from "../wp-module-support/siteGen.cy"; | ||
import { AdminBarCheck, BackButtonCheck, DarkBGCheck, DisabledNextButton, LightBGChcek, ProgressBarCheck, SkipButtonCheck } from '../wp-module-support/siteGen.cy'; | ||
|
||
describe( 'SiteGen Site Logo Step', function () { | ||
describe( 'SiteGen Site Logo Step', function() { | ||
before( () => { | ||
cy.visit( | ||
'wp-admin/?page=nfd-onboarding#/sitgen/step/site-logo' | ||
'wp-admin/?page=nfd-onboarding#/sitegen/step/site-logo' | ||
); | ||
} ); | ||
|
||
it( 'Check for the header admin bar', () => { | ||
AdminBarCheck(); | ||
} ); | ||
it( 'Check for the header admin bar', () => { | ||
AdminBarCheck(); | ||
} ); | ||
|
||
it( 'Check for the existing dark background', () => { | ||
it( 'Check for the existing dark background', () => { | ||
DarkBGCheck(); | ||
} ); | ||
|
||
it( 'Check for the light background', () => { | ||
LightBGChcek(); | ||
} ); | ||
|
||
it( 'Check the Progress Bar Value', () => { | ||
ProgressBarCheck('33.3333%'); | ||
}); | ||
it( 'Check for the light background', () => { | ||
LightBGChcek(); | ||
} ); | ||
|
||
it( 'Check for back button and go back', () => { | ||
BackButtonCheck('sitgen/step/site-logo'); | ||
} ); | ||
it( 'Check the Progress Bar Value', () => { | ||
ProgressBarCheck( '33.3333%' ); | ||
} ); | ||
|
||
it( 'Check if the heading is visible', () => { | ||
cy.get('.ai-heading').should('be.visible'); | ||
} ); | ||
it( 'Check for back button and go back', () => { | ||
BackButtonCheck( 'sitegen/step/site-logo' ); | ||
} ); | ||
|
||
it( 'Check for the skip button and click', () => { | ||
SkipButtonCheck('sitgen/step/site-logo'); | ||
} ); | ||
it( 'Check if the heading is visible', () => { | ||
cy.get( '.ai-heading' ).should( 'be.visible' ); | ||
} ); | ||
|
||
it( 'Check if the Next Button is disabled when there is no logo', () => { | ||
DisabledNextButton(); | ||
} ); | ||
it( 'Check for the skip button and click', () => { | ||
SkipButtonCheck( 'sitegen/step/site-logo' ); | ||
} ); | ||
|
||
it( 'Check if Image gets uploaded and Next button is enabled', () => { | ||
const sampleLogoPath = `vendor/newfold-labs/wp-module-onboarding/tests/cypress/fixtures/image.png`; | ||
const LogoPreviewClass = '.nfd-onboarding-image-uploader--with-text__site_logo__preview'; | ||
if( | ||
cy.get('.nfd-onboarding-button--site-gen-next--disabled') | ||
.should('be.visible') | ||
){ | ||
cy.get(LogoPreviewClass) | ||
.should('not.exist'); | ||
}; | ||
cy.get('input[type=file]', { timeout: 10000 }) | ||
.should('exist') | ||
.selectFile( sampleLogoPath , {force: true} ) | ||
.then( () => { | ||
cy.wait( 1000 ); | ||
cy.get(LogoPreviewClass, { timeout: 10000 } ).should( 'be.visible' ); | ||
cy.get( '.nfd-onboarding-image-uploader--with-text__site_logo__preview__reset__button' ) | ||
.scrollIntoView() | ||
.should( 'be.visible' ); | ||
} ); | ||
cy.get('.nfd-onboarding-button--site-gen-next') | ||
.should('not.be.disabled') | ||
.click(); | ||
cy.url().should('not.contain', 'sitgen/step/site-logo'); | ||
}); | ||
it( 'Check if the Next Button is disabled when there is no logo', () => { | ||
DisabledNextButton(); | ||
} ); | ||
|
||
}); | ||
it( 'Check if Image gets uploaded and Next button is enabled', () => { | ||
const sampleLogoPath = `vendor/newfold-labs/wp-module-onboarding/tests/cypress/fixtures/image.png`; | ||
const LogoPreviewClass = '.nfd-onboarding-image-uploader--with-text__site_logo__preview'; | ||
if ( | ||
cy.get( '.nfd-onboarding-button--site-gen-next--disabled' ) | ||
.should( 'be.visible' ) | ||
) { | ||
cy.get( LogoPreviewClass ) | ||
.should( 'not.exist' ); | ||
} | ||
cy.get( 'input[type=file]', { timeout: 10000 } ) | ||
.should( 'exist' ) | ||
.selectFile( sampleLogoPath, { force: true } ) | ||
.then( () => { | ||
cy.wait( 1000 ); | ||
cy.get( LogoPreviewClass, { timeout: 10000 } ).should( 'be.visible' ); | ||
cy.get( '.nfd-onboarding-image-uploader--with-text__site_logo__preview__reset__button' ) | ||
.scrollIntoView() | ||
.should( 'be.visible' ); | ||
} ); | ||
cy.get( '.nfd-onboarding-button--site-gen-next' ) | ||
.should( 'not.be.disabled' ) | ||
.click(); | ||
cy.url().should( 'not.contain', 'sitegen/step/site-logo' ); | ||
} ); | ||
} ); |