-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2085 from seleniumbase/enhancements-and-bug-fixes
Enhancements and bug fixes
- Loading branch information
Showing
22 changed files
with
976 additions
and
227 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,22 @@ | ||
"""Driver() test. Runs with "python". (pytest not needed).""" | ||
from seleniumbase import Driver | ||
from seleniumbase import js_utils | ||
from seleniumbase import page_actions | ||
|
||
# Example with options. (Also accepts command-line options.) | ||
driver = Driver(browser="chrome", headless=False) | ||
try: | ||
driver.get("https://seleniumbase.io/apps/calculator") | ||
page_actions.wait_for_element(driver, '[id="4"]').click() | ||
page_actions.wait_for_element(driver, '[id="2"]').click() | ||
page_actions.wait_for_text(driver, "42", "#output") | ||
js_utils.highlight_with_js(driver, "#output", loops=6) | ||
driver.click('[id="4"]') | ||
driver.click('[id="2"]') | ||
driver.assert_text("42", "#output") | ||
driver.highlight("#output", loops=6) | ||
finally: | ||
driver.quit() | ||
|
||
# Example 2 using default args or command-line options | ||
driver = Driver() | ||
try: | ||
driver.get("https://seleniumbase.github.io/demo_page") | ||
js_utils.highlight_with_js(driver, "h2", loops=5) | ||
by_css = "css selector" | ||
driver.find_element(by_css, "#myTextInput").send_keys("Automation") | ||
driver.find_element(by_css, "#checkBox1").click() | ||
js_utils.highlight_with_js(driver, "img", loops=5) | ||
driver.highlight("h2") | ||
driver.type("#myTextInput", "Automation") | ||
driver.click("#checkBox1") | ||
driver.highlight("img", loops=6) | ||
finally: | ||
driver.quit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
"""Can run with "python". (pytest not needed).""" | ||
from seleniumbase import js_utils | ||
from seleniumbase import page_actions | ||
from seleniumbase import DriverContext | ||
|
||
# Driver Context Manager - (By default, browser="chrome". Lots of options) | ||
with DriverContext() as driver: | ||
driver.get("https://seleniumbase.github.io/") | ||
js_utils.highlight_with_js(driver, 'img[alt="SeleniumBase"]', loops=6) | ||
driver.highlight('img[alt="SeleniumBase"]', loops=6) | ||
|
||
with DriverContext(browser="chrome", incognito=True) as driver: | ||
driver.get("https://seleniumbase.io/apps/calculator") | ||
page_actions.wait_for_element(driver, '[id="4"]').click() | ||
page_actions.wait_for_element(driver, '[id="2"]').click() | ||
page_actions.wait_for_text(driver, "42", "#output") | ||
js_utils.highlight_with_js(driver, "#output", loops=6) | ||
driver.click('[id="4"]') | ||
driver.click('[id="2"]') | ||
driver.assert_text("42", "#output") | ||
driver.highlight("#output", loops=6) | ||
|
||
with DriverContext() as driver: | ||
driver.get("https://seleniumbase.github.io/demo_page") | ||
js_utils.highlight_with_js(driver, "h2", loops=5) | ||
by_css = "css selector" | ||
driver.find_element(by_css, "#myTextInput").send_keys("Automation") | ||
driver.find_element(by_css, "#checkBox1").click() | ||
js_utils.highlight_with_js(driver, "img", loops=5) | ||
driver.highlight("h2") | ||
driver.type("#myTextInput", "Automation") | ||
driver.click("#checkBox1") | ||
driver.highlight("img", loops=6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# seleniumbase package | ||
__version__ = "4.18.1" | ||
__version__ = "4.18.2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.