SeleniumBase 1.60.0 contains new methods and lots of optimizations.
New methods:
self.switch_to_newest_window()
self.assert_elements_present(*args, **kwargs)
self.assert_elements(*args, **kwargs)
— Duplicates:self.assert_elements_visible(*args, **kwargs)
The
is very useful because sometimes tests open up a new tab/window, and you need to be able to switch to the newest one easily.self.switch_to_newest_window()
The new assert methods are very useful because now you can assert multiple elements in a single assert statement. (Note the difference between "present" and "visible", as "present" allows for both hidden and visible elements.) The input can either be a list of css selectors, or individual args. Example:
from seleniumbase import BaseCase
class MyTestClass(BaseCase):
def test_assert_list_of_elements(self):
self.open("https://store.xkcd.com/collections/posters")
self.assert_elements_present("head", "style", "script")
self.assert_elements("h1", "h2", "h3")
my_list = ["#top-menu", "#col-main", "#col-widgets"]
self.assert_elements(my_list)
Other changes include:
- Allow the use of
.conftest.py
for configuring
pytest
- Bypass
URLs when doing link-checking for 404s.data:
- Optimize JavaScript calls that require the use of jQuery.
- Optimize Dashboard output and favicon display.
- Update the default version of Geckodriver installed.
- Optimize logging output.
- Optimize some existing methods.
- Update Python dependencies:
—setuptools>=56.0.0;python_version>="3.6"
Full list of additions, changes, and fixes:
- https://github.com/seleniumbase/SeleniumBase/issues/856
- https://github.com/seleniumbase/SeleniumBase/issues/857
- https://github.com/seleniumbase/SeleniumBase/issues/858
- https://github.com/seleniumbase/SeleniumBase/issues/859
- https://github.com/seleniumbase/SeleniumBase/issues/860
- https://github.com/seleniumbase/SeleniumBase/issues/861
- https://github.com/seleniumbase/SeleniumBase/issues/862
- https://github.com/seleniumbase/SeleniumBase/issues/863
- https://github.com/seleniumbase/SeleniumBase/issues/864
- https://github.com/seleniumbase/SeleniumBase/issues/865
- https://github.com/seleniumbase/SeleniumBase/issues/866
- https://github.com/seleniumbase/SeleniumBase/issues/867