5 lines
2.3 KiB
JavaScript
5 lines
2.3 KiB
JavaScript
// Own isolated Development account only. No traces or login screenshots.
|
|
const{chromium}=require('playwright'),fs=require('node:fs'),assert=require('node:assert/strict');
|
|
(async()=>{const file=process.argv[2];assert(file?.startsWith('/tmp/pd-dev-browser-'));const id=JSON.parse(fs.readFileSync(file));assert.equal(id.Database,'PlotDirector_Development');assert(id.Email.startsWith('pwa-browser-'));const b=await chromium.launch();try{const p=await b.newPage({viewport:{width:1440,height:1000}});await p.goto('https://dev.plotdirector.com/Account/Login');await p.locator('[name=Email]').fill(id.Email);await p.locator('[name=Password]').fill(id.Password);await p.locator('form button[type=submit]').click();await p.waitForURL('**/Projects');await p.locator('#accountMenuButton').click();const first=await p.locator('[data-app-theme-choice=plotdirector]').boundingBox(),picker=await p.locator('.pd-theme-picker').boundingBox();assert(Math.abs(first.width-picker.width)<1);const alternatives=await p.locator('[data-app-theme-choice]:not([data-app-theme-choice=plotdirector])').all();assert.equal(alternatives.length,6);const rects=await Promise.all(alternatives.map(a=>a.boundingBox()));for(let i=0;i<6;i+=2)assert(Math.abs(rects[i].y-rects[i+1].y)<1&&rects[i].width<first.width/2);
|
|
await p.goto('https://dev.plotdirector.com/writing-problems');for(const choice of ['story-not-working','too-many','lost','unwanted']){await p.locator(`input[name=choices][value="${choice}"]`).check();await p.locator('.solver-form button[type=submit]').click();}assert.equal(p.url(),'https://dev.plotdirector.com/writing-problems/too-many-storylines-to-manage');assert(await p.locator('.solver-result-evidence > p').count()>1);assert((await p.locator('.solver-result-cta').innerText()).startsWith('Open '));await p.locator('.solver-tool-visual img').scrollIntoViewIfNeeded();await p.locator('.solver-tool-visual img').evaluate(e=>e.decode());assert(await p.locator('.solver-tool-visual img').evaluate(e=>e.naturalWidth>0));assert.equal(await p.locator('.solver-visual-placeholder').count(),0);console.log('PASS live signed-in completion: personalised evidence, clean slug, real image, workspace CTA; full-width PlotDirector picker row plus three paired alternative rows.');}finally{await b.close();}})().catch(e=>{console.error(e.message);process.exit(1)});
|