Skip to content

Commit 7444352

Browse files
committed
Update the docs
1 parent 0e2907c commit 7444352

File tree

4 files changed

+63
-54
lines changed

4 files changed

+63
-54
lines changed

README.md

Lines changed: 53 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ pip install seleniumbase
112112
COMMANDS:
113113
install [DRIVER] [OPTIONS]
114114
mkdir [DIRECTORY]
115-
mkfile [FILE.py]
115+
mkfile [FILE.py] [OPTIONS]
116+
mkpres [FILE.py] [LANGUAGE OPTIONS]
116117
options (List common pytest options)
117118
print [FILE] [OPTIONS]
118119
translate [SB_FILE.py] [LANG] [ACTION]
@@ -152,53 +153,24 @@ sbase install chromedriver latest
152153
153154
(See [seleniumbase.io/seleniumbase/console_scripts/ReadMe/](https://seleniumbase.io/seleniumbase/console_scripts/ReadMe/) for more information on SeleniumBase console scripts.)
154155
155-
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Create and run tests:</h3>
156+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Running tests:</h3>
156157
157-
🔵 ``sbase mkdir DIR`` creates a folder with sample tests:
158-
159-
```bash
160-
sbase mkdir ui_tests
161-
cd ui_tests/
162-
```
163-
164-
> That folder will have the following files:
165-
166-
```
167-
ui_tests/
168-
├── __init__.py
169-
├── boilerplates/
170-
│ ├── __init__.py
171-
│ ├── base_test_case.py
172-
│ ├── boilerplate_test.py
173-
│ ├── page_objects.py
174-
│ └── samples/
175-
│ ├── __init__.py
176-
│ ├── google_objects.py
177-
│ └── google_test.py
178-
├── my_first_test.py
179-
├── parameterized_test.py
180-
├── pytest.ini
181-
├── requirements.txt
182-
├── setup.cfg
183-
└── test_demo_site.py
184-
```
185-
186-
🔵 <b>Run a sample test with ``pytest``:</b>
158+
🔵 <b>If you've cloned SeleniumBase from GitHub, you can run sample tests from the [examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder:</b>
187159
188160
```bash
161+
cd examples/
189162
pytest test_demo_site.py
190163
```
191164
192-
> (Chrome is the default browser if not specified with ``--browser=BROWSER``.)
193-
> (On Linux, ``--headless`` is the default behavior. You can also run in headless mode on any OS. If your Linux machine has a GUI and you want to see the web browser as tests run, add ``--headed`` or ``--gui``.)
165+
> (Chrome is the default browser if not specified with ``--browser=BROWSER``. On Linux, ``--headless`` is the default behavior. You can also run in headless mode on any OS. If your Linux machine has a GUI and you want to see the web browser as tests run, add ``--headed`` or ``--gui``.)
194166
195167
<a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_demo_site.py"><img src="https://seleniumbase.io/cdn/gif/demo_page_1.gif" title="SeleniumBase Demo Page" /></a><br />
196168
197-
🔵 <b>If you've cloned SeleniumBase from GitHub, you can run sample tests from the [SeleniumBase/examples/](https://github.com/seleniumbase/SeleniumBase/tree/master/examples) folder:</b>
169+
🔵 <b>Here are more examples that you can run:</b>
198170
199171
```bash
200-
cd examples/
201172
pytest my_first_test.py
173+
202174
pytest test_swag_labs.py
203175
```
204176
@@ -438,18 +410,56 @@ Here's the command-line option to add to tests: (See [examples/custom_settings.p
438410
Inside your tests, you can use ``self.data`` to access that.
439411
440412
441-
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Test Directory Customization:</h3>
413+
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Test Directory Configuration:</h3>
442414
443-
🔵 For running tests outside of the SeleniumBase repo with **pytest**, you'll want a copy of **[pytest.ini](https://github.com/seleniumbase/SeleniumBase/blob/master/pytest.ini)** on the root folder. For running tests outside of the SeleniumBase repo with **nosetests**, you'll want a copy of **[setup.cfg](https://github.com/seleniumbase/SeleniumBase/blob/master/setup.cfg)** on the root folder. (Subfolders should include a blank ``__init__.py`` file.) These files specify default configuration details for tests. (For nosetest runs, you can also specify a .cfg file by using ``--config``. Example ``nosetests [MY_TEST.py] --config=[MY_CONFIG.cfg]``)
415+
🔵 When running tests with **pytest**, you'll want a copy of **[pytest.ini](https://github.com/seleniumbase/SeleniumBase/blob/master/pytest.ini)** in your root folders. When running tests with **nosetests**, you'll want a copy of **[setup.cfg](https://github.com/seleniumbase/SeleniumBase/blob/master/setup.cfg)** in your root folders. These files specify default configuration details for tests. Folders should also include a blank ``__init__.py`` file, which allows your tests to import files from that folder.
444416
445-
🔵 As a shortcut, you'll be able to run ``sbase mkdir [DIRECTORY]`` to create a new folder that already contains necessary files and some example tests that you can run.
417+
🔵 ``sbase mkdir DIR`` creates a folder with config files and sample tests:
446418
447419
```bash
448420
sbase mkdir ui_tests
449-
cd ui_tests/
450-
pytest test_demo_site.py
451421
```
452422
423+
> That new folder will have these files:
424+
425+
```bash
426+
ui_tests/
427+
├── __init__.py
428+
├── boilerplates/
429+
│ ├── __init__.py
430+
│ ├── base_test_case.py
431+
│ ├── boilerplate_test.py
432+
│ ├── page_objects.py
433+
│ └── samples/
434+
│ ├── __init__.py
435+
│ ├── google_objects.py
436+
│ └── google_test.py
437+
├── my_first_test.py
438+
├── parameterized_test.py
439+
├── pytest.ini
440+
├── requirements.txt
441+
├── setup.cfg
442+
└── test_demo_site.py
443+
```
444+
445+
<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:
446+
447+
```bash
448+
sbase mkdir ui_tests --basic
449+
```
450+
451+
> That new folder will have these files:
452+
453+
```bash
454+
ui_tests/
455+
├── __init__.py
456+
├── pytest.ini
457+
├── requirements.txt
458+
└── setup.cfg
459+
```
460+
461+
Of those files, the ``pytest.ini`` config file is the most important, followed by a blank ``__init__.py`` file. There's also a ``setup.cfg`` file (only needed for nosetests). Finally, the ``requirements.txt`` file can be used to help you install seleniumbase into your environments (if it's not already installed).
462+
453463
--------
454464
455465
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Log files from failed tests:</h3>
@@ -467,7 +477,7 @@ class MyTestClass(BaseCase):
467477
self.assert_element("div#ARMY_OF_ROBOTS", timeout=1) # This should fail
468478
```
469479
470-
You can run it from the ``examples`` folder like this:
480+
You can run it from the ``examples/`` folder like this:
471481
472482
```bash
473483
pytest test_fail.py
@@ -589,7 +599,7 @@ pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1
589599
590600
<h3><img src="https://seleniumbase.io/img/logo6.png" title="SeleniumBase" width="32" /> Building Guided Tours for Websites:</h3>
591601
592-
🔵 Learn about <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">SeleniumBase Interactive Walkthroughs</a> (in the ``examples/tour_examples`` folder). It's great for prototyping a website onboarding experience.
602+
🔵 Learn about <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md">SeleniumBase Interactive Walkthroughs</a> (in the ``examples/tour_examples/`` folder). It's great for prototyping a website onboarding experience.
593603
594604
595605
<a id="utilizing_advanced_features"></a>

examples/chart_maker/ReadMe.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<h3 align="left"><img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="360" /></h3>
1+
<h3 align="left"><img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="350" /></h3>
22

3-
<h3> 📊 ChartMaker 📈 </h3>
3+
<h2> 📊 ChartMaker 📈 </h2>
44

5-
SeleniumBase ChartMaker allows you to create HTML charts with Python. (Using HighCharts JS)
5+
<p>SeleniumBase ChartMaker lets you use Python to generate HTML charts from HighCharts JS.</p>
66

7-
<a href="https://seleniumbase.io/other/chart_presentation.html"><img width="500" src="https://seleniumbase.io/other/chart_presentation.gif" title="Screenshot"></a><br>
7+
<a href="https://seleniumbase.io/other/chart_presentation.html"><img width="480" src="https://seleniumbase.io/cdn/gif/chart_pres.gif" title="Chart Presentation"></a><br>
88

99
([Click to see a presentation with multiple charts](https://seleniumbase.io/other/chart_presentation.html))
1010

examples/presenter/ReadMe.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
<h1> 📰 Presenter 📑 </h1>
44

5-
<b>SeleniumBase Presenter allows you to create HTML presentations with Python.</b><br />
6-
(The "Reveal-JS" library is used for running the presentations.)
5+
<p>SeleniumBase Presenter lets you use Python to generate HTML presentations from Reveal JS.</p>
76

8-
**Here's a sample presentation:**
7+
<b>Here's a sample presentation:</b>
98

109
<a href="https://seleniumbase.io/other/presenter.html"><img width="500" src="https://seleniumbase.io/other/presenter.gif" title="Screenshot"></a><br>
1110

help_docs/chart_maker.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
<h3 align="left"><img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="360" /></h3>
1+
<h3 align="left"><img src="https://seleniumbase.io/cdn/img/sb_logo_b.png" alt="SeleniumBase" width="350" /></h3>
22

3-
<h3> 📊 ChartMaker 📈 </h3>
3+
<h2> 📊 ChartMaker 📈 </h2>
44

5-
SeleniumBase ChartMaker allows you to create HTML charts with Python. (Using HighCharts JS)
5+
<p>SeleniumBase ChartMaker lets you use Python to generate HTML charts from HighCharts JS.</p>
66

7-
<a href="https://seleniumbase.io/other/chart_presentation.html"><img width="500" src="https://seleniumbase.io/other/chart_presentation.gif" title="Screenshot"></a><br>
7+
<a href="https://seleniumbase.io/other/chart_presentation.html"><img width="480" src="https://seleniumbase.io/cdn/gif/chart_pres.gif" title="Chart Presentation"></a><br>
88

99
([Click to see a presentation with multiple charts](https://seleniumbase.io/other/chart_presentation.html))
1010

0 commit comments

Comments
 (0)