2 lines
1.6 KiB
JavaScript
2 lines
1.6 KiB
JavaScript
async(page)=>{await page.goto('http://127.0.0.1:54623/?designer=theme5');await page.setViewportSize({width:320,height:1000});const r=[];await page.locator('#theme').focus();await page.keyboard.press('Home');await page.keyboard.press('ArrowDown');await page.keyboard.press('Enter');r.push({keyboardLight:await page.locator('#theme').inputValue(),theme:await page.locator('html').getAttribute('data-theme')});await page.screenshot({path:'/tmp/progcode-concept-v3/theme-focus320.png'});await page.locator('#theme').selectOption('dark');await page.reload();r.push({reloadDark:await page.locator('#theme').inputValue(),resolved:await page.locator('html').getAttribute('data-theme'),width:await page.evaluate(()=>document.documentElement.scrollWidth)});await page.screenshot({path:'/tmp/progcode-concept-v3/home320-dark-select.png'});await page.locator('#theme').selectOption('system');await page.emulateMedia({colorScheme:'light'});r.push({systemLight:await page.locator('html').getAttribute('data-theme')});await page.emulateMedia({colorScheme:'dark'});r.push({systemDark:await page.locator('html').getAttribute('data-theme')});await page.locator('#theme').selectOption('light');await page.goto('http://127.0.0.1:54623/#kit');await page.locator('#format').click();r.push({jsonSuccess:await page.locator('#jsonstate').innerText()});await page.locator('.spec').filter({has:page.getByRole('heading',{name:'Bitrix FileInput / 19.10.2018'})}).scrollIntoViewIfNeeded();await page.screenshot({path:'/tmp/progcode-concept-v3/bitrix320-light.png'});await page.locator('#theme').selectOption('dark');await page.screenshot({path:'/tmp/progcode-concept-v3/bitrix320-dark.png'});return r;}
|