From 6501c591c8db78787b33119467c8c694962c5682 Mon Sep 17 00:00:00 2001 From: Opeyemi Ibrahim Date: Fri, 5 Apr 2024 16:18:12 +0100 Subject: [PATCH] Update template and make base url dynamic --- src/support/steps/ll-css-bg-image.ts | 71 ++++++++++++++++------------ 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/src/support/steps/ll-css-bg-image.ts b/src/support/steps/ll-css-bg-image.ts index 12b0dd0..5a3a1ba 100644 --- a/src/support/steps/ll-css-bg-image.ts +++ b/src/support/steps/ll-css-bg-image.ts @@ -1,6 +1,7 @@ import { When, Then } from '@cucumber/cucumber'; import { ICustomWorld } from "../../common/custom-world"; import { expect } from "@playwright/test"; +import {WP_BASE_URL} from "../../../config/wp.config"; Then('I must see the correct style in the head', async function (this: ICustomWorld) { const html = await this.page.evaluate(async () => { @@ -64,65 +65,73 @@ const LL_BACKGROUND_IMAGES = { // eslint-disable-next-line @typescript-eslint/naming-convention lazyload_css_background_images: { initialImages: [ - 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/image-insidescript.jpeg', - 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper.jpeg', 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test_inline1.jpeg', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test_inline2.jpeg', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test_internal0.webp' + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/test_inline2.jpeg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/test_internal0.webp' ], lazyLoadedImages: [ 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/image/test3.webp', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/image/file_example_JPG_100kB.jpg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/image/file_example_JPG_100kB.jpg', 'https://rocketlabsqa.ovh/wp-content/rocket-test-data/images/Spain.PNG', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper.jpeg', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test_internal4.jpg', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/testnotExist.png', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/wp-rocket.svg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/paper.jpeg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/test_internal4.jpg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/testnotExist.png', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/wp-rocket.svg', 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/butterfly.avif', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/file_example_TIFF_1MB.tiff', 'https://fastly.picsum.photos/id/976/200/300.jpg?hmac=s1Uz9fgJv32r8elfaIYn7pLpQXps7X9oYNwC5XirhO8', 'https://rocketlabsqa.ovh/wp-content/rocket-test-data/images/fixtheissue.jpg', 'https://mega.wp-rocket.me/avada/wp-content/rocket-test-data/prague-conference-center-1056491.jpg', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/butterfly%202.avif', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/butterfly%202.avif', 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper%C3%A9quipesTest.jpeg', 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test_internal2.jpg', - 'https://e2e.rocketlabsqa.ovh/wp-content/plugins/revslidertest1/public/assets/assets/test_internal3.jpg', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test.png', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/image/test3.gif', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test_external1.jpeg', - 'https://e2e.rocketlabsqa.ovh/test.png', + `${WP_BASE_URL}/`+'wp-content/plugins/revslidertest/public/assets/assets/test_internal3.jpg', + 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/paper.jpeg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/test.png', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/image/test3.gif', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/test_external1.jpeg', + `${WP_BASE_URL}/`+'test.png', 'https://upload.wikimedia.org/wikipedia/commons/1/11/Test-Logo.svg', - 'https://e2e.rocketlabsqa.ovh/kot%C5%82.png', - 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/assets/images/relative1.jpeg', - 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/styles/assets/images/relative2.jpg', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/lcp/testsvg.svg', + `${WP_BASE_URL}/`+'kot%C5%82.png', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/styles/assets/images/relative1.jpeg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/styles/assets/images/relative2.jpg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/lcp/testsvg.svg', 'https://new.rocketlabsqa.ovh//wp-content/rocket-test-data/images/wp-rocket.svg', 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/wp-rocket2.svg', - 'https://e2e.rocketlabsqa.ovh/new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/test_internal2.jpg', - 'https://new.rocketlabsqa.ovh/wp-content/rocket-test-data/images/nature.jpeg' ] }, // eslint-disable-next-line @typescript-eslint/naming-convention ll_bg_css_single_colon: { initialImages: [ - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/fabio-sasso-UgpCjt4XLTY-unsplash.jpg', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/underline.png', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/maxime-lebrun-6g3Akg708E0-unsplash.jpg' + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/fabio-sasso-UgpCjt4XLTY-unsplash.jpg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/lcp/testPng.png', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/underline.png', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/lcp/testjpg.jpg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/maxime-lebrun-6g3Akg708E0-unsplash.jpg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/lcp/testwebp.webp', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/lcp/testavif.avif', ], lazyLoadedImages: [ - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/miguel-luis-6wxFtwSuXHQ-unsplash.jpg' + `${WP_BASE_URL}/` + 'wp-content/rocket-test-data/images/paper.jpeg', + `${WP_BASE_URL}/` + 'wp-content/rocket-test-data/images/test-internal1.png', + `${WP_BASE_URL}/` + 'wp-content/rocket-test-data/images/miguel-luis-6wxFtwSuXHQ-unsplash.jpg' ] }, // eslint-disable-next-line @typescript-eslint/naming-convention ll_bg_css_double_colon:{ initialImages: [ - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/fabio-sasso-UgpCjt4XLTY-unsplash.jpg', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/underline.png', - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/maxime-lebrun-6g3Akg708E0-unsplash.jpg' + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/fabio-sasso-UgpCjt4XLTY-unsplash.jpg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/600px-Mapang-test.gif', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/underline.png', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/Przechwytywanie.PNG', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/maxime-lebrun-6g3Akg708E0-unsplash.jpg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/Mapang-test.gif', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/BigJPGImage_20mbmb.jpg', ], lazyLoadedImages: [ - 'https://e2e.rocketlabsqa.ovh/wp-content/rocket-test-data/images/miguel-luis-6wxFtwSuXHQ-unsplash.jpg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/img_nature.jpg', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/istockphoto-1184692500-612x612.webp', + `${WP_BASE_URL}/`+'wp-content/rocket-test-data/images/miguel-luis-6wxFtwSuXHQ-unsplash.jpg', ] } };