Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e7ca064

Browse files
committed
Update example info
1 parent 7859ed4 commit e7ca064

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

‎examples/my_first_test.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ def test_swag_labs(self):
6262
# If you don't specify a "timeout", a default timeout is used.
6363
# Default timeouts are configured in seleniumbase/config/settings.py
6464
#
65-
# 3. SeleniumBase methods often perform multiple actions. For example,
66-
# self.type(SELECTOR, TEXT) will do the following:
67-
# * Wait for the element to be visible
68-
# * Wait for the element to be interactive
69-
# * Clear the text field
70-
# * Type in the new text
71-
# * Press Enter/Return if the text ends in "\n": {element.submit()}
65+
# 3. SeleniumBase methods often perform multiple actions.
66+
# Example: self.type(SELECTOR, TEXT) does the following:
67+
# * Waits for the element to be visible
68+
# * Waits for the element to be interactive
69+
# * Clears the text field
70+
# * Types in the new text
71+
# * Presses Enter/Return if the text ends in "\n": element.submit()
7272
#
7373
# 4. There are duplicate method names that exist for the same method:
7474
# (This makes it easier to switch over from other test frameworks.)
@@ -116,6 +116,12 @@ def test_swag_labs(self):
116116
# text = self.get_text("h2").strip()
117117
# self.assert_true("xkcd.com".strip() == text)
118118
# ]
119+
# Is also the same as:
120+
# [
121+
# element = self.find_element("h2")
122+
# text = element.text.strip()
123+
# self.assert_true("xkcd.com".strip() == text)
124+
# ]
119125
#
120126
# Example 3:
121127
# [
@@ -129,7 +135,7 @@ def test_swag_labs(self):
129135
#
130136
# 6. self.assert_exact_text(TEXT) ignores leading and trailing
131137
# whitespace in the TEXT assertion.
132-
# So, self.assert_exact_text("Some Text") will find [" Some Text "].
138+
# So, self.assert_exact_text("Some Text") accepts [" Some Text "].
133139
#
134140
# 7. self.js_click(SELECTOR) can be used to click on hidden elements.
135141
#

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /