Skip to content

Commit 883916d

Browse files
committed
chore: enhance e2e tests with improved image attribute checks
1 parent 2c81c2b commit 883916d

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/e2e/ss-pinterest.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ test.describe('Sassy Social Share', () => {
1717

1818
const images = await page.locator('img').all();
1919
expect(images.length).toBe(5);
20-
20+
await page.waitForTimeout(2000);
2121
for (let i = 0; i < 4; i++) {
2222
const src = await images[i].getAttribute('src');
2323
expect(src).not.toMatch(/eco/);

tests/e2e/su.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@ test.describe('Check Shortcode ultimate page', () => {
99
const images = await page.locator('.su-carousel-slide img').all();
1010
for (const image of images) {
1111
await expect(image).toHaveAttribute('src', /i\.optimole\.com/);
12+
// change this to check only if data-opt-src if exists and if not check src
13+
if(await image.getAttribute('data-opt-src')){
14+
await expect(image).toHaveAttribute('data-opt-src', /rt:fill/);
15+
}else{
1216
await expect(image).toHaveAttribute('src', /rt:fill/);
17+
}
1318
}
1419
});
1520

tests/e2e/woo.spec.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ test.describe('Check product page', () => {
1616
const links = await page.locator('.woocommerce-product-gallery__wrapper > div > a').all();
1717
for (const link of links) {
1818
await expect(link).toHaveAttribute('href', /i\.optimole\.com/);
19-
await expect(link).toHaveAttribute('href', /w:auto\/h:auto/);
2019
}
2120
});
2221

0 commit comments

Comments
 (0)