-
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 #364 from newfold-labs/fix/-Cypress-failing-design…
…-steps Fix failing cypress tests for design steps
- Loading branch information
Showing
9 changed files
with
157 additions
and
178 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
55 changes: 55 additions & 0 deletions
55
tests/cypress/integration/4-design-steps/theme-styles-menu.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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// <reference types="Cypress" /> | ||
import { DrawerActivityForMenu } from '../wp-module-support/drawer.cy'; | ||
import { CheckHeadingSubheading } from '../wp-module-support/header.cy'; | ||
import { | ||
CheckHelpPanelLinks, | ||
CheckIllustrationPanel, | ||
CheckInfoPanel, | ||
CheckIntroPanel, | ||
} from '../wp-module-support/sidebar.cy'; | ||
|
||
describe( 'Theme Styles Menu', function () { | ||
before( () => { | ||
cy.visit( | ||
'wp-admin/?page=nfd-onboarding#/wp-setup/step/design/theme-styles/menu' | ||
); | ||
cy.wait( 5000 ); | ||
} ); | ||
|
||
it( 'Check Drawer Activity', () => { | ||
DrawerActivityForMenu( | ||
'Onboarding Menu', | ||
':nth-child(1)', | ||
'Theme Styles' | ||
); | ||
} ); | ||
|
||
it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { | ||
CheckIntroPanel( '__design-theme-styles-menu', 'Theme Styles' ); | ||
CheckIllustrationPanel(); | ||
CheckInfoPanel( 2 ); | ||
CheckHelpPanelLinks(); | ||
} ); | ||
|
||
it( 'Checks if Heading and Subheading are present', () => { | ||
CheckHeadingSubheading(); | ||
} ); | ||
|
||
it( 'Check if Default Theme variations exists in Menu', () => { | ||
let previewCount = 0; | ||
const className = '.theme-styles-menu__list__item'; | ||
const arr = cy.get( className ); | ||
|
||
arr.each( () => { | ||
cy.get( className.concat( '__title-bar' ) ) | ||
.eq( previewCount ) | ||
.scrollIntoView() | ||
.should( 'be.visible' ); | ||
cy.get( className.concat( '__live-preview-container' ) ) | ||
.eq( previewCount ) | ||
.scrollIntoView() | ||
.should( 'be.visible' ); | ||
previewCount += 1; | ||
} ); | ||
} ); | ||
} ); |
61 changes: 61 additions & 0 deletions
61
tests/cypress/integration/4-design-steps/theme-styles-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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// <reference types="Cypress" /> | ||
import { | ||
CheckHelpPanelLinks, | ||
CheckIllustrationPanel, | ||
CheckInfoPanel, | ||
CheckIntroPanel, | ||
} from '../wp-module-support/sidebar.cy'; | ||
|
||
describe( 'Theme Styles Preview', function () { | ||
before( () => { | ||
cy.visit( | ||
'wp-admin/?page=nfd-onboarding#/wp-setup/step/design/theme-styles/preview' | ||
); | ||
cy.wait( 10000 ); | ||
} ); | ||
|
||
it( 'Check to make sure sidebar opens, content is in place and close sidebar', () => { | ||
CheckIntroPanel( '__design-theme-styles-preview', 'Theme Styles' ); | ||
CheckIllustrationPanel(); | ||
CheckInfoPanel( 2 ); | ||
CheckHelpPanelLinks(); | ||
} ); | ||
|
||
it( 'Check if Theme is selected and content is in place', () => { | ||
cy.get( ':nth-child(1) > .theme-styles-preview__title-bar' ).should( | ||
'be.visible' | ||
); | ||
} ); | ||
|
||
it( 'Check if Theme List is Visible in the Drawer', () => { | ||
let previewCount = 0; | ||
const className = '.theme-styles-preview--drawer__list__item'; | ||
const arr = cy.get( className ); | ||
|
||
arr.each( () => { | ||
cy.get( className.concat( '__title-bar' ) ) | ||
.eq( previewCount ) | ||
.scrollIntoView() | ||
.should( 'be.visible' ); | ||
cy.get( className.concat( '__live-preview-container' ) ) | ||
.eq( previewCount ) | ||
.scrollIntoView() | ||
.should( 'be.visible' ); | ||
previewCount += 1; | ||
} ); | ||
} ); | ||
|
||
it( 'Check for the selected theme in Drawer', () => { | ||
cy.get( '.nfd-onboarding-drawer__panel-back' ) | ||
.scrollIntoView() | ||
.should( 'be.visible' ) | ||
.should( 'have.text', 'Design' ); | ||
const className = | ||
':nth-child(2) > .theme-styles-preview--drawer__list__item__title-bar'; | ||
cy.get( className ); | ||
cy.get( className + ' > .live-preview-selected-check' ) | ||
.scrollIntoView() | ||
.should( 'be.visible' ); | ||
} ); | ||
|
||
}); |
Oops, something went wrong.