diff --git a/src/features/lcp-beacon-script.feature b/src/features/lcp-beacon-script.feature index 2b5878e..99a5756 100644 --- a/src/features/lcp-beacon-script.feature +++ b/src/features/lcp-beacon-script.feature @@ -1,4 +1,4 @@ -@lcp @setup +@lcp @delaylcp @setup Feature: Beacon script captures the right images. Background: diff --git a/src/support/hooks.ts b/src/support/hooks.ts index 1a2cce7..8e12671 100644 --- a/src/support/hooks.ts +++ b/src/support/hooks.ts @@ -25,7 +25,7 @@ import backstop from 'backstopjs'; import {SCENARIO_URLS, WP_SSH_ROOT_DIR,} from "../../config/wp.config"; import { After, AfterAll, Before, BeforeAll, Status, setDefaultTimeout } from "@cucumber/cucumber"; -import {rename, exists, rm, testSshConnection} from "../../utils/commands"; +import {rename, exists, rm, testSshConnection, installRemotePlugin, activatePlugin, uninstallPlugin} from "../../utils/commands"; // import {configurations, getWPDir} from "../../utils/configurations"; /** @@ -208,6 +208,22 @@ After(async function (this: ICustomWorld, { pickle, result }) { }); +/** + * Before each test scenario with the @delaylcp tag, performs setup tasks. + */ +Before({tags: '@delaylcp'}, async function (this: ICustomWorld) { + // Install and activate the remote plugin + await installRemotePlugin('https://github.com/wp-media/wp-rocket-e2e-test-helper/raw/main/helper-plugin/rocket-lcp-delay.zip'); + await activatePlugin('rocket-lcp-delay'); +}); + +/** + * After each test scenario with the @delaylcp tag, performs teardown tasks. + */ +After({tags: '@delaylcp'}, async function (this: ICustomWorld) { + await uninstallPlugin('rocket-lcp-delay'); +}); + /** * To uncomment during implementation of cli */