diff --git a/README.md b/README.md index f76f1ad9..4b012253 100755 --- a/README.md +++ b/README.md @@ -8,10 +8,12 @@ SeleniumBase GitHub Actions SeleniumBase

+

Create web and mobile tests, fast!
Take Selenium and pytest to the next level.

+

🚀 Get Started | 🧙‍♂️ CMD Options | @@ -27,17 +29,20 @@ ⏺️ Recorder | 👩‍🎨 Visual Testing | 🤖 GitHub CI +

Feel good about your test automation.
Control builds from the command line.

+

(Above: test_swag_labs.py running with mobile emulation enabled.)

```bash pytest test_swag_labs.py --mobile ``` + ------

(Below: Same test as above, but running in Demo Mode now.)

@@ -95,7 +100,7 @@ pytest my_first_test.py * Chrome is the default browser if not specified with ``--browser=BROWSER``. * On Linux ``--headless`` is the default behavior (running with no GUI). 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``. -**Here's an example test, [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py):**
+Here's an example test, [my_first_test.py](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py): ```python from seleniumbase import BaseCase @@ -114,7 +119,7 @@ class MyTestClass(BaseCase): self.update_text("input.search-input", "xkcd book\n") self.assert_exact_text("xkcd: volume 0", "h3") ``` -
+ ```bash pytest my_first_test.py --demo ``` @@ -148,10 +153,10 @@ For the complete list of SeleniumBase methods, see: Learn More: -#### **Automatic WebDriver abilities:**
+#### Automatic WebDriver abilities: SeleniumBase automatically handles common WebDriver actions such as spinning up web browsers and saving screenshots during test failures. (
Read more about customizing test runs.) -#### **Simplified code:**
+#### Simplified code: SeleniumBase uses simple syntax for commands, such as: ```python self.update_text("input", "dogs\n") @@ -169,7 +174,7 @@ As you can see, the old WebDriver way is very bad! Use SeleniumBase to make testing much easier! (You can still use ``self.driver`` in your code.) -#### **Run tests with ``pytest`` or ``nosetests`` in any browser:**
+#### Run tests with ``pytest`` or ``nosetests`` in any browser: (Using **pytest** is recommended. **Chrome** is the default browser.) ```bash pytest my_first_test.py --browser=chrome @@ -182,13 +187,13 @@ pytest [FILE_NAME].py::[CLASS_NAME]::[METHOD_NAME] nosetests [FILE_NAME].py:[CLASS_NAME].[METHOD_NAME] ``` -#### **No more flaky tests:**
+#### No more flaky tests: SeleniumBase methods automatically wait for page elements to finish loading before interacting with them (*up to a timeout limit*). This means you no longer need random ``time.sleep()`` statements in your scripts. -#### **Automated/manual hybrid mode:**
+#### Automated/manual hybrid mode: SeleniumBase includes a solution called MasterQA, which speeds up manual testing by having automation perform all the browser actions while the manual tester handles validatation. -#### **Feature-Rich:**
+#### Feature-Rich: For a full list of SeleniumBase features, Click Here. @@ -388,12 +393,12 @@ The ``--report`` option gives you a fancy report after your test suite completes ```bash nosetests test_suite.py --report ``` - + (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.) -### **Using a Proxy Server:** +### Using a Proxy Server: 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. ```bash @@ -411,7 +416,7 @@ pytest proxy_test.py --proxy=proxy1 ``` -### **Changing the User-Agent:** +### Changing the User-Agent: If you wish to change the User-Agent for your browser tests (Chrome and Firefox only), you can add ``--agent="USER AGENT STRING"`` as an argument on the command-line. ```bash @@ -419,14 +424,14 @@ pytest user_agent_test.py --agent="Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1 ``` -### **Building Guided Tours for Websites:** +### Building Guided Tours for Websites: Learn about SeleniumBase Interactive Walkthroughs (in the ``examples/tour_examples`` folder). It's great for prototyping a website onboarding experience. -### **Production Environments & Integrations:** +### Production Environments & Integrations: Here are some things you can do to setup a production environment for your testing: @@ -448,7 +453,7 @@ pytest [YOUR_TEST_FILE].py --with-db-reporting --with-s3-logging -### **Detailed Method Specifications and Examples:** +### Detailed Method Specifications and Examples: #### Navigating to a web page (and related commands) @@ -466,7 +471,7 @@ self.get_current_url() # This method returns the current page URL. self.get_page_source() # This method returns the current page source. ``` -**ProTip™:** You may need to use the get_page_source() method along with Python's find() command to parse through the source to find something that Selenium wouldn't be able to. (You may want to brush up on your Python programming skills for that.) +ProTip™: You may need to use the get_page_source() method along with Python's find() command to parse through the source to find something that Selenium wouldn't be able to. (You may want to brush up on your Python programming skills for that.) ```python source = self.get_page_source() head_open_tag = source.find('') @@ -718,12 +723,19 @@ Additionally, you can use the ``@retry_on_exception()`` decorator to specificall #### Congratulations on getting started with SeleniumBase! -**If you see something, say something!**
[ ](https://github.com/seleniumbase/SeleniumBase/issues?q=is%3Aissue+is%3Aclosed) [](https://github.com/seleniumbase/SeleniumBase/pulls?q=is%3Apr+is%3Aclosed) +

+

If you see something, say something!
+
+

-**If you like us, give us a star!**
[ ](https://github.com/seleniumbase/SeleniumBase/stargazers) +

+

If you like us, give us a star!
+
+

+

https://github.com/mdmintz

-[https://github.com/mdmintz](https://github.com/mdmintz)
+
-[](https://github.com/seleniumbase/SeleniumBase/blob/master/README.md)
[ ](https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE) [Size](https://github.com/seleniumbase/SeleniumBase/releases) [Join the chat!](https://gitter.im/seleniumbase/SeleniumBase) +
Repo Size Join the chat!
Tested with SeleniumBase