diff --git a/ThanhNgan/BT_Buoi1/test_bai_tap.py b/ThanhNgan/BT_Buoi1/test_bai_tap.py new file mode 100644 index 0000000..0589616 --- /dev/null +++ b/ThanhNgan/BT_Buoi1/test_bai_tap.py @@ -0,0 +1,23 @@ +""" +Viết file mới test_bai_tap.py để: +1️⃣ Truy cập vào trang web yêu thích (ví dụ: shopee.vn, vnexpress.net, công ty bạn). +2️⃣ Kiểm tra tiêu đề trang có đúng mong đợi. +3️⃣ Kiểm tra URL trang web. +""" +from playwright.sync_api import Page, expect +import re + +def test_check_title(page: Page): + print("Mở trình duyệt shopee...") + + page.goto("https://www.apple.com/vn/") + + # Check title + expect(page).to_have_title(re.compile(r'Apple \(Việt Nam\)')) + print("Title is correct") + + # Check url + expect(page).to_have_url(re.compile('https://www.apple.com/vn/')) + print("URL is correct") + + diff --git a/ThanhNgan/Reports/BT_Buoi1/report.html b/ThanhNgan/Reports/BT_Buoi1/report.html new file mode 100644 index 0000000..d6aabb7 --- /dev/null +++ b/ThanhNgan/Reports/BT_Buoi1/report.html @@ -0,0 +1,1091 @@ + + +
+ +Report generated on 11-Oct-2025 at 18:05:18 by pytest-html + v4.1.1
+1 test took 00:00:03.
+(Un)check the boxes to filter the results.
+Result | +Test | +Duration | +Links | +
---|