Skip to content

Releases: seleniumbase/SeleniumBase

Add get_pdf_text() and use that in assert_pdf_text()

25 Nov 03:49
b562ddc
Compare
Choose a tag to compare

Add get_pdf_text() and use that in assert_pdf_text()

  • get_pdf_text(pdf, page=None)
    Gets the text from a PDF (The PDF can be either a URL or a path on the local file system. If a Page number is provided, uses that page, otherwise gets everything.)

  • assert_pdf_text(pdf, text, page=None)
    Asserts that certain text appears in a PDF (The PDF can be either a URL or a path on the local file system. If a Page number is provided, only checks that page, otherwise all pages get scanned for the expected text.)

Create the downloads_folder for PDF-testing use

23 Nov 19:47
a4f120e
Compare
Choose a tag to compare

Create the downloads_folder for PDF-testing use

  • When verifying text in a PDF that’s on the web, SeleniumBase will first download it to the downloads_folder. From there, it's easier to scan with Python for verification.
  • Continuation of v1.33.2 -> Add the assert_pdf_text() method for asserting text in a PDF file

Add methods for handling cookies on web pages

23 Nov 06:58
681ba40
Compare
Choose a tag to compare

Add methods for handling cookies on web pages

self.save_cookies(name="cookies.txt")
self.load_cookies(name="cookies.txt")
self.delete_all_cookies()
self.delete_saved_cookies(name="cookies.txt")

(Cookies get saved to the "./saved_cookies/" folder.)

Add assert_pdf_text() method for asserting PDF text

22 Nov 07:24
b478eb3
Compare
Choose a tag to compare

Add the assert_pdf_text() method for asserting text in a PDF file

Refactor and minify Messenger CSS resources

20 Nov 06:12
10e838e
Compare
Choose a tag to compare

Refactor and minify Messenger CSS resources

  • Refactor and minify Messenger resources
  • Add a double_click() test
  • Update "pytest" and "parameterized" dependencies

Add the inspect_html() method

19 Nov 08:17
6958e9b
Compare
Choose a tag to compare

Add the inspect_html() method

This uses https://cdnjs.com/libraries/html-inspector
and https://github.com/philipwalton/html-inspector

Sample code:

from seleniumbase import BaseCase

class MyTestClass(BaseCase):
    def test_html_inspector(self):
        self.open("https://xkcd.com/1144/")
        self.inspect_html()

Run command:

pytest test_inspect_html.py

Sample output:

* HTML Inspection Results: https://xkcd.com/1144/
X - https://xkcd.com/usNews - Failed to load resource: the server responded with a status of 404 (Not Found)
X - 'property' is not a valid attribute of the <meta> element.
X - Do not use <div> or <span> elements without any attributes.
X - The 'alt' attribute is required for <img> elements.
X - The 'border' attribute is no longer valid on the <img> element and should not be used.
X - 'srcset' is not a valid attribute of the <img> element.
X - The <center> element is obsolete and should not be used.
X - <script> elements should appear right before the closing </body> tag for optimal performance.
X - The id 'comicLinks' appears more than once in the document.
* (See the Console output for details!)

Update pytest, portalocker, and improve error-handling

16 Nov 22:16
c5d2c04
Compare
Choose a tag to compare

Update pytest, portalocker, and improve error-handling

  • Update pytest
  • Update portalocker
  • Allow the update_text() method to handle ints and floats as text
  • Improve some error messages if/when they occur

Update methods

11 Nov 05:04
d7011a2
Compare
Choose a tag to compare

Update methods

  • Add the save_page_source(file_name) method
  • Update tqdm dependency to >= 4.38.0

Add "Slow Mode"

07 Nov 06:41
8dc34a1
Compare
Choose a tag to compare

Add "Slow Mode"

  • Add "Slow Mode". Usage: --slow
  • Upgrade the "six" dependency to ">=1.13.0"

Slow Mode is similar to Demo Mode, except that SeleniumBase skips highlighting the elements being interacted with.

Update pytest discovery rules

05 Nov 07:10
f7d0d9c
Compare
Choose a tag to compare

Update pytest discovery rules

  • python_files = test_*.py *_test.py *_tests.py *_suite.py
  • python_classes = Test* *Test* *Test *Tests *Suite
  • python_functions = test_*