Skip to content

Commit 88b19cd

Browse files
committed
Update Markdown format in the docs
1 parent 9ddd80b commit 88b19cd

File tree

12 files changed

+77
-77
lines changed

12 files changed

+77
-77
lines changed

README.md

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ class MyTestClass(BaseCase):
134134

135135
<p align="left">📗 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_coffee_cart.py" target="_blank">test_coffee_cart.py</a>, which verifies an e-commerce site:</p>
136136

137-
```bash
137+
```zsh
138138
pytest test_coffee_cart.py --demo
139139
```
140140

@@ -148,7 +148,7 @@ pytest test_coffee_cart.py --demo
148148

149149
<p align="left">📗 Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py" target="_blank">test_demo_site.py</a>, which covers several actions:</p>
150150

151-
```bash
151+
```zsh
152152
pytest test_demo_site.py
153153
```
154154

@@ -296,7 +296,7 @@ finally:
296296

297297
🔵 **How to install ``seleniumbase`` from PyPI:**
298298

299-
```bash
299+
```zsh
300300
pip install seleniumbase
301301
```
302302

@@ -306,22 +306,22 @@ pip install seleniumbase
306306

307307
🔵 **How to install ``seleniumbase`` from a GitHub clone:**
308308

309-
```bash
309+
```zsh
310310
git clone https://github.com/seleniumbase/SeleniumBase.git
311311
cd SeleniumBase/
312312
pip install -e .
313313
```
314314

315315
🔵 **How to upgrade an existing install from a GitHub clone:**
316316

317-
```bash
317+
```zsh
318318
git pull
319319
pip install -e .
320320
```
321321

322322
🔵 **Type ``seleniumbase`` or ``sbase`` to verify that SeleniumBase was installed successfully:**
323323

324-
```bash
324+
```zsh
325325
___ _ _ ___
326326
/ __| ___| |___ _ _ (_)_ _ _ __ | _ ) __ _ ______
327327
\__ \/ -_) / -_) ' \| | \| | ' \ | _ \/ _` (_-< -_)
@@ -375,7 +375,7 @@ pip install -e .
375375
<details>
376376
<summary> ▶️ Here's sample output from a chromedriver download. (<b>click to expand</b>)</summary>
377377
378-
```bash
378+
```zsh
379379
*** chromedriver to download = 131.0.6778.108 (Latest Stable)
380380
381381
Downloading chromedriver-mac-arm64.zip from:
@@ -403,7 +403,7 @@ Making [chromedriver 131.0.6778.108] executable ...
403403

404404
<p align="left">Here's <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py">my_first_test.py</a>:</p>
405405
406-
```bash
406+
```zsh
407407
cd examples/
408408
pytest my_first_test.py
409409
```
@@ -504,7 +504,7 @@ self.type("input", "dogs\n") # (The "\n" presses ENTER)
504504

505505
Most SeleniumBase scripts can be run with <code translate="no">pytest</code>, <code translate="no">pynose</code>, or pure <code translate="no">python</code>. Not all test runners can run all test formats. For example, tests that use the ``sb`` pytest fixture can only be run with ``pytest``. (See <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md">Syntax Formats</a>) There's also a <a href="https://behave.readthedocs.io/en/stable/gherkin.html#features" target="_blank">Gherkin</a> test format that runs with <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd/ReadMe.md">behave</a>.
506506
507-
```bash
507+
```zsh
508508
pytest coffee_cart_tests.py --rs
509509
pytest test_sb_fixture.py --demo
510510
pytest test_suite.py --rs --html=report.html --dashboard
@@ -528,13 +528,13 @@ With a SeleniumBase [pytest.ini](https://github.com/seleniumbase/SeleniumBase/bl
528528

529529
<p>✅ You can do a pre-flight check to see which tests would get discovered by <code translate="no">pytest</code> before the actual run:</p>
530530

531-
```bash
531+
```zsh
532532
pytest --co -q
533533
```
534534

535535
<p>✅ You can be more specific when calling <code translate="no">pytest</code> or <code translate="no">pynose</code> on a file:</p>
536536

