Browser automation via Playwriter (remorses) using persistent Chrome sessions and the full Playwright Page API.
Use Playwriter to run Playwright Page scripts against your local Chrome session. This preserves logins, cookies, and extensions, which is ideal for web dashboard testing and authenticated flows.
npm i -g playwriter
playwriter session new
playwriter session list
playwriter -s <session_id> -e "await page.goto('https://example.com')"
Within -e, these are available in scope:
page (Playwright Page)context (BrowserContext)state (persistent object across calls in the same session)require (for loading helper modules)Example state persistence:
playwriter -s <session_id> -e "state.lastUrl = page.url()"
playwriter -s <session_id> -e "console.log(state.lastUrl)"
playwriter -s <session_id> -e "await page.goto('http://localhost:3000'); await page.getByRole('button', { name: 'Run' }).click();"
playwriter -s <session_id> -e "await page.getByLabel('Email').fill('qa@example.com'); await page.getByLabel('Password').fill('secret'); await page.getByRole('button', { name: 'Sign in' }).click();"
playwriter -s <session_id> -e "const { screenshotWithAccessibilityLabels } = require('playwriter'); await screenshotWithAccessibilityLabels(page, { path: '/tmp/a11y.png' });"
playwriter -s <session_id> -e "await page.route('**/api/**', async route => { const res = await route.fetch(); const body = await res.json(); await route.fulfill({ json: { ...body, injected: true } }); });"
playwriter -s <session_id> -e "const text = await page.locator('main').innerText(); console.log(text);"
getByRole and getByLabel for stable selectors.state.