Skip to content

Commit c18519b

Browse files
committed
Add a test for asserting text in a PDF file
1 parent bb070be commit c18519b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

examples/test_pdf_asserts.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
from seleniumbase import BaseCase
2+
3+
4+
class PdfTestClass(BaseCase):
5+
6+
def test_assert_pdf_text(self):
7+
8+
# Assert PDF contains the expected text on Page 1
9+
self.assert_pdf_text(
10+
"https://nostarch.com/download/Automate_the_Boring_Stuff_dTOC.pdf",
11+
"Programming Is a Creative Activity", page=1)
12+
13+
# Assert PDF contains the expected text on any of the pages
14+
self.assert_pdf_text(
15+
"https://nostarch.com/download/Automate_the_Boring_Stuff_dTOC.pdf",
16+
"Extracting Text from PDFs")

0 commit comments

Comments
 (0)