Skip to content

Commit

Permalink
Update example info
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmintz committed Feb 12, 2024
1 parent 7859ed4 commit e7ca064
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions examples/my_first_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ def test_swag_labs(self):
# If you don't specify a "timeout", a default timeout is used.
# Default timeouts are configured in seleniumbase/config/settings.py
#
# 3. SeleniumBase methods often perform multiple actions. For example,
# self.type(SELECTOR, TEXT) will do the following:
# * Wait for the element to be visible
# * Wait for the element to be interactive
# * Clear the text field
# * Type in the new text
# * Press Enter/Return if the text ends in "\n": {element.submit()}
# 3. SeleniumBase methods often perform multiple actions.
# Example: self.type(SELECTOR, TEXT) does the following:
# * Waits for the element to be visible
# * Waits for the element to be interactive
# * Clears the text field
# * Types in the new text
# * Presses Enter/Return if the text ends in "\n": element.submit()
#
# 4. There are duplicate method names that exist for the same method:
# (This makes it easier to switch over from other test frameworks.)
Expand Down Expand Up @@ -116,6 +116,12 @@ def test_swag_labs(self):
# text = self.get_text("h2").strip()
# self.assert_true("xkcd.com".strip() == text)
# ]
# Is also the same as:
# [
# element = self.find_element("h2")
# text = element.text.strip()
# self.assert_true("xkcd.com".strip() == text)
# ]
#
# Example 3:
# [
Expand All @@ -129,7 +135,7 @@ def test_swag_labs(self):
#
# 6. self.assert_exact_text(TEXT) ignores leading and trailing
# whitespace in the TEXT assertion.
# So, self.assert_exact_text("Some Text") will find [" Some Text "].
# So, self.assert_exact_text("Some Text") accepts [" Some Text "].
#
# 7. self.js_click(SELECTOR) can be used to click on hidden elements.
#
Expand Down

0 comments on commit e7ca064

Please sign in to comment.