1c/Ox
1
0
mirror of https://github.com/LazarenkoA/Ox.git synced 2025-11-23 21:33:13 +02:00
This commit is contained in:
Артем
2025-11-08 21:50:07 +03:00
parent 275bf1bc89
commit c6f7e0413b

View File

@@ -1,7 +1,7 @@
import { test, expect } from '@playwright/test'; import { test, expect } from '@playwright/test';
test('Тест свод отчетов', async ({ page }) => { test('Тест свод отчетов', async ({ page }) => {
test.setTimeout(150_000); // секунд только для этого теста test.setTimeout(300_000); // секунд только для этого теста
await page.goto('https://localhost/sko/ru/'); await page.goto('https://localhost/sko/ru/');
await page.locator('#userName').click(); await page.locator('#userName').click();
@@ -26,8 +26,17 @@ test('Тест свод отчетов', async ({ page }) => {
await page.waitForTimeout(100); await page.waitForTimeout(100);
const count = await page.locator('[id$="_CommandButtonOK"]').count(); const count = await page.locator('[id$="_CommandButtonOK"]').count();
if(count > 0) { if(count > 0) {
await page.locator('[id$="_CommandButtonOK"]').last().click(); await page.locator('a.pressCommand:not(.pressDisabled)[id$="_CommandButtonOK"]').last().click({ force: true });
await closeButton(page, 'ФормаЗаписатьИЗакрыть') await closeButton(page, 'ФормаЗаписатьИЗакрыть')
// await page.evaluate(() => {
// const el = document.querySelector('[id$="_CommandButtonOK"]');
// if (el) {
// el.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));
// el.dispatchEvent(new MouseEvent('mouseup', { bubbles: true }));
// el.dispatchEvent(new MouseEvent('click', { bubbles: true }));
// }
// });
} }
await randSleep(page); await randSleep(page);
@@ -43,7 +52,7 @@ test('Тест свод отчетов', async ({ page }) => {
await page.locator('#cmd_2_0_txt').click(); await page.locator('#cmd_2_0_txt').click();
await page.waitForTimeout(100); await page.waitForTimeout(100);
await page.locator('a[id^="form"][id$="СформироватьОтчет"]').last().click(); await page.locator('a.pressCommand:not(.pressDisabled)[id^="form"][id$="СформироватьОтчет"]').last().click();
await page.waitForTimeout(100); await page.waitForTimeout(100);
await close(page); await close(page);
}); });
@@ -53,7 +62,7 @@ function randomString() {
} }
async function closeButton(page, name) { async function closeButton(page, name) {
const elem = await page.locator(`a[id$="_${name}"]`); const elem = await page.locator(`a.pressCommand:not(.pressDisabled)[id$="_${name}"]`);
await elem.waitFor(); await elem.waitFor();
const elems = await elem.elementHandles(); const elems = await elem.elementHandles();