-
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.
- Loading branch information
1 parent
eac04bb
commit e7abce4
Showing
5 changed files
with
201 additions
and
165 deletions.
There are no files selected for viewing
22 changes: 16 additions & 6 deletions
22
tests/cypress/integration/5-AI-SiteGen-onboarding-flow/4-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
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
161 changes: 90 additions & 71 deletions
161
tests/cypress/integration/5-AI-SiteGen-onboarding-flow/6-preview.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,84 +1,103 @@ | ||
// <reference types="Cypress" /> | ||
|
||
import { AdminBarCheck, DarkBGCheck, LightBGCheck, ProgressBarCheck } from "../wp-module-support/siteGen.cy"; | ||
import { apiList } from "../wp-module-support/MockApi.cy"; | ||
import { | ||
AdminBarCheck, | ||
DarkBGCheck, | ||
LightBGCheck, | ||
ProgressBarCheck, | ||
} from '../wp-module-support/siteGen.cy'; | ||
|
||
describe( 'SiteGen Site Preview Step', function () { | ||
before( () => { | ||
cy.visit( | ||
'wp-admin/index.php?page=nfd-onboarding#/sitegen/step/preview' | ||
); | ||
cy.wait(5000); | ||
} ); | ||
before( () => { | ||
cy.visit( | ||
'wp-admin/index.php?page=nfd-onboarding#/sitegen/step/preview' | ||
); | ||
cy.wait( 5000 ); | ||
} ); | ||
|
||
it( 'Check for the header admin bar', () => { | ||
AdminBarCheck(); | ||
} ); | ||
it( 'Check for the header admin bar', () => { | ||
AdminBarCheck(); | ||
} ); | ||
|
||
it( 'Check for the existing dark background', () => { | ||
DarkBGCheck(); | ||
} ); | ||
it( 'Check for the existing dark background', () => { | ||
DarkBGCheck(); | ||
} ); | ||
|
||
it( 'Check for the light background', () => { | ||
LightBGCheck(); | ||
} ); | ||
it( 'Check for the light background', () => { | ||
LightBGCheck(); | ||
} ); | ||
|
||
it( 'Check the Progress Bar Value', () => { | ||
ProgressBarCheck('71.4286%'); | ||
}); | ||
it( 'Check the Progress Bar Value', () => { | ||
ProgressBarCheck( '71.4286%' ); | ||
} ); | ||
|
||
it( 'Check for by default 3 versions should be there', () => { | ||
cy.get('.live-preview-sitegen--selectable-card', {timeout:20000}) | ||
.should('be.visible') | ||
.should('have.length', 3); | ||
} ); | ||
it( 'Check for by default 3 versions should be there', () => { | ||
cy.get( '.live-preview-sitegen--selectable-card', { timeout: 20000 } ) | ||
.should( 'be.visible' ) | ||
.should( 'have.length', 3 ); | ||
} ); | ||
|
||
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 | ||
cy.get( '.live-preview-sitegen--selectable-card__live-preview-container-buttons__button__icon' ) | ||
.eq(0) | ||
.scrollIntoView() | ||
.should('be.visible') | ||
.click(); | ||
cy.get('g[clip-path="url(#heart-filled_svg__a)"]' , {timeout:20000} ) | ||
.should('exist'); | ||
cy.get('.live-preview-sitegen--selectable-card__live-preview-container__overlay') | ||
.eq(0) | ||
.scrollIntoView() | ||
.click(); | ||
cy.reload(); | ||
cy.wait(5000); | ||
cy.get('g[clip-path="url(#heart-filled_svg__a)"]' , {timeout:20000} ) | ||
.should('exist'); | ||
cy.go('back'); | ||
cy.reload(); | ||
} ); | ||
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 | ||
cy.get( | ||
'.live-preview-sitegen--selectable-card__live-preview-container-buttons__button__icon' | ||
) | ||
.eq( 0 ) | ||
.scrollIntoView() | ||
.should( 'be.visible' ) | ||
.click(); | ||
cy.get( 'g[clip-path="url(#heart-filled_svg__a)"]', { | ||
timeout: 20000, | ||
} ).should( 'exist' ); | ||
cy.get( | ||
'.live-preview-sitegen--selectable-card__live-preview-container__overlay' | ||
) | ||
.eq( 0 ) | ||
.scrollIntoView() | ||
.click(); | ||
cy.reload(); | ||
cy.wait( 5000 ); | ||
cy.get( 'g[clip-path="url(#heart-filled_svg__a)"]', { | ||
timeout: 20000, | ||
} ).should( 'exist' ); | ||
cy.go( 'back' ); | ||
cy.reload(); | ||
} ); | ||
|
||
it.skip( 'Check for regenerating the new theme versions', () => { | ||
cy.get('[aria-label="Regenerate Content"]', {timeout:20000}) | ||
.eq(1) | ||
.wait(1000) | ||
.click({force : true}) | ||
cy.get('[aria-label="Regenerate Content"]', {timeout:20000}) | ||
.eq(2) | ||
.scrollIntoView() | ||
cy.get('.live-preview-sitegen--selectable-card', {timeout:20000}) | ||
.should('be.visible') | ||
.should('have.length', 4); | ||
} ); | ||
it.skip( 'Check for regenerating the new theme versions', () => { | ||
cy.get( '[aria-label="Regenerate Content"]', { timeout: 20000 } ) | ||
.eq( 1 ) | ||
.wait( 1000 ) | ||
.click( { force: true } ); | ||
cy.get( '[aria-label="Regenerate Content"]', { timeout: 20000 } ) | ||
.eq( 2 ) | ||
.scrollIntoView(); | ||
cy.get( '.live-preview-sitegen--selectable-card', { timeout: 20000 } ) | ||
.should( 'be.visible' ) | ||
.should( 'have.length', 4 ); | ||
} ); | ||
|
||
it( 'Check for the preview note at the bottom', () => { | ||
cy.get('.nfd-onboarding-step--site-gen__preview__note') | ||
.scrollIntoView() | ||
.should('be.visible'); | ||
cy.get('g[id="State\\=Active"]').should('exist'); | ||
cy.get('.nfd-onboarding-step--site-gen__preview__note span').scrollIntoView().contains('Favorite'); | ||
} ); | ||
it( 'Check for the preview note at the bottom', () => { | ||
cy.get( '.nfd-onboarding-step--site-gen__preview__note' ) | ||
.scrollIntoView() | ||
.should( 'be.visible' ); | ||
cy.get( 'g[id="State\\=Active"]' ).should( 'exist' ); | ||
cy.get( '.nfd-onboarding-step--site-gen__preview__note span' ) | ||
.scrollIntoView() | ||
.contains( 'Favorite' ); | ||
} ); | ||
|
||
it( 'Select any theme and go forward to the next step', () => { | ||
cy.get('.live-preview-sitegen--selectable-card__live-preview-container__overlay', {timeout: 10000}) | ||
.eq(0) | ||
.click(); | ||
cy.url().should('not.contain', 'sitegen/step/preview', {timeout: 20000}); | ||
} ); | ||
}); | ||
it( 'Select any theme and go forward to the next step', () => { | ||
cy.get( | ||
'.live-preview-sitegen--selectable-card__live-preview-container__overlay', | ||
{ timeout: 10000 } | ||
) | ||
.eq( 0 ) | ||
.click(); | ||
cy.url().should( 'not.contain', 'sitegen/step/preview', { | ||
timeout: 20000, | ||
} ); | ||
} ); | ||
} ); |
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
Oops, something went wrong.