Skip to content

Commit bed9dad

Browse files
committed
Update documentation
1 parent 7e2c566 commit bed9dad

File tree

4 files changed

+47
-22
lines changed

4 files changed

+47
-22
lines changed

examples/behave_bdd/ReadMe.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@ Feature: SeleniumBase scenarios for the RealWorld App # features/realworld.featu
1616

1717
Scenario: Verify RealWorld App (log in / sign out) # features/realworld.feature:3
1818
Given Open "seleniumbase.io/realworld/login" # ../../sbase/steps.py:10
19-
And Clear Session Storage # ../../sbase/steps.py:391
20-
When Type "demo_user" into "#username" # ../../sbase/steps.py:28
21-
And Type "secret_pass" into "#password" # ../../sbase/steps.py:28
22-
And Do MFA "GAXG2MTEOR3DMMDG" into "#totpcode" # ../../sbase/steps.py:194
23-
Then Assert exact text "Welcome!" in "h1" # ../../sbase/steps.py:85
24-
And Highlight "img#image1" # ../../sbase/steps.py:95
25-
And Click 'a:contains("This Page")' # ../../sbase/steps.py:19
26-
And Save screenshot to logs # ../../sbase/steps.py:120
27-
When Click link "Sign out" # ../../sbase/steps.py:104
28-
Then Assert element 'a:contains("Sign in")' # ../../sbase/steps.py:60
29-
And Assert text "You have been signed out!" # ../../sbase/steps.py:77
19+
And Clear Session Storage # ../../sbase/steps.py:613
20+
When Type "demo_user" into "#username" # ../../sbase/steps.py:40
21+
And Type "secret_pass" into "#password" # ../../sbase/steps.py:40
22+
And Do MFA "GAXG2MTEOR3DMMDG" into "#totpcode" # ../../sbase/steps.py:309
23+
Then Assert exact text "Welcome!" in "h1" # ../../sbase/steps.py:157
24+
And Highlight "img#image1" # ../../sbase/steps.py:171
25+
And Click 'a:contains("This Page")' # ../../sbase/steps.py:27
26+
And Save screenshot to logs # ../../sbase/steps.py:226
27+
When Click link "Sign out" # ../../sbase/steps.py:182
28+
Then Assert element 'a:contains("Sign in")' # ../../sbase/steps.py:120
29+
And Assert text "You have been signed out!" # ../../sbase/steps.py:145
3030
✅ Scenario Passed!
3131

3232
- Dashboard: /Users/michael/github/SeleniumBase/examples/behave_bdd/dashboard.html

help_docs/customizing_test_runs.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,34 @@ The code above will leave your browser window open in case there's a failure. (p
277277
🎛️ There are times when you'll want to combine various command-line options for added effect.
278278
For instance, the multi-process option, ``-n8``, can be customized by adding:
279279
``--dist=loadscope`` or ``--dist=loadfile`` to it.
280-
Here's more info on that, as taken from [pytest-xdist](https://pypi.org/project/pytest-xdist/):
280+
There's more info on that here: [pytest-xdist](https://pypi.org/project/pytest-xdist/2.5.0/):
281281

282282
* ``-n8 --dist=loadscope``: Tests are grouped by module for test functions and by class for test methods. Groups are distributed to available workers as whole units. This guarantees that all tests in a group run in the same process. This can be useful if you have expensive module-level or class-level fixtures. Grouping by class takes priority over grouping by module.
283283

284284
* ``-n8 --dist=loadfile``: Tests are grouped by their containing file. Groups are distributed to available workers as whole units. This guarantees that all tests in a file run in the same worker.
285285

286+
<details>
287+
<summary> ▶️ <code>-n8 --dist=loadgroup</code> (<b>click to expand</b>)</summary>
288+
<div>
289+
290+
* Tests are grouped by the ``xdist_group`` mark. Groups are distributed to available workers as whole units. This guarantees that all tests with same ``xdist_group`` name run in the same worker.
291+
292+
```python
293+
@pytest.mark.xdist_group(name="group1")
294+
def test_1():
295+
pass
296+
297+
class Test:
298+
@pytest.mark.xdist_group("group1")
299+
def test_2():
300+
pass
301+
```
302+
303+
> This makes ``test_1`` and ``Test::test_2`` run in the same worker. Tests without the ``xdist_group`` mark are distributed normally.
304+
305+
</div>
306+
</details>
307+
286308
🎛️ You might also want to combine multiple options at once. For example:
287309

288310
```bash

help_docs/how_it_works.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class TestMFALogin(BaseCase):
4646
👁️🔎 Here are some examples of running tests with ``pytest``:
4747

4848
```bash
49-
pytest --headless --rs --dashboard --html=report.html -v -n=4
49+
pytest --headless -n8 --dashboard --html=report.html -v --rs --crumbs
5050
pytest test_mfa_login.py
5151
pytest -m marker2
5252
pytest offline_examples/

integrations/behave/ReadMe.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,18 @@ Dashboard: /Users/michael/github/SeleniumBase/examples/behave_bdd/dashboard.html
1313
Feature: SeleniumBase scenarios for the RealWorld App # features/realworld.feature:1
1414

1515
Scenario: Verify RealWorld App (log in / sign out) # features/realworld.feature:3
16-
Given Open the RealWorld Login Page # steps/real_world.py:4
17-
When Login to the RealWorld App # steps/real_world.py:11
18-
Then Assert exact text "Welcome!" in "h1" # steps/real_world.py:89
19-
When Highlight element "img#image1" # steps/real_world.py:19
20-
And Click element 'a:contains("This Page")' # steps/real_world.py:29
21-
Then Save a screenshot to the logs # steps/real_world.py:49
22-
When Click link "Sign out" # steps/real_world.py:39
23-
Then Assert element 'a:contains("Sign in")' # steps/real_world.py:55
24-
And Assert text "You have been signed out!" # steps/real_world.py:79
16+
Given Open "seleniumbase.io/realworld/login" # ../../sbase/steps.py:10
17+
And Clear Session Storage # ../../sbase/steps.py:613
18+
When Type "demo_user" into "#username" # ../../sbase/steps.py:40
19+
And Type "secret_pass" into "#password" # ../../sbase/steps.py:40
20+
And Do MFA "GAXG2MTEOR3DMMDG" into "#totpcode" # ../../sbase/steps.py:309
21+
Then Assert exact text "Welcome!" in "h1" # ../../sbase/steps.py:157
22+
And Highlight "img#image1" # ../../sbase/steps.py:171
23+
And Click 'a:contains("This Page")' # ../../sbase/steps.py:27
24+
And Save screenshot to logs # ../../sbase/steps.py:226
25+
When Click link "Sign out" # ../../sbase/steps.py:182
26+
Then Assert element 'a:contains("Sign in")' # ../../sbase/steps.py:120
27+
And Assert text "You have been signed out!" # ../../sbase/steps.py:145
2528
✅ Scenario Passed!
2629

2730
- Dashboard: /Users/michael/github/SeleniumBase/examples/behave_bdd/dashboard.html

0 commit comments

Comments
 (0)