-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix failing cypress tests for design steps #364
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this I saw that now header menu takes time to load in the preview, should we also add a wait so that it gets rendered out as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wait is already added, line 15
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant after clicking on a new header pattern it renders very slowly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay