Closed mdmintz closed 1 year ago
sbase extract-objects [SB_FILE.py]
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.
sbase inject-objects [SB_FILE.py] [OPTIONS]
-c
, --comments
(Add object selectors to the comments.)
Takes the page objects found in the "page_objects.py" file and uses those to replace matching selectors in the selected seleniumbase Python file.
sbase objectify [SB_FILE.py] [OPTIONS]
-c
, --comments
(Add object selectors to the comments.)
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.
(This has the same outcome as combining
extract-objects
with inject-objects
)
sbase revert-objects [SB_FILE.py] [OPTIONS]
-c
, --comments
(Keep existing comments for the lines.)
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.
This was released in 4.12.4
- https://github.com/seleniumbase/SeleniumBase/releases/tag/v4.12.4 - (https://github.com/seleniumbase/SeleniumBase/pull/1731)
Refresh the instant Page Object Generator with newer APIs
In case anyone was not aware how this tool works, if you run:
on this file:
Then
page_objects.py
is created:And you get a file like this that uses the page objects:
To revert changes to that file, you can do this: