dailykart-testing/tests/aboutus-image.spec.ts

21 lines
701 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { test, expect } from '@playwright/test';
test('#1 About Us image should be reasonably sized', async ({ page }) => {
await page.goto('https://uat.dailykart.net/about');
// Select the first image inside main content
const aboutSectionImage = page.locator('.about-img img').first();
// Optional: scroll into view in case its lazy-loaded
await aboutSectionImage.scrollIntoViewIfNeeded();
await expect(aboutSectionImage).toBeVisible({ timeout: 10000 });
const imageSize = await aboutSectionImage.boundingBox();
console.log('Image size:', imageSize);
expect(imageSize?.width).toBeGreaterThan(100);
expect(imageSize?.height).toBeGreaterThan(50);
}, { timeout: 60000 });