-
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.
- Loading branch information
Showing
4 changed files
with
69 additions
and
11 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,35 @@ | ||
import { expect } from "@playwright/test"; | ||
import { ICustomWorld } from "../../common/custom-world"; | ||
|
||
import { Given, When, Then } from '@cucumber/cucumber'; | ||
import { IMAGIFY_INFOS } from "../../../config/wp.config"; | ||
import { WP_BASE_URL } from '../../../config/wp.config'; | ||
import { createReference, compareReference } from "../../../utils/helpers"; | ||
import type { Section } from "../../../utils/types"; | ||
import { Page } from '@playwright/test'; | ||
import { | ||
deactivatePlugin, installRemotePlugin, | ||
} from "../../../utils/commands"; | ||
|
||
Given('I save imagify API key', async function (this: ICustomWorld) { | ||
// 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.API_KEY); | ||
|
||
// 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'); | ||
}); |
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