Files
ab 7fdf4803ed
Checks / test (push) Failing after 9m9s
Fixed CI
2026-09-24 16:10:08 +03:00

21 lines
910 B
JavaScript

const { chromium } = require('playwright');
function launchBrowser() {
const channel = process.env.MEGURI_BROWSER_CHANNEL || 'chrome';
return chromium.launch({
headless: true,
...(channel === 'chromium' ? {} : { channel }),
});
}
exports.launchBrowser = launchBrowser;
exports.openSetup = async (page, name) => {
await page.waitForFunction(()=>window.Alpine && Alpine.$data(document.body).ready && Alpine.$data(document.body).workspace);
const combined=['Schedules','Escalations & routing','Variables & rules'].includes(name);
const target=page.getByRole('link',{name:combined?'Schedule setup':name,exact:true});
if(!await target.isVisible())await page.getByRole('button',{name:'Setup',exact:true}).click();
await target.click();
if(combined)await page.locator(name==='Schedules'?'#schedules':name==='Escalations & routing'?'#schedules':'#generation').scrollIntoViewIfNeeded();
};