Skip to content

Instantly share code, notes, and snippets.

@up1
Last active March 2, 2024 05:01
Show Gist options
  • Save up1/68e7509ffecca7dccb4c0ad5cef31de2 to your computer and use it in GitHub Desktop.
Save up1/68e7509ffecca7dccb4c0ad5cef31de2 to your computer and use it in GitHub Desktop.
Playwright 1.42.0
test('test customer login', { tag: ['@fast', '@login'] }, async ({ page }) => {
// ...
});
// ทำการ run test ด้วย tag
$npx playwright test --grep @fast
import { test, expect } from '@playwright/test';
test('test login page', {
annotation: {
type: 'issue',
description: 'https://github.com/microsoft/playwright/issues/23180',
},
}, async ({ page }) => {
// ...
});
test.describe('chromium only', () => {
test.skip(({ browserName }) => browserName !== 'chromium', 'Chromium only!');
test.beforeAll(async () => {
// This hook is only run in Chromium.
});
test('test 1', async ({ page }) => {
// This test is only run in Chromium.
});
test('test 2', async ({ page }) => {
// This test is only run in Chromium.
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment