Skip to content

Commit

Permalink
Closes #168: Tests for Check if content are lazyloaded while scrollin…
Browse files Browse the repository at this point in the history
…g seems always failing for the templates lazyload_css_background_images, ll_bg_css_single_colon and ll_bg_css_double_colon (#169)

* Deactivate WPML on setup

* Assert that images are in expected array
  • Loading branch information
jeawhanlee authored Nov 21, 2024
1 parent 2f39a0c commit 80bde4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/support/steps/ll-css-bg-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,5 @@ Then('Check {string} input for background images', async function (this: ICustom
await this.page.locator('input[name="lastName"]').nth(1).fill('Random text')

await this.utils.scrollDownBottomOfAPage();

expect(images).toEqual(LL_BACKGROUND_IMAGES[page].lazyLoadedImages)
expect(images.every(image => LL_BACKGROUND_IMAGES[page].lazyLoadedImages.includes(image))).toBeTruthy();
});
5 changes: 4 additions & 1 deletion utils/page-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { ICustomWorld } from '../src/common/custom-world';
import fs from "fs/promises";

import {WP_BASE_URL, WP_PASSWORD, WP_USERNAME} from '../config/wp.config';
import { uninstallPlugin, updatePermalinkStructure } from "./commands";
import { uninstallPlugin, updatePermalinkStructure, deactivatePlugin } from "./commands";

/**
* Utility class for interacting with a Playwright Page instance in WordPress testing.
Expand Down Expand Up @@ -577,6 +577,9 @@ export class PageUtils {
// Remove helper plugin.
await uninstallPlugin('wp-rocket force-wp-mobile');

// Deactivate WPML.
await deactivatePlugin('sitepress-multilingual-cms');

// Reset permalink structure.
await updatePermalinkStructure('/%postname%/');

Expand Down

0 comments on commit 80bde4e

Please sign in to comment.