Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save james-ni/ccc1b7bba2484c662594127c6983c994 to your computer and use it in GitHub Desktop.
Save james-ni/ccc1b7bba2484c662594127c6983c994 to your computer and use it in GitHub Desktop.
const { test, expect } = require('@playwright/test');
test('basic test', async ({ page }) => {
await page.goto('http://localhost:3000');
await page.click('[name=login]');
await page.fill('[name=email]', '<EMAIL>');
await page.fill('[name=password]', '<PASSWORD>');
await page.click('[name=submit]');
await page.waitForLoadState('networkidle');
const access_token = await page.evaluate("() => window.localStorage.getItem('access_token')")
console.log(access_token)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment