24 lines
1.5 KiB
JavaScript
24 lines
1.5 KiB
JavaScript
// TPTIP-36: подсказка про пустые кольца сразу после мастера на телефоне.
|
|
const { test, expect } = require('@playwright/test');
|
|
|
|
test.use({ viewport: { width: 375, height: 740 }, locale: 'ru-RU' });
|
|
|
|
test('Сценарий: После мастера подсказка про пустые кольца видна и не перекрыта меню', async ({ page }) => {
|
|
await page.goto('/');
|
|
const fields = page.locator('.sheet input');
|
|
for (const [i, value] of ['40', '170', '65'].entries()) await fields.nth(i).fill(value);
|
|
await page.getByRole('button', { name: 'Далее', exact: true }).click();
|
|
await page.getByRole('button', { name: 'Готово', exact: true }).click();
|
|
await expect(page.locator('.sheet')).toHaveCount(0);
|
|
const hint = page.locator('[data-empty-hint]');
|
|
await expect(hint).toBeVisible();
|
|
await expect(hint).toContainText('Пока ничего не добавлено');
|
|
await expect(hint).toContainText('выберите блюдо');
|
|
await expect(hint).toContainText('добавьте тренировку');
|
|
const box = await hint.boundingBox();
|
|
const tabs = await page.locator('#tabs').boundingBox();
|
|
expect(box.y + box.height, 'выше нижнего меню').toBeLessThanOrEqual(tabs.y);
|
|
const top = await hint.evaluate(e => { const r = e.getBoundingClientRect(); const el = document.elementFromPoint(r.x + r.width / 2, r.y + r.height / 2); return e.contains(el); });
|
|
expect(top, 'ничем не перекрыта').toBe(true);
|
|
});
|