cover mobile viewport in browser acceptance

This commit is contained in:
2026-09-06 19:02:08 +03:00
parent efdafa8218
commit 2c3ae87e9a
3 changed files with 30 additions and 1 deletions
+16
View File
@@ -61,6 +61,22 @@ try {
evidence.checks.overviewStatus = overview?.status();
evidence.checks.overviewFrames = await page.locator('iframe[title^="Hazırlık"]').count();
if (evidence.checks.overviewFrames !== 3) throw new Error('Hazırlık özeti üç görünüm alanında açılmadı.');
const mobile = await browser.newPage({ viewport: { width: 390, height: 844 }, deviceScaleFactor: 1 });
try {
const mobileResponse = await mobile.goto(url, { waitUntil: 'networkidle' });
evidence.checks.mobileStatus = mobileResponse?.status();
const mobileOverflow = await mobile.evaluate(() => ({
viewport: window.innerWidth,
scrollWidth: document.documentElement.scrollWidth,
horizontalOverflow: document.documentElement.scrollWidth > window.innerWidth + 1,
}));
evidence.checks.mobileOverflow = mobileOverflow;
if (mobileOverflow.horizontalOverflow) throw new Error('390px görünümünde yatay taşma var.');
await mobile.getByRole('button', { name: 'Test hesabıyla gir' }).click();
await mobile.waitForLoadState('networkidle');
evidence.checks.mobileTenderList = await mobile.getByLabel('İhale listesi').count() === 1;
if (!evidence.checks.mobileTenderList) throw new Error('390px görünümünde ihale listesi bulunamadı.');
} finally { await mobile.close(); }
} finally {
await page.close(); await browser.close(); server.kill('SIGTERM');
}