Skip to content

Instantly share code, notes, and snippets.

@dadamssg
Created August 30, 2024 20:39
Show Gist options
  • Save dadamssg/1aa5f96383fd6835142da31cbd38e55d to your computer and use it in GitHub Desktop.
Save dadamssg/1aa5f96383fd6835142da31cbd38e55d to your computer and use it in GitHub Desktop.
import { expect, test } from '@playwright/test'
import { login } from './auth'
import { mock } from './utils'
test('can view contacts', async ({ page }) => {
await login({ page })
await mock({
path: '/people',
method: 'post',
once: true,
response: {
data: [
{
id: 'abc',
firstname: 'Sally',
lastname: 'Rogers',
email: '[email protected]'
},
],
},
})
await page.goto('/app/contacts')
const name = page.getByText('Sally Rogers')
await expect(name).toHaveText('Sally Rogers')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment