Skip to content

Commit

Permalink
modify scenario steps
Browse files Browse the repository at this point in the history
  • Loading branch information
Khadreal committed Sep 20, 2024
1 parent c588e74 commit 221ea39
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 42 deletions.
34 changes: 0 additions & 34 deletions backstop.json

This file was deleted.

6 changes: 3 additions & 3 deletions config/wp.config.sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ const WP_ADMIN_USER = {
} as const;

/**
* The default Imagify settings informations
* The default Imagify settings information
*
* @constant
* @type {{ API_KEY: string }}
* @type {{ apiKey: string }}
*/
const IMAGIFY_INFOS = {
API_KEY: ''
apiKey: ''
} as const;

/**
Expand Down
10 changes: 7 additions & 3 deletions src/features/ll-lcp.feature
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ Feature: Lazyload with LCP
And I save settings 'media' 'lazyloadCssBgImg'

Scenario: Should Exclude LCP/ATF from Lazyload
Given I visit page 'lcp_with_imagify' with browser dimension 1600 x 700
When I log out
And I visit the urls for 'desktop'
When I am logged in
And I clear cache
And I visit the urls for 'desktop'
Then lcp image markup is not written to LL format
# And ATF image markup is not written to LL format

Scenario: Should exclude next-gen lcp/atf from LL
Given plugin is installed 'imagify'
And plugin is activated
Given I install plugin 'imagify'
And plugin 'imagify' is activated
When I am logged in
And I go to 'wp-admin/options-general.php?page=imagify'
And I save imagify API key
And display next-gen is enabled on imagify
And I visit page 'lcp_with_imagify' with browser dimension 1600 x 700
# And page 'lcp_with_imagify' with images having next-gen avif, webp, avif/webp, no next gen is visited # I didn't get that
When I clear cache
And I visit page 'lcp_with_imagify' with browser dimension 1600 x 700
Expand Down
2 changes: 1 addition & 1 deletion src/support/steps/imagify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Given('I save imagify API key', async function (this: ICustomWorld) {

if (apiKeyInput) {
// Fill the API key input field with the API key from the config
await this.page.fill('input#api_key', IMAGIFY_INFOS.API_KEY);
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');
Expand Down
2 changes: 1 addition & 1 deletion utils/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export async function rm(destination: string): Promise<void> {
*/
export async function activatePlugin(name: string): Promise<void> {
await wp(`plugin activate ${name}`)
const status: boolean = await wp(`plugin is-active ${name}`);
const status: boolean = await wp(`plugin is-active ${name}`);console.log(status)
if(!status) {
throw new Error(`Plugin - ${name} is not active`);
}
Expand Down

0 comments on commit 221ea39

Please sign in to comment.