Skip to content

Commit

Permalink
PerformancePage Scripts with POM
Browse files Browse the repository at this point in the history
  • Loading branch information
CommitStorm committed Feb 12, 2025
1 parent e340a3c commit ccd9d9e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
1 change: 0 additions & 1 deletion tests/cypress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ height="42" />
A module for managing caching functionality.

## Module Responsibilities

- The performance module handles the following types of performance improvements:
- **Browser caching** - Sets the appropriate browser caching rules in the `.htaccess` file based on the cache level the user selects.
- **Cloudflare cache clearing** - If Cloudflare is enabled, send a cache clear request when a programmatic or user-initiated cache purge is requested.
Expand Down
2 changes: 1 addition & 1 deletion tests/cypress/fixtures/performanceModule.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@


{

"statusCode": 200,
"requestCount": 0
}
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/integration/performance.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ describe( 'Performance Page', { testIsolation: false }, () => {
let performanceLocators;
let data;

beforeEach( () => {
before( () => {
//cy.exec('npx wp-env run cli wp rewrite structure "/%postname%/"');
data = fixturePath;
cy.login( Cypress.env( "wpUsername" ), Cypress.env( "wpPassword" ) );
Expand Down Expand Up @@ -84,7 +84,7 @@ describe( 'Performance Page', { testIsolation: false }, () => {
} );


it( 'Mouse Hover-> with exclude: Verify if "Link Prefetch" is displayed and intercept network call', () => {
it( 'Mouse Hover-> with exclude:Verify if "Link Prefetch" is displayed and intercept network call', () => {
performanceLocators.verifyIfLinkPreFetchIsDisplayed();
performanceLocators.verifyIfToggleIsEnabled();
performanceLocators.interceptCallForMouseHoverWithExcludeRunTimeURL(
Expand Down
4 changes: 2 additions & 2 deletions tests/cypress/support/pageObjects/performancePage.js
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,8 @@ interceptCallForMouseHoverWithExcludeRunTimeURL(requestCount) {
// Assert API request count
cy.wrap(requestCount).should('equal', 0);

// Navigate back twice to return to the original state
cy.go('back').then(() =>{
// Navigate back twice to return to the original page
cy.go('back').then(() => {
cy.go('back');
});
});
Expand Down

0 comments on commit ccd9d9e

Please sign in to comment.