Skip to content

Commit e13c66b

Browse files
committed
Update the ReadMe
1 parent e9d5462 commit e13c66b

File tree

1 file changed

+42
-38
lines changed

1 file changed

+42
-38
lines changed

README.md

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1-
<img src="https://cdn2.hubspot.net/hubfs/100006/images/SB_Logo3d.png" title="SeleniumBase" height="48">
1+
[<img src="https://cdn2.hubspot.net/hubfs/100006/images/SB_Logo4d2.png" title="SeleniumBase" height="58">](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
22

33
[![](https://img.shields.io/pypi/v/seleniumbase.svg)](https://pypi.python.org/pypi/seleniumbase) [![Build Status](https://travis-ci.org/seleniumbase/SeleniumBase.svg?branch=master)](https://travis-ci.org/seleniumbase/SeleniumBase) [![GitHub stars](https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg "GitHub stars")](https://github.com/seleniumbase/SeleniumBase/stargazers)<br />
44

55
A reliable solution for fast & simple browser automation and testing with [WebDriver](https://docs.microsoft.com/en-us/microsoft-edge/webdriver) & [Pytest](https://github.com/pytest-dev/pytest).
66

7-
#### Quick start in a few steps: (Requires [Python](https://www.python.org/downloads/) and [Git](https://git-scm.com/))
7+
**Why SeleniumBase?** WebDriver automates browsers, but it's not a stand-alone test framework. SeleniumBase saves you time by providing you with a complete framework for end-to-end testing.
8+
9+
**Why Python?** Python is the [fastest growing programming language according to Stack Overflow](https://stackoverflow.blog/2017/09/06/incredible-growth-python/). Python's structure makes it optimal for scripting and quickly building things.
810

9-
```bash
11+
**Quick Start in a few steps:** (Requires [Python](https://www.python.org/downloads/), [Git](https://git-scm.com/), and an optional [Python virtual env](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/virtualenv_instructions.md).)
12+
13+
```
1014
python -m pip install --upgrade pip
1115
git clone https://github.com/seleniumbase/SeleniumBase.git
1216
@@ -20,33 +24,33 @@ cd examples
2024
pytest my_first_test.py --browser=chrome
2125
```
2226

23-
SeleniumBase has a very flexible [command line interface](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md) to change how your tests run. The following will run the same test from above using Nosetests and Firefox with geckodriver (although Pytest is recommended over Nosetests):
27+
SeleniumBase has a very flexible [command line interface](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/customizing_test_runs.md) to change how your tests run. The following will run the same test from above on Firefox (geckodriver) using nosetests (although pytest is recommended over nosetests):
2428

25-
```bash
29+
```
2630
seleniumbase install geckodriver
2731
nosetests my_first_test.py --browser=firefox
2832
```
2933

3034
Try out Demo Mode to see what what's being tested in real time! (Chrome is the default browser if not specified.)
3135

32-
```bash
36+
```
3337
pytest my_first_test.py --demo_mode
3438
```
3539

3640
![](https://cdn2.hubspot.net/hubfs/100006/images/sb_demo.gif "SeleniumBase")<br />
37-
(Above: Actual demo of [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) running against [xkcd.com](http://xkcd.com/353/))
41+
(Above: Actual demo of [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) running on [xkcd.com](http://xkcd.com/353/))
3842

3943
There are many more examples to try out from the [SeleniumBase/examples](https://github.com/seleniumbase/SeleniumBase/blob/master/examples) directory, which you can run easily if you clone SeleniumBase.
4044

4145
Try out SeleniumBase Website Tours (from the ``examples/tour_examples`` folder). It's the best website onboarding experience available (and it's free too). Find the [WebSite Tours ReadMe here](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/ReadMe.md).
4246

43-
```bash
47+
```
4448
cd tour_examples
4549
pytest google_tour.py
4650
```
4751

4852
![](https://cdn2.hubspot.net/hubfs/100006/images/google_tour.gif "SeleniumBase Tours")<br />
49-
(Above: Actual demo of [google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py) running against [google.com](https://google.com))
53+
(Above: Actual demo of [google_tour.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/tour_examples/google_tour.py) running on [google.com](https://google.com))
5054

5155
For more detailed steps on getting started, see the [**Detailed Instructions**](#seleniumbase_installation) section.
5256

@@ -64,7 +68,7 @@ SeleniumBase automatically handles common WebDriver actions such as spinning up
6468
**Run tests with Pytest or Nose in any browser:**<br />
6569
(<i>Using **Pytest** is strongly recommended</i>)
6670

67-
```bash
71+
```
6872
pytest my_first_test.py --browser=chrome
6973
7074
nosetests my_test_suite.py --browser=firefox
@@ -98,11 +102,11 @@ SeleniumBase makes it easy to automate tedious business tasks. (*To learn about
98102
**Extensively tested and made with love:**<br />
99103
SeleniumBase was originally built for [testing HubSpot's platform](https://product.hubspot.com/blog/bid/88880/Automated-Integration-Testing-with-Selenium-at-HubSpot) and automating business processes. In 2014, SeleniumBase was open-sourced and spun off as its own independent entity to benefit users everywhere.
100104

101-
**Plenty of features:**<br />
105+
**Feature-Rich:**<br />
102106
([Read more about SeleniumBase features here](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/features_list.md))
103107

104108
<a id="seleniumbase_installation"></a>
105-
<br><img src="https://cdn2.hubspot.net/hubfs/100006/images/SB_Logo8g.png" title="SeleniumBase" height="40">
109+
<img src="https://cdn2.hubspot.net/hubfs/100006/images/SB_Logo3d.png" title="SeleniumBase" height="48">
106110

107111
## Detailed Instructions:
108112

@@ -111,7 +115,7 @@ Before installation, **[install Python](https://github.com/seleniumbase/Selenium
111115

112116
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Step 1:** Clone SeleniumBase
113117

114-
```bash
118+
```
115119
git clone https://github.com/seleniumbase/SeleniumBase.git
116120
117121
cd SeleniumBase
@@ -135,12 +139,12 @@ python setup.py develop
135139
```
136140

137141
If you're installing SeleniumBase from the [Python Package Index](https://pypi.python.org/pypi/seleniumbase), use:
138-
```bash
142+
```
139143
pip install -U seleniumbase --no-cache-dir
140144
```
141145

142146
If you're installing SeleniumBase directly from GitHub, use:
143-
```bash
147+
```
144148
pip install -e git+https://github.com/seleniumbase/SeleniumBase.git@master#egg=seleniumbase
145149
```
146150

@@ -178,7 +182,7 @@ class MyTestClass(BaseCase):
178182

179183
(NOTE: You can interchange **pytest** with **nosetests** at anytime.)
180184

181-
```bash
185+
```
182186
cd examples/
183187
184188
pytest my_first_test.py --browser=chrome
@@ -190,7 +194,7 @@ nosetests my_first_test.py --browser=firefox
190194
<a id="seleniumbase_demo_mode"></a>
191195
If the example 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, highlights page elements being acted on, and lets you know what test assertions are happening in real time:
192196

193-
```bash
197+
```
194198
pytest my_first_test.py --demo_mode
195199
```
196200

@@ -204,15 +208,15 @@ import pytest; pytest.set_trace() # similar to ipdb, but specific to pytest
204208

205209
**To pause an active test that throws an exception or error, add ``--pdb --pdb-failures -s``:**
206210

207-
```bash
211+
```
208212
pytest my_first_test.py --browser=chrome --pdb --pdb-failures -s
209213
```
210214

211215
The code above will leave your browser window open in case there's a failure. (ipdb commands: 'c', 's', 'n' => continue, step, next).
212216

213217
Here are some other useful **nosetest**-specific arguments:
214218

215-
```bash
219+
```
216220
--logging-level=INFO # Hide DEBUG messages, which can be overwhelming.
217221
-x # Stop running the tests after the first failure is reached.
218222
-v # Prints the full test name rather than a dot for each test.
@@ -221,7 +225,7 @@ Here are some other useful **nosetest**-specific arguments:
221225

222226
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 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 ``my_test_suite.py`` collection contains tests that fail on purpose so that you can see how logging works.
223227

224-
```bash
228+
```
225229
cd examples/
226230
227231
pytest my_test_suite.py --browser=chrome
@@ -241,16 +245,17 @@ If you want to pass additional data from the command line to your tests, you can
241245

242246
You can install SeleniumBase without cloning the repo by doing this:
243247

244-
```bash
248+
```
245249
python -m pip install -U pip
246250
pip install -U seleniumbase --no-cache-dir
247251
```
248252

249253
Now you can install webdrivers by doing this:
250254

251-
```bash
255+
```
252256
seleniumbase install chromedriver
253257
seleniumbase install geckodriver
258+
seleniumbase install edgedriver
254259
```
255260

256261
Remember, you'll need chromedriver if you want to run automation on Chrome, geckodriver if you want to run automation on Firefox, edgedriver for Microsoft Edge, etc.
@@ -265,7 +270,7 @@ For running tests outside of the SeleniumBase repo with **Nosetests**, you'll wa
265270

266271
As a shortcut, you'll be able to run ``seleniumbase mkdir [DIRECTORY_NAME]`` to create a new folder that already contains necessary files and some example tests that you can run. Example:
267272

268-
```bash
273+
```
269274
seleniumbase mkdir browser_tests
270275
cd browser_tests
271276
pytest my_first_test.py --browser=chrome
@@ -282,13 +287,13 @@ pytest my_first_test.py --browser=chrome
282287

283288
Using ``--html=report.html`` gives you a fancy report of the name specified after your test suite completes.
284289

285-
```bash
290+
```
286291
pytest my_test_suite.py --html=report.html
287292
```
288293

289294
You can also use ``--junitxml=report.xml`` to get an xml report instead. Jenkins can use this file to display better reporting for your tests.
290295

291-
```bash
296+
```
292297
pytest my_test_suite.py --junitxml=report.xml
293298
```
294299

@@ -298,7 +303,7 @@ pytest my_test_suite.py --junitxml=report.xml
298303

299304
The ``--report`` option gives you a fancy report after your test suite completes.
300305

301-
```bash
306+
```
302307
nosetests my_test_suite.py --report
303308
```
304309
<img src="https://cdn2.hubspot.net/hubfs/100006/images/Test_Report_2.png" title="Example Nosetest Report" height="420">
@@ -310,13 +315,13 @@ nosetests my_test_suite.py --report
310315

311316
If you wish to use a proxy server for your browser tests (Chrome and Firefox only), you can add ``--proxy=IP_ADDRESS:PORT`` as an argument on the command line.
312317

313-
```bash
318+
```
314319
pytest proxy_test.py --proxy=IP_ADDRESS:PORT
315320
```
316321

317322
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.
318323

319-
```bash
324+
```
320325
pytest proxy_test.py --proxy=proxy1
321326
```
322327

@@ -331,7 +336,7 @@ Here are some things you can do to setup a production environment for your testi
331336

332337
* If you're using the [SeleniumBase MySQL feature](https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/mysql_installation.md) to save results from tests running on a server machine, you can install [MySQL Workbench](http://dev.mysql.com/downloads/tools/workbench/) to help you read & write from your DB more easily. You'll also need to install the MySQL Python client. Depending on your system, you may need to install additional requirements for this (such as on Windows). See [Stackoverflow](https://stackoverflow.com/questions/43102442/whats-the-difference-between-mysqldb-mysqlclient-and-mysql-connector-python) for more info.
333338

334-
```bash
339+
```
335340
pip install mysqlclient==1.3.12
336341
```
337342

@@ -341,7 +346,7 @@ pip install mysqlclient==1.3.12
341346
* If you're using AWS, you can setup an [Amazon S3](http://aws.amazon.com/s3/) account for saving your log files and screenshots for future viewing. SeleniumBase already has [all the code you need to connect to S3](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/plugins/s3_logging_plugin.py). You'll need to modify [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) with connection details to your instance and the location in S3 where you want log files to be saved. You'll also need to add "``--with-s3_logging``" on the command line when you run your tests.
342347

343348
Here's an example of running tests with additional features enabled:
344-
```bash
349+
```
345350
pytest [YOUR_TEST_FILE].py --browser=chrome --with-db_reporting --with-s3_logging -s
346351
```
347352
(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``.)
@@ -350,15 +355,15 @@ When the testing_base plugin is used, if there's a test failure, the basic_test_
350355

351356
To simplify that long run command, you can create a *.cfg file, such as the one provided in the example, and enter your plugins there so that you can run everything by typing:
352357

353-
```bash
358+
```
354359
nosetests [YOUR_TEST_FILE].py --config=[MY_CONFIG_FILE].cfg
355360
```
356361

357362
You can simplify that even more by using a setup.cfg file, such as the one provided for you in the examples folder. If you kick off a test run from within the folder that setup.cfg is location in, that file will automatically be used as your configuration, meaning that you wouldn't have to type out all the plugins that you want to use (or include a config file) everytime you run tests.
358363

359364
If you tell pytest/nosetests to run an entire file, it will run every method in that python file that starts with "test". You can be more specific on what to run by doing something like the following: (<i>Note that the syntax is different for pytest vs nosetests.</i>)
360365

361-
```bash
366+
```
362367
pytest [YOUR_TEST_FILE].py::[SOME_CLASS_NAME]::test_[SOME_TEST_NAME]
363368
nosetests [YOUR_TEST_FILE].py:[SOME_CLASS_NAME].test_[SOME_TEST_NAME]
364369
```
@@ -377,7 +382,7 @@ class MyTestClass(BaseCase):
377382

378383
You can run it from the ``examples`` folder like this:
379384

380-
```bash
385+
```
381386
pytest test_fail.py
382387
```
383388

@@ -684,12 +689,11 @@ Now you can parse through the email if you're looking for specific text or want
684689

685690
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") Wrap-Up
686691

687-
**Congratulations** on learning how to use **SeleniumBase**!
692+
Congratulations on getting started with SeleniumBase!
688693

689694
<i>**Questions or Comments?**</i><br />
690-
[![Join the chat at https://gitter.im/seleniumbase/SeleniumBase](https://badges.gitter.im/seleniumbase/SeleniumBase.svg)](https://gitter.im/seleniumbase/SeleniumBase?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)<br>
695+
[![Join the chat at https://gitter.im/seleniumbase/SeleniumBase](https://badges.gitter.im/seleniumbase/SeleniumBase.svg)](https://gitter.im/seleniumbase/SeleniumBase?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)<br />
691696

692-
[https://github.com/mdmintz](https://github.com/mdmintz)<br>
693-
[https://www.linkedin.com/in/mdmintz](https://www.linkedin.com/in/mdmintz)<br>
697+
[https://github.com/mdmintz](https://github.com/mdmintz)<br />
694698

695-
<img src="https://cdn2.hubspot.net/hubfs/100006/images/new_logo_pre6c.png" title="SeleniumBase" height="40"> <br /> <img src="https://cdn2.hubspot.net/hubfs/100006/images/logo_base_4b.png" title="SeleniumBase" height="150">
699+
<img src="https://cdn2.hubspot.net/hubfs/100006/images/SB_Button3.png" title="SeleniumBase" height="58"> <br /> <img src="https://cdn2.hubspot.net/hubfs/100006/images/logo_base_4b.png" title="SeleniumBase" height="150">

0 commit comments

Comments
 (0)