Last active
March 30, 2026 14:20
-
-
Save minhphong306/6ed5c330dbb9182d93a46a62f8ea164b to your computer and use it in GitHub Desktop.
test.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { test, expect } from '@playwright/test'; | |
| test.describe("Test suite: Material site", async () => { | |
| test.beforeAll(async () => { | |
| console.log("BeforeAll: Trước khi tất cả các test chạy"); | |
| }); | |
| test.afterAll(async () => { | |
| console.log("AfterAll: sau khi tất cả các test chạy"); | |
| }) | |
| test.beforeEach(async () => { | |
| console.log("BeforeEach: Chạy trước khi test chạy"); | |
| }); | |
| test.afterEach(async () => { | |
| console.log("AfterEach: Sau khi test chạy xong"); | |
| // Có thể verify, không hạn chế | |
| }); | |
| test("Test 1: User registration page", async () => { | |
| await test.step("Step 2: Click 'User registration'", async () => { | |
| console.log("Step 2: Click 'User registration ") | |
| }); | |
| await test.step("Step 3: Fill information", async () => { | |
| console.log("Step 3: Fill information"); | |
| }); | |
| }); | |
| test("Test 2: Product page", async () => { | |
| await test.step("Step 2: Click 'Product Page'", async () => { | |
| console.log("Step 2: Click 'Product Page'"); | |
| }); | |
| await test.step("Step 3: Add products to cart", async () => { | |
| console.log("Step 3: Add products to cart"); | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment