Releases: seleniumbase/SeleniumBase
Add a command-line option to archive old log files rather than deleting them
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
Add the ability to save screenshots at the end of tests
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.
Add "limit" argument to methods that return or click multiple elements
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)
Add the ability to set the User-Agent for the browser
Add the ability to set the User-Agent for the browser:
- Usage:
--agent="USER-AGENT STRING"
Example:
pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7412.EU"
Other changes:
- Fix the Docker integration
- Update console scripts for page-object manipulation
- Update several ReadMe files
New console scripts for manipulating page objects
New console scripts for manipulating page objects:
"seleniumbase" ...
+ "extract-objects"
Usage:
seleniumbase extract-objects [SELENIUMBASE_PYTHON_FILE]
Output:
Creates page objects based on selectors found in a
seleniumbase Python file and saves those objects to the
"page_objects.py" file in the same folder as the tests.
+ "inject-objects"
Usage:
seleniumbase inject-objects [SELENIUMBASE_PYTHON_FILE]
Options:
-c, --comments (Add object selectors to the comments.)
(Default: No added comments.)
Output:
Takes the page objects found in the "page_objects.py"
file and uses those to replace matching selectors in
the selected seleniumbase Python file.
+ "objectify"
Usage:
seleniumbase objectify [SELENIUMBASE_PYTHON_FILE]
Options:
-c, --comments (Add object selectors to the comments.)
(Default: No added comments.)
Output:
A modified version of the file where the selectors
have been replaced with variable names defined in
"page_objects.py", supporting the Page Object Pattern.
(seleniumbase "objectify" has the same outcome as
combining "extract-objects" with "inject-objects")
+ "revert-objects"
Usage:
seleniumbase revert-objects [SELENIUMBASE_PYTHON_FILE]
Options:
-c, --comments (Keep existing comments for the lines.)
(Default: No comments are kept.)
Output:
Reverts the changes made by "seleniumbase objectify" or
"seleniumbase inject-objects" when run against a
seleniumbase Python file. Objects will get replaced by
selectors stored in the "page_objects.py" file.
Update webdriver installation script
Update webdriver installation script:
seleniumbase install chromedriver
will now install chromedriver v2.46, except on Linux machines, which may be using older versions of Chromeseleniumbase install geckodriver
will now install v0.24.0 (for Firefox)seleniumbase install operadriver
will now install v.2.40
Other changes:
- Update starting browser dimensions
Update requirements
Update requirements:
- Update pytest to v4.3.0
Clone an existing method with an additional name
Clone an existing method with an additional name:
- Add
self.assert_element_visible(CSS_SELECTOR)
, which does the same thing asself.assert_element(CSS_SELECTOR)
.
Adding exact text methods and other improvements
Adding exact text methods and other improvements:
- Add
self.assert_exact_text()
- Add
self.wait_for_exact_text_visible()
- Update pytest version to 4.2.1
- Adding more reliability to some methods
- Fix a bug with text assertion
Fix Python 2 compatibility
Fix Python 2 compatibility:
- Use more-itertools version >=5.0.0,<6.0.0