📚 Cheatsheet

Une collection organisée de snippets de code pour accélérer votre développement. Parcourez, recherchez et copiez en un clic.

Snippets 7

Retour
Playwright - Assertion 'toBeVisible'
Facile
await expect(page.locator('.modal')).toBeVisible();
Playwright - Assertion 'toHaveText'
Facile
await expect(page.locator('h1')).toHaveText('Bienvenue');
Playwright - Attendre un élément
Intermédiaire
await page.waitForSelector('.element-charge');
Playwright - Cliquer sur un élément
Facile
await page.click('text=Soumettre');
Playwright - Cocher une case
Facile
await page.check('input[type=checkbox]');
Playwright - Saisir du texte
Facile
await page.fill('#email', 'test@example.com');
Playwright - Sélectionner une option dans un 'select'
Facile
await page.selectOption('select#colors', 'blue');