Skip to content

Instantly share code, notes, and snippets.

@PCreations
Created July 17, 2024 08:23
Show Gist options
  • Save PCreations/d38bca921ade81b047c8debe88722483 to your computer and use it in GitHub Desktop.
Save PCreations/d38bca921ade81b047c8debe88722483 to your computer and use it in GitHub Desktop.
84d82ebad90f.diff
-3,8 +3,9 @@ import { test, expect } from '@playwright/test';
test.describe('Feature: Adding a book', () => {
test('Example: User can add a book', async ({ page }) => {
await page.goto('http://localhost:3000');
+ const rand = Math.floor(Math.random() * 1000000);
- await page.getByLabel(/title/i).fill('Clean Code');
+ await page.getByLabel(/title/i).fill(`Clean Code ${rand}`);
await page.getByText(/add book/i).click();
await expect(page.getByText(/book added/i)).toBeVisible();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment