Skip to content

Commit 3450102

Browse files
committed
Update ReadMe files
1 parent f5d5b34 commit 3450102

File tree

3 files changed

+29
-28
lines changed

3 files changed

+29
-28
lines changed

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![](https://cdn2.hubspot.net/hubfs/100006/images/SB_Logo8g.png "SeleniumBase")
1+
<img src="https://cdn2.hubspot.net/hubfs/100006/images/SeleniumBase_Home.png" title="SeleniumBase" height="50">
22

33
**WebDriver automation simplified by extending Python's unittest framework.**
44

@@ -145,14 +145,14 @@ Here are some other useful nosetest arguments for appending to your run commands
145145
--with-id # If -v is also used, will number the tests for easy counting.
146146
```
147147

148-
The ``--with-testing_base`` plugin gives you full logging on test failures, which saves screenshots, page source, and basic test info into the logs folder:
148+
During test failures you'll get detailed log files, which include screenshots, page source, and basic test info, which will get added to the logs folder at ``latest_logs/``. (Unless you have ARCHIVE_EXISTING_LOGS set to True in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py), log files with be cleaned up at the start of the next test run. If the archive feature is enabled, those logs will get saved to the ``archived_logs/`` folder.) The ``my_test_suite.py`` collection contains tests that fail on purpose so that you can see how logging works.
149149

150150
```bash
151151
cd examples/
152152

153-
pytest my_first_test.py --with-testing_base --browser=chrome
153+
pytest my_test_suite.py --browser=chrome
154154

155-
pytest my_first_test.py --with-testing_base --browser=firefox
155+
pytest my_test_suite.py --browser=firefox
156156
```
157157

158158
If you want to run tests headlessly, use ``--headless``, which you'll need to do if your system lacks a GUI interface. Even if your system does have a GUI interface, it may still support headless browser automation.
@@ -188,12 +188,12 @@ pytest my_test_suite.py --junitxml=report.xml
188188

189189
#### **Nosetest Reports:**
190190

191-
The ``--report`` option gives you a fancy report after your test suite completes. (Requires ``--with-testing_base`` to also be set when ``--report`` is used because it's part of that plugin.)
191+
The ``--report`` option gives you a fancy report after your test suite completes.
192192

193193
```bash
194-
nosetests my_test_suite.py --with-testing_base --report
194+
nosetests my_test_suite.py --report
195195
```
196-
![](https://cdn2.hubspot.net/hubfs/100006/images/Test_Report_2.png "Example Nosetest Report")
196+
<img src="https://cdn2.hubspot.net/hubfs/100006/images/Test_Report_2.png" title="Example Nosetest Report" height="450">
197197

198198
(NOTE: You can add ``--show_report`` to immediately display Nosetest reports after the test suite completes. Only use ``--show_report`` when running tests locally because it pauses the test run.)
199199

@@ -206,7 +206,7 @@ If you wish to use a proxy server for your browser tests (Chrome and Firefox onl
206206
pytest proxy_test.py --proxy=IP_ADDRESS:PORT
207207
```
208208

209-
To make things easier, you can add your frequently-used proxies to PROXY_LIST in [seleniumbase/config/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.
209+
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.
210210

211211
```bash
212212
pytest proxy_test.py --proxy=proxy1
@@ -236,7 +236,7 @@ pip install MySQL-python==1.2.5
236236

237237
Here's an example of running tests with additional features enabled:
238238
```bash
239-
nosetests [YOUR_TEST_FILE].py --browser=chrome --with-testing_base --with-db_reporting --with-s3_logging -s
239+
nosetests [YOUR_TEST_FILE].py --browser=chrome --with-db_reporting --with-s3_logging -s
240240
```
241241
(NOTE: If you haven't configured your MySQL or S3 connections in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py), don't use ``--with-db_reporting`` or ``--with-s3_logging``.)
242242

@@ -256,7 +256,7 @@ If you tell nosetests to run an entire file, it will run every method in that py
256256
nosetests [YOUR_TEST_FILE].py:[SOME_CLASS_NAME].test_[SOME_TEST_NAME] --config=[MY_CONFIG_FILE].cfg
257257
```
258258

259-
Let's try an example of a test that fails. Copy the following into a file called fail_test.py:
259+
Let's try an example of a test that fails:
260260
```python
261261
""" test_fail.py """
262262
from seleniumbase import BaseCase
@@ -265,12 +265,13 @@ class MyTestClass(BaseCase):
265265

266266
def test_find_army_of_robots_on_xkcd_desert_island(self):
267267
self.open("http://xkcd.com/731/")
268-
self.assert_element("div#ARMY_OF_ROBOTS", timeout=3) # This should fail
268+
self.assert_element("div#ARMY_OF_ROBOTS", timeout=1) # This should fail
269269
```
270-
Now run it:
270+
271+
You can run it from the ``examples`` folder like this:
271272

272273
```bash
273-
nosetests test_fail.py --browser=chrome --with-testing_base
274+
nosetests test_fail.py
274275
```
275276

276277
You'll notice that a logs folder, "latest_logs", was created to hold information about the failing test, and screenshots. Take a look at what you get. Remember, this data can be saved in your MySQL DB and in S3 if you include the necessary plugins in your run command (and if you set up the neccessary connections properly). For future test runs, past test results will get stored in the archived_logs folder if you have ARCHIVE_EXISTING_LOGS set to True in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py).

examples/ReadMe.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ python gui_test_runner.py
1212

1313
(NOTE: You can interchange ``nosetests`` with ``pytest`` in most of these examples.)
1414

15-
![](https://cdn2.hubspot.net/hubfs/100006/images/GUI_Test_Runner_7.png "GUI Test Runner")
15+
<img src="https://cdn2.hubspot.net/hubfs/100006/images/The_GUI_Runner.png" title="GUI Test Runner" height="400">
1616

17-
If you run scripts with logging enabled, (using ``--with-testing_base``), you’ll see two folders appear: “latest_logs” and “archived_logs”. The “latest_logs” folder will contain log files from the most recent test run, but logs will only be created if the test run is failing. Afterwards, logs from the “latest_logs” folder will get pushed to the “archived_logs” folder if you have have the ``ARCHIVE_EXISTING_LOGS`` feature enabled in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py).
17+
When you run tests, you’ll see two folders appear: “latest_logs” and “archived_logs”. The “latest_logs” folder will contain log files from the most recent test run, but logs will only be created if the test run is failing. Afterwards, logs from the “latest_logs” folder will get pushed to the “archived_logs” folder if you have have the ``ARCHIVE_EXISTING_LOGS`` feature enabled in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py).
1818

1919
**For running scripts the usual way, here are some of the example run commands:**
2020

@@ -35,12 +35,12 @@ pytest my_first_test.py --browser=chrome --demo_mode
3535

3636
Run the example test suite in Chrome and generate an html report: (nosetests-only)
3737
```bash
38-
nosetests my_test_suite.py --browser=chrome --with-testing_base --report
38+
nosetests my_test_suite.py --browser=chrome --report
3939
```
4040

4141
Run the example test suite in Firefox and generate an html report: (nosetests-only)
4242
```bash
43-
nosetests my_test_suite.py --browser=firefox --with-testing_base --report
43+
nosetests my_test_suite.py --browser=firefox --report
4444
```
4545

4646
Run a test with configuration specifed by a config file:
@@ -58,9 +58,9 @@ Run a failing test with pdb mode enabled: (If a test failure occurs, test enters
5858
nosetests test_fail.py --browser=chrome --pdb --pdb-failures
5959
```
6060

61-
Run a failing test with logging:
61+
Run a failing test (and then look into the ``latest_logs`` folder afterwards:
6262
```bash
63-
pytest test_fail.py --browser=chrome --with-testing_base
63+
pytest test_fail.py --browser=chrome
6464
```
6565

6666
(NOTE: If you see any ``*.pyc`` files appear as you run tests, that's perfectly normal. Compiled bytecode is a natural result of running Python code.)

help_docs/command_line.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ nosetests my_first_test.py --browser=firefox
2222

2323
pytest my_first_test.py --demo_mode --browser=chrome
2424

25-
nosetests my_test_suite.py --with-testing_base -s
25+
nosetests my_test_suite.py -s
2626
```
2727

2828
You can interchange **nosetests** with **pytest**. Chrome is the default browser if not specified. The ``-s`` option may produce additional output to make debugging easier.
@@ -31,24 +31,24 @@ You can interchange **nosetests** with **pytest**. Chrome is the default browser
3131

3232
**Example tests using Logging**:
3333
```bash
34-
pytest my_test_suite.py --with-testing_base --browser=chrome
34+
pytest my_test_suite.py --browser=chrome
3535
```
36-
(NOTE: The ``--with-testing_base`` plugin gives you full logging on test failures, which saves screenshots, page source, and basic test info into the logs folder.)
36+
(NOTE: You'll automatically get full logging on test failures, which include screenshots, page source, and basic test info in the logs folder, which is ``latest_logs/`` initially, and those logs will be saved in ``archived_logs/`` if you have ARCHIVE_EXISTING_LOGS set to True in [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py))
3737

3838
**Demo Mode:**
3939

4040
If any test is moving too fast for your eyes to see what's going on, you can run it in **Demo Mode** by adding ``--demo_mode`` on the command line, which pauses the browser briefly between actions, and highlights page elements being acted on:
4141

4242
```bash
43-
nosetests my_first_test.py --with-selenium --browser=chrome --demo_mode
43+
nosetests my_first_test.py --browser=chrome --demo_mode
4444
```
4545

4646
You can override the default wait time by either updating [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) or by using ``--demo_sleep={NUM}`` when using Demo Mode. (NOTE: If you use ``--demo_sleep={NUM}`` without using ``--demo_mode``, nothing will happen.)
4747

4848
If you ever make any changes to your local copy of ``settings.py``, you may need to run ``python setup.py install`` for those changes to take effect.
4949

5050
```bash
51-
nosetests my_first_test.py --with-selenium --browser=chrome --demo_mode --demo_sleep=1.2
51+
nosetests my_first_test.py --browser=chrome --demo_mode --demo_sleep=1.2
5252
```
5353

5454
**You can also use the following in your scripts to slow down the tests:**
@@ -64,7 +64,7 @@ You may also want to have your test sleep in other situations where you need to
6464
**If you need to debug things on the fly (in case of errors), use this:**
6565

6666
```bash
67-
nosetests my_first_test.py --browser=chrome --with-selenium --pdb --pdb-failures -s
67+
nosetests my_first_test.py --browser=chrome --pdb --pdb-failures -s
6868
```
6969

7070
The above code (with --pdb) will leave your browser window open in case there's a failure, which is possible if the web pages from the example change the data that's displayed on the page. (ipdb commands: 'c', 's', 'n' => continue, step, next). You may need the ``-s`` in order to see all console output.
@@ -83,16 +83,16 @@ The above code (with --pdb) will leave your browser window open in case there's
8383
Using ``--html=report.html`` gives you a fancy report of the name specified after your test suite completes.
8484

8585
```bash
86-
pytest my_test_suite.py --with-selenium --html=report.html
86+
pytest my_test_suite.py --html=report.html
8787
```
8888
![](https://cdn2.hubspot.net/hubfs/100006/images/PytestReport.png "Example Pytest Report")
8989

9090
#### **Nosetest Reports:**
9191

92-
The ``--report`` option gives you a fancy report after your test suite completes. (Requires ``--with-testing_base`` to also be set when ``--report`` is used because it's part of that plugin.)
92+
The ``--report`` option gives you a fancy report after your test suite completes.
9393

9494
```bash
95-
nosetests my_test_suite.py --with-selenium --with-testing_base --report
95+
nosetests my_test_suite.py --report
9696
```
9797
![](http://cdn2.hubspot.net/hubfs/100006/images/Test_Report_2.png "Example Nosetest Report")
9898

0 commit comments

Comments
 (0)