-
Notifications
You must be signed in to change notification settings - Fork 0
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 #144 from wp-media/feature/129-ll-not-applied-lcp
Closes #129 Automate the scenario that check LL isnot applied on LCP/ATF images
- Loading branch information
Showing
10 changed files
with
362 additions
and
19 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@lcp @delaylcp @setup | ||
Feature: Lazyload with LCP | ||
|
||
Background: | ||
Given I am logged in | ||
And plugin is installed 'new_release' | ||
And plugin 'wp-rocket' is activated | ||
When I go to 'wp-admin/options-general.php?page=wprocket#dashboard' | ||
And I save settings 'media' 'lazyloadCssBgImg' | ||
And I save settings 'media' 'lazyload' | ||
And I save settings 'media' 'lazyloadIframes' | ||
And I save settings 'media' 'lazyloadYoutube' | ||
|
||
Scenario: Should Exclude LCP/ATF from Lazyload | ||
When I log out | ||
And I visit the urls for 'desktop' | ||
When I am logged in | ||
And I clear cache | ||
And I log out | ||
And I visit the urls and check for lazyload | ||
Then lcp and atf images are not written to LL format | ||
|
||
Scenario: Should exclude next-gen lcp/atf from LL | ||
Given I install plugin 'imagify' | ||
And plugin 'imagify' is activated | ||
When I am logged in | ||
And Imagify is set up | ||
When I log out | ||
And I visit page 'lcp_with_imagify' and check for lcp | ||
When I am logged in | ||
And I clear cache | ||
And I log out | ||
And I visit the 'lcp_with_imagify' and check lcp-atf are not lazyloaded | ||
Then lcp and atf images are not written to LL format | ||
|
||
Scenario: Should exclude Imagify next-gen lcp/atf from LL | ||
When I am logged in | ||
And display next-gen is enabled on imagify | ||
When I log out | ||
And I visit page 'lcp_with_imagify' and check for lcp | ||
When I am logged in | ||
And I clear cache | ||
And I log out | ||
And I visit the 'lcp_with_imagify' and check lcp-atf are not lazyloaded | ||
Then lcp and atf images are not written to LL format | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { ICustomWorld } from "../../common/custom-world"; | ||
|
||
import { Given } from '@cucumber/cucumber'; | ||
import { IMAGIFY_INFOS } from "../../../config/wp.config"; | ||
import {expect} from "@playwright/test"; | ||
|
||
Given('Imagify is set up', async function (this: ICustomWorld) { | ||
await this.utils.gotoImagify(); | ||
|
||
// Check if the API key input field exists on the page | ||
const apiKeyInput = await this.page.$('input#api_key'); | ||
|
||
if (apiKeyInput) { | ||
// Fill the API key input field with the API key from the config | ||
await this.page.fill('input#api_key', IMAGIFY_INFOS.apiKey); | ||
// Click the submit button to save the changes | ||
await this.page.click('div.submit.imagify-clearfix input#submit'); | ||
} | ||
}); | ||
Given('display next-gen is enabled on imagify', async function (this: ICustomWorld) { | ||
// Go to Imagify setting page | ||
await this.utils.gotoImagify(); | ||
|
||
// Check the 'Display images in Next-Gen format on the site' checkbox | ||
await this.page.click('label[for="imagify_display_nextgen"]'); | ||
|
||
// Click the submit button to save the changes | ||
await this.page.click('input#submit'); | ||
|
||
await expect(this.page.getByText('Settings saved.')).toBeVisible(); | ||
}); |
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.