MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / test_assert_pdf_text

Method test_assert_pdf_text

examples/test_pdf_asserts.py:6–22  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4
5class PDFAssertTests(BaseCase):
6 def test_assert_pdf_text(self):
7 self.goto("data:,")
8 if self.headless:
9 self.skip("Skip this test in headless mode!")
10 if not self.undetectable or not self.external_pdf:
11 self.activate_cdp_mode(external_pdf=True)
12 # Assert PDF contains the expected text on Page 1
13 self.assert_pdf_text(
14 "https://nostarch.com/download/Automate_the_Boring_Stuff_dTOC.pdf",
15 "Programming Is a Creative Activity",
16 page=1,
17 )
18 # Assert PDF contains the expected text on any of the pages
19 self.assert_pdf_text(
20 "https://nostarch.com/download/Automate_the_Boring_Stuff_dTOC.pdf",
21 "Extracting Text from PDFs",
22 )

Callers

nothing calls this directly

Calls 4

skipMethod · 0.80
assert_pdf_textMethod · 0.80
gotoMethod · 0.45
activate_cdp_modeMethod · 0.45

Tested by

no test coverage detected