537-
```bash
537+
```zsh
538538
pytest [FILE_NAME.py]::[CLASS_NAME]::[METHOD_NAME]
539539
540540
pynose [FILE_NAME.py]:[CLASS_NAME].[METHOD_NAME]
@@ -562,7 +562,7 @@ pynose [FILE_NAME.py]:[CLASS_NAME].[METHOD_NAME]
562562

563563
🔵 <b>Demo Mode</b> helps you see what a test is doing. If a test is moving too fast for your eyes, run it in <b>Demo Mode</b> to pause the browser briefly between actions, highlight page elements being acted on, and display assertions:
564564

565-
```bash
565+
```zsh
566566
pytest my_first_test.py --demo
567567
```
568568

@@ -584,13 +584,13 @@ breakpoint() # Shortcut for "import pdb; pdb.set_trace()"
584584
585585
🔵 To pause an active test that throws an exception or error, (*and keep the browser window open while **Debug Mode** begins in the console*), add **``--pdb``** as a ``pytest`` option:
586586
587-
```bash
587+
```zsh
588588
pytest test_fail.py --pdb
589589
```
590590
591591
🔵 To start tests in Debug Mode, add **``--trace``** as a ``pytest`` option:
592592
593-
```bash
593+
```zsh
594594
pytest test_coffee_cart.py --trace
595595
```
596596
@@ -603,7 +603,7 @@ pytest test_coffee_cart.py --trace
603603
<a id="pytest_options"></a>
604604
✅ Here are some useful command-line options that come with <code translate="no">pytest</code>:
605605
606-
```bash
606+
```zsh
607607
-v # Verbose mode. Prints the full name of each test and shows more details.
608608
-q # Quiet mode. Print fewer details in the console output when running tests.
609609
-x # Stop running the tests after the first failure is reached.
@@ -621,7 +621,7 @@ pytest test_coffee_cart.py --trace
621621
<a id="new_pytest_options"></a>
622622
✅ SeleniumBase provides additional <code translate="no">pytest</code> command-line options for tests:
623623
624-
```bash
624+
```zsh
625625
--browser=BROWSER # (The web browser to use. Default: "chrome".)
626626
--chrome # (Shortcut for "--browser=chrome". On by default.)
627627
--edge # (Shortcut for "--browser=edge".)
@@ -731,7 +731,7 @@ pytest test_coffee_cart.py --trace
731731
732732
🔵 During test failures, logs and screenshots from the most recent test run will get saved to the ``latest_logs/`` folder. Those logs will get moved to ``archived_logs/`` if you add --archive_logs to command-line options, or have ``ARCHIVE_EXISTING_LOGS`` set to True in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py), otherwise log files with be cleaned up at the start of the next test run. The ``test_suite.py`` collection contains tests that fail on purpose so that you can see how logging works.
733733
734-
```bash
734+
```zsh
735735
cd examples/
736736
737737
pytest test_suite.py --chrome
@@ -754,13 +754,13 @@ Inside your tests, you can use ``self.data`` to access that.
754754
755755
🔵 ``sbase mkdir DIR`` creates a folder with config files and sample tests:
756756
757-
```bash
757+
```zsh
758758
sbase mkdir ui_tests
759759
```
760760
761761
> That new folder will have these files:
762762
763-
```bash
763+
```zsh
764764
ui_tests/
765765
├── __init__.py
766766
├── my_first_test.py
@@ -786,13 +786,13 @@ ui_tests/
786786
787787
<b>ProTip™:</b> You can also create a boilerplate folder without any sample tests in it by adding ``-b`` or ``--basic`` to the ``sbase mkdir`` command:
788788
789-
```bash
789+
```zsh
790790
sbase mkdir ui_tests --basic
791791
```
792792
793793
> That new folder will have these files:
794794
795-
```bash
795+
```zsh
796796
ui_tests/
797797
├── __init__.py
798798
├── pytest.ini
@@ -822,7 +822,7 @@ class MyTestClass(BaseCase):
822822
823823
You can run it from the ``examples/`` folder like this:
824824
825-
```bash
825+
```zsh
826826
pytest test_fail.py
827827
```
828828
@@ -835,23 +835,23 @@ pytest test_fail.py
835835
836836
🔵 The ``--dashboard`` option for pytest generates a SeleniumBase Dashboard located at ``dashboard.html``, which updates automatically as tests run and produce results. Example:
837837
838-
```bash
838+
```zsh
839839
pytest --dashboard --rs --headless
840840
```
841841
842842
<img src="https://seleniumbase.github.io/cdn/img/dashboard_1.png" alt="The SeleniumBase Dashboard" title="The SeleniumBase Dashboard" width="380" />
843843
844844
🔵 Additionally, you can host your own SeleniumBase Dashboard Server on a port of your choice. Here's an example of that using Python's ``http.server``:
845845
846-
```bash
846+
```zsh
847847
python -m http.server 1948
848848
```
849849
850850
🔵 Now you can navigate to ``http://localhost:1948/dashboard.html`` in order to view the dashboard as a web app. This requires two different terminal windows: one for running the server, and another for running the tests, which should be run from the same directory. (Use <kbd>Ctrl+C</kbd> to stop the http server.)
851851
852852
🔵 Here's a full example of what the SeleniumBase Dashboard may look like:
853853
854-
```bash
854+
```zsh
855855
pytest test_suite.py test_image_saving.py --dashboard --rs --headless
856856
```
857857
@@ -866,7 +866,7 @@ pytest test_suite.py test_image_saving.py --dashboard --rs --headless
866866
867867
✅ Using ``--html=report.html`` gives you a fancy report of the name specified after your test suite completes.
868868
869-
```bash
869+
```zsh
870870
pytest test_suite.py --html=report.html
871871
```
872872
@@ -876,7 +876,7 @@ pytest test_suite.py --html=report.html
876876
877877
✅ Here's an example of an upgraded html report:
878878
879-
```bash
879+
```zsh
880880
pytest test_suite.py --dashboard --html=report.html
881881
```
882882
@@ -886,15 +886,15 @@ If viewing pytest html reports in [Jenkins](https://www.jenkins.io/), you may ne
886886
887887
You can also use ``--junit-xml=report.xml`` to get an xml report instead. Jenkins can use this file to display better reporting for your tests.
888888
889-
```bash
889+
```zsh
890890
pytest test_suite.py --junit-xml=report.xml
891891
```
892892
893893
<h3>🔵 <code>pynose</code> Reports:</h3>
894894
895895
The ``--report`` option gives you a fancy report after your test suite completes.
896896
897-
```bash
897+
```zsh
898898
pynose test_suite.py --report
899899
```
900900
@@ -906,15 +906,15 @@ pynose test_suite.py --report
906906
907907
(The [behave_bdd/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples/behave_bdd) folder can be found in the [examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder.)
908908
909-
```bash
909+
```zsh
910910
behave behave_bdd/features/ -D dashboard -D headless
911911
```
912912
913913
<img src="https://seleniumbase.github.io/cdn/img/sb_behave_dashboard.png" title="SeleniumBase" width="520">
914914
915915
You can also use ``--junit`` to get ``.xml`` reports for each <code translate="no">behave</code> feature. Jenkins can use these files to display better reporting for your tests.
916916
917-
```bash
917+
```zsh
918918
behave behave_bdd/features/ --junit -D rs -D headless
919919
```
920920
@@ -924,13 +924,13 @@ See: [https://allurereport.org/docs/pytest/](https://allurereport.org/docs/pytes
924924
925925
SeleniumBase no longer includes ``allure-pytest`` as part of installed dependencies. If you want to use it, install it first:
926926
927-
```bash
927+
```zsh
928928
pip install allure-pytest
929929
```
930930
931931
Now your tests can create Allure results files, which can be processed by Allure Reports.
932932
933-
```bash
933+
```zsh
934934
pytest test_suite.py --alluredir=allure_results
935935
```
936936
@@ -940,27 +940,27 @@ pytest test_suite.py --alluredir=allure_results
940940
941941
If you wish to use a proxy server for your browser tests (Chromium or Firefox), you can add ``--proxy=IP_ADDRESS:PORT`` as an argument on the command line.
942942
943-
```bash
943+
```zsh
944944
pytest proxy_test.py --proxy=IP_ADDRESS:PORT
945945
```
946946
947947
If the proxy server that you wish to use requires authentication, you can do the following (Chromium only):
948948
949-
```bash
949+
```zsh
950950
pytest proxy_test.py --proxy=USERNAME:PASSWORD@IP_ADDRESS:PORT
951951
```
952952
953953
SeleniumBase also supports SOCKS4 and SOCKS5 proxies:
954954
955-
```bash
955+
```zsh
956956
pytest proxy_test.py --proxy="socks4://IP_ADDRESS:PORT"
957957
958958
pytest proxy_test.py --proxy="socks5://IP_ADDRESS:PORT"
959959
```
960960
961961
To make things easier, you can add your frequently-used proxies to PROXY_LIST in [proxy_list.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/proxy_list.py), and then use ``--proxy=KEY_FROM_PROXY_LIST`` to use the IP_ADDRESS:PORT of that key.
962962
963-
```bash
963+
```zsh
964964
pytest proxy_test.py --proxy=proxy1
965965
```
966966
@@ -969,7 +969,7 @@ pytest proxy_test.py --proxy=proxy1
969969
970970
🔵 If you wish to change the User-Agent for your browser tests (Chromium and Firefox only), you can add ``--agent="USER AGENT STRING"`` as an argument on the command-line.
971971
972-
```bash
972+
```zsh
973973
pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7412.EU"
974974
```
975975
@@ -1007,7 +1007,7 @@ pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1
10071007
10081008
Here's an example of running tests with some additional features enabled:
10091009
1010-
```bash
1010+
```zsh
10111011
pytest [YOUR_TEST_FILE.py] --with-db-reporting --with-s3-logging
10121012
```
10131013
@@ -1354,7 +1354,7 @@ self.driver.find_elements("partial link text", "GitHub")
13541354
13551355
<p>You can use <code translate="no">pytest --reruns=NUM</code> to retry failing tests that many times. Add <code translate="no">--reruns-delay=SECONDS</code> to wait that many seconds between retries. Example:</p>
13561356
1357-
```bash
1357+
```zsh
13581358
pytest --reruns=1 --reruns-delay=1
13591359
```
13601360

