Changelogs » Seleniumbase

Seleniumbase

4.4.1


      

1.24.3


      

1.23.10

Use pytest>=4.5.0
* Also ignore pytest warnings such as PytestUnknownMarkWarning, which caused warnings to appear for test-specific markers

1.23.9

Update pytest version and other requirements
* pytest>=4.4.2
* pytest-cov>=2.7.1
* pluggy>=0.11.0
* pip>=19.1.1

1.23.8

Update requirements:
* Add ``pyopenssl`` with version >=19.0.0 to prevent SSL errors.
(See https://stackoverflow.com/a/29099439)
* Make sure ``pip`` installs with version >=19.1.1
(Unrelated, but allows using developer mode installs)

1.23.7

Update urllib3 version:

1.23.6

Editable mode install update.
Due to https://github.com/pytest-dev/pytest/issues/5167 (pip 19.1 prevents pytest from being used in editable mode), I'm taking out the default pip editable mode install.
All this really means now is that now you should run ``python setup.py develop`` after installing the requirements.

1.23.5

Update the tool that generates page objects from selectors

1.23.4

* Use ``requests`` instead of ``urllib3`` for webdriver downloads

1.23.3

Add multithreading to link checking; and other improvements
* Add multithreading to link checking -> ``self.assert_no_404_errors()`` now works faster
* Add pytest-ordering
* Fix method that calculates full links from partial links
* Add slow-scrolling to demo_mode asserts
* Add Swag Labs test suite to the examples

1.23.2

* Update Firefox profile settings
* Update urllib3 version

1.23.1


      

1.23.0

Several minor updates:
* Screenshots update
* Parameter update
* .gitignore update
* utf-8 encoding
* Docs update

1.22.9

Add ability to save page elements as screenshot files

1.22.8

Disable pytest's cacheprovider plugin

1.22.7

Some minor updates:
* Use log-level 3 for default Chrome logging
* Use pytest-forked>=1.0.2
* Update Azure test pipeline

1.22.6

Update test reports
* Some changes to the way screenshots are saved for the reports

1.22.5

Allow passing a boolean value to desired capabilities
* All formats as of now:
``'KEY': 'VALUE'``
``'KEY': True``
``'KEY': False``
``caps['KEY'] = "VALUE"``
``caps['KEY'] = True``
``caps['KEY'] = False``
(Each pair must be on a separate line. You can interchange single and double quotes.)
See https://github.com/seleniumbase/SeleniumBase/tree/master/examples/capabilities for the full ReadMe and sample capabilities files.

1.22.4

Refactor visual/layout testing

1.22.3

Add pytest-metadata to the requirements

1.22.2

Small Fixes:
* Prevent PytestDeprecationWarning
* More efficient screenshots for logs

1.22.1

Fix method that finds all links on a web page
* Ignore parsing urls on pages that don't have ``://`` in the url (ex: ``about:blank``)

1.22.0

Automated Visual Testing
* Add ``self.check_window(name, level, baseline)`` method for automated visual testing
* Add methods for processing links and status codes on web pages:

self.get_unique_links()
self.get_link_status_code(link, allow_redirects=False, timeout=5)
self.assert_no_404_errors()
self.print_unique_links_with_status_codes()

* Update pytest versioning

More info on ``self.check_window(name="default", level=0, baseline=False)``

***  Automated Visual Testing with SeleniumBase  ***

The first time a test calls self.check_window() for a unique "name"
parameter provided, it will set a visual baseline, meaning that it
creates a folder, saves the URL to a file, saves the current window
screenshot to a file, and creates the following three files
with the listed data saved:
tags_level1.txt  ->  HTML tags from the window
tags_level2.txt  ->  HTML tags + attributes from the window
tags_level3.txt  ->  HTML tags + attributes/values from the window

Baseline folders are named based on the test name and the name
parameter passed to self.check_window(). The same test can store
multiple baseline folders.

If the baseline is being set/reset, the "level" doesn't matter.

After the first run of self.check_window(), it will compare the
HTML tags of the latest window to the one from the initial run.
Here's how the level system works:
* level=0 ->
DRY RUN ONLY - Will perform a comparison to the baseline, and
print out any differences that are found, but
won't fail the test even if differences exist.
* level=1 ->
HTML tags are compared to tags_level1.txt
* level=2 ->
HTML tags are compared to tags_level1.txt and
HTML tags/attributes are compared to tags_level2.txt
* level=3 ->
HTML tags are compared to tags_level1.txt and
HTML tags + attributes are compared to tags_level2.txt and
HTML tags + attributes/values are compared to tags_level3.txt
As shown, Level-3 is the most strict, Level-1 is the least strict.
If the comparisons from the latest window to the existing baseline
don't match, the current test will fail, except for Level-0 tests.

You can reset the visual baseline on the command line by using:
--visual_baseline
As long as "--visual_baseline" is used on the command line while
running tests, the self.check_window() method cannot fail because
it will rebuild the visual baseline rather than comparing the html
tags of the latest run to the existing baseline. If there are any
expected layout changes to a website that you're testing, you'll
need to reset the baseline to prevent unnecessary failures.

self.check_window() will fail with "Page Domain Mismatch Failure"
if the page domain doesn't match the domain of the baseline.

If you want to use self.check_window() to compare a web page to
a later version of itself from within the same test run, you can
add the parameter "baseline=True" to the first time you call
self.check_window() in a test to use that as the baseline. This
only makes sense if you're calling self.check_window() more than
once with the same name parameter in the same test.

Automated Visual Testing with self.check_window() is not very
effective for websites that have dynamic content that changes
the layout and structure of web pages. For those, you're much
better off using regular SeleniumBase functional testing.

Example usage:
self.check_window(name="testing", level=0)
self.check_window(name="xkcd_home", level=1)
self.check_window(name="github_page", level=2)
self.check_window(name="wikipedia_page", level=3)

1.21.9

Add a command-line option to disable the Content Security Policy.
(The CSP may prevent SeleniumBase custom JavaScript abilities from loading on various web pages.)

1.21.8

Fix browser extension loading for PyPI installations:
* Include browser extensions as part of PyPI package data

1.21.7

* Update ad-blocker rules

1.21.6

Disable the Content Security Policy of websites by default (on Chrome and Firefox)
(If running tests on headless Chrome, the existing Content Security Policy will remain.)

1.21.5

Add methods for setting and removing element attributes:
* Add ``self.set_attribute(selector, attribute, value)``
* Add ``self.remove_attribute(selector, attribute)``

1.21.4

* Save exported website tours to the "tours_exported" folder
* Update tour examples
* Set flake8 version to 3.7.7

1.21.3

Add a command-line option to archive old log files rather than deleting them.

If the option is set, log files from the latest_logs folder will get moved to the archived_logs folder for storage. Otherwise, any existing logs in the latest_logs folder will be deleted at the start of the next test run.

Usage: (on the command line when running tests)
* ``--archive_logs``

1.21.2

Add the ability to save screenshots at the end of tests.
This adds the feature for passing tests. (This feature already existed for failing tests automatically.)
Check the latest_logs folder for the images.

Usage: (on the command line when running tests)
* ``--save_screenshot``

The screenshot will be taken right before the browser is closed.

1.21.1

Add "limit" argument to methods that return or click multiple elements.
Updated methods:  ("0" means no limit)
* ``self.find_elements(selector, by=By.CSS_SELECTOR, limit=0)``
* ``self.find_visible_elements(selector, by=By.CSS_SELECTOR, limit=0)``
* ``self.click_visible_elements(selector, by=By.CSS_SELECTOR, limit=0)``

Example:
``self.click_visible_elements('[type="checkbox"]', limit=5)``
(Click the first 5 visible checkboxes on a page)