-
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
cf26682
commit 84f4997
Showing
4 changed files
with
67 additions
and
70 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
126 changes: 65 additions & 61 deletions
126
tests/cypress/integration/5-AI-SiteGen-onboarding-flow/1-fork.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,79 +1,83 @@ | ||
// <reference types="Cypress" /> | ||
|
||
import { AdminBarCheck, DarkBGCheck, LightBGCheck, OptionsDetails } from "../wp-module-support/siteGen.cy"; | ||
import { | ||
AdminBarCheck, | ||
DarkBGCheck, | ||
LightBGCheck, | ||
} from '../wp-module-support/siteGen.cy'; | ||
|
||
describe( 'SiteGen Fork Step', function () { | ||
before( () => { | ||
cy.exec('npx wp-env run cli wp option delete nfd_module_onboarding_flow'); | ||
cy.exec(`npx wp-env run cli wp option set _transient_nfd_site_capabilities '{"hasAISiteGen": true, "canAccessAI": true}' --format=json`); | ||
cy.exec(`npx wp-env run cli wp option set _transient_timeout_nfd_site_capabilities 4102444800`); | ||
cy.wait(10000); | ||
cy.visit( | ||
'wp-admin/?page=nfd-onboarding#/wp-setup/step/fork' | ||
cy.exec( | ||
'npx wp-env run cli wp option delete nfd_module_onboarding_flow' | ||
); | ||
cy.timeout(60000); | ||
cy.wait(5000); | ||
cy.exec( | ||
`npx wp-env run cli wp option set _transient_nfd_site_capabilities '{"hasAISiteGen": true, "canAccessAI": true}' --format=json` | ||
); | ||
cy.exec( | ||
`npx wp-env run cli wp option set _transient_timeout_nfd_site_capabilities 4102444800` | ||
); | ||
cy.wait( 10000 ); | ||
cy.visit( 'wp-admin/?page=nfd-onboarding#/wp-setup/step/fork' ); | ||
cy.timeout( 60000 ); | ||
cy.wait( 10000 ); | ||
} ); | ||
|
||
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', () => { | ||
LightBGCheck(); | ||
} ); | ||
it( 'Check for the light background', () => { | ||
LightBGCheck(); | ||
} ); | ||
|
||
it( 'Check for the heading and the title', () => { | ||
cy.get( '.nfd-onboarding-step__heading__title' ) | ||
.should('be.visible') | ||
.should('have.text', 'Welcome to WordPress'); | ||
} ); | ||
it( 'Check for the heading and the title', () => { | ||
cy.get( '.nfd-onboarding-step__heading__title' ) | ||
.should( 'be.visible' ) | ||
.should( 'have.text', 'Welcome to WordPress' ); | ||
} ); | ||
|
||
it ( 'Check for the subheading', () => { | ||
cy.get( '.nfd-onboarding-step__heading__subtitle' ).should('be.visible'); | ||
} ); | ||
it( 'Check for the subheading', () => { | ||
cy.get( '.nfd-onboarding-step__heading__subtitle' ).should( | ||
'be.visible' | ||
); | ||
} ); | ||
|
||
it ( 'Check the number of container options available', () => { | ||
cy.get( '.nfd-onboarding-sitegen-options__container__options' ) | ||
.should( 'be.visible' ) | ||
.should('have.length', 3); | ||
} ); | ||
it( 'Check the number of container options available', () => { | ||
cy.get( '.nfd-onboarding-sitegen-options__container__options' ) | ||
.should( 'be.visible' ) | ||
.should( 'have.length', 3 ); | ||
} ); | ||
|
||
it.skip( 'Check for selection of different container options', () => { | ||
let options = 0; | ||
const className = '.nfd-onboarding-sitegen-options__container__options'; | ||
const arr = cy.get( className ); | ||
arr.each( () => { | ||
if(options == 0){ | ||
OptionsDetails(className,'Guided Configuration',options); | ||
}; | ||
if(options == 1){ | ||
OptionsDetails(className,'AI Website Creator',options); | ||
cy.get(className) | ||
.eq(options) | ||
.click(); | ||
cy.url().should('include', 'sitegen/step/welcome',{ | ||
timeout: 10000, | ||
} ); | ||
cy.go('back'); | ||
}; | ||
if(options == 2){ | ||
OptionsDetails(className, 'Hire a Pro',options); | ||
}; | ||
options+=1; | ||
it( 'Check for selection of different container options', () => { | ||
const className = '.nfd-onboarding-sitegen-options__container__options'; | ||
const arr = cy.get( className ); | ||
|
||
}); | ||
}); | ||
arr.each( ( $element ) => { | ||
const dataSlugText = $element.attr( 'data-flow' ); | ||
if ( dataSlugText == 'sitegen' ) { | ||
$element.click(); | ||
cy.url().should( 'include', 'sitegen/step/welcome', { | ||
timeout: 10000, | ||
} ); | ||
cy.go( 'back' ); | ||
} | ||
} ); | ||
} ); | ||
|
||
it( 'Check for the import your WP account link at the bottom', () => { | ||
cy.get( '.nfd-onboarding-step--site-gen__fork__importsite' ) | ||
.scrollIntoView() | ||
.should('exist') | ||
.should('contain', 'Already have a WordPress site') | ||
.should('have.attr', 'href', 'https://my.bluehost.com/cgi/services/migration'); | ||
} ); | ||
}); | ||
it( 'Check for the import your WP account link at the bottom', () => { | ||
cy.get( '.nfd-onboarding-step--site-gen__fork__importsite' ) | ||
.scrollIntoView() | ||
.should( 'exist' ) | ||
.should( 'contain', 'Already have a WordPress site' ) | ||
.should( | ||
'have.attr', | ||
'href', | ||
'https://my.bluehost.com/cgi/services/migration' | ||
); | ||
} ); | ||
} ); |
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