examples/behave_bdd/ReadMe.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
🐝 Behave examples with SeleniumBase: [SeleniumBase/examples/behave_bdd](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/behave_bdd)
88

9-
```bash
9+
```zsh
1010
> cd examples/behave_bdd/
1111
> behave features/realworld.feature -T -D dashboard -k
1212

@@ -40,7 +40,7 @@ Took 0m4.682s
4040

4141
🐝 Another example, which uses higher-level Behave steps to simplify the ``.feature`` file:
4242

43-
```bash
43+
```zsh
4444
> cd examples/behave_bdd/
4545
> behave features/calculator.feature:61 -T -D dashboard -k
4646

@@ -84,7 +84,7 @@ Took 0m1.672s
8484

8585
🐝 The ``*.feature`` files can use any step seen from:
8686

87-
```bash
87+
```zsh
8888
behave --steps-catalog
8989
```
9090

@@ -197,7 +197,7 @@ Feature: SeleniumBase scenarios for the RealWorld App
197197

198198
🐝 If there's a test failure, that's easy to spot:
199199

200-
```bash
200+
```zsh
201201
Feature: SeleniumBase scenarios for the Fail Page # features/fail_page.feature:1
202202

203203
Scenario: Fail test on purpose to see what happens # features/fail_page.feature:3
@@ -216,7 +216,7 @@ Feature: SeleniumBase scenarios for the Fail Page # features/fail_page.feature:1
216216
217217
🐝🎖️ To launch it, call ``sbase behave-gui`` or ``sbase gui-behave``:
218218
219-
```bash
219+
```zsh
220220
sbase behave-gui
221221
* Starting the SeleniumBase Behave Commander GUI App...
222222
```
@@ -225,7 +225,7 @@ sbase behave-gui
225225
226226
🐝🎖️ You can customize the tests that show up there:
227227
228-
```bash
228+
```zsh
229229
sbase behave-gui # all tests
230230
sbase behave-gui -i=calculator # tests with "calculator" in the name
231231
sbase behave-gui features/ # tests located in the "features/" folder

0 commit comments

Comments
 (0)