Skip to content

Commit 4efd4df

Browse files
committed
Add a test for verifying PDF testing with Chinese characters
1 parent 9c8e97d commit 4efd4df

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

examples/test_chinese_pdf.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# -*- coding: utf-8 -*-
2+
from seleniumbase import BaseCase
3+
4+
5+
class ChinesePdfTestClass(BaseCase):
6+
7+
def test_chinese_pdf(self):
8+
9+
pdf = ('https://github.com/seleniumbase/SeleniumBase/'
10+
'files/3895614/unittest.pdf')
11+
12+
# Get and print PDF text
13+
pdf_text = self.get_pdf_text(pdf, page=2)
14+
print("\n" + pdf_text)
15+
16+
# Assert PDF contains the expected text on Page 2
17+
self.assert_pdf_text(pdf, "个测试类", page=2)
18+
19+
# Assert PDF contains the expected text on any of the pages
20+
self.assert_pdf_text(pdf, "运行单元测试")
21+
self.assert_pdf_text(pdf, "等待测试结束后显示所有结果")
22+
self.assert_pdf_text(pdf, "测试的执行跟方法的顺序没有关系")

0 commit comments

Comments
 (0)