Update ReadMe files

This commit is contained in:
Michael Mintz 2018-02-01 17:05:54 -05:00
parent f54fa21f19
commit fc46f8860e
3 changed files with 18 additions and 18 deletions

View File

@ -112,8 +112,6 @@ pytest my_first_test.py --with-selenium --browser=chrome --demo_mode
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.) 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.)
If you ever make any changes to your local copy of ``settings.py``, you may need to run ``python setup.py develop`` for those changes to take effect.
```bash ```bash
nosetests my_first_test.py --with-selenium --browser=chrome --demo_mode --demo_sleep=1.2 nosetests my_first_test.py --with-selenium --browser=chrome --demo_mode --demo_sleep=1.2
``` ```
@ -158,6 +156,8 @@ pytest my_first_test.py --with-testing_base --browser=chrome
(NOTE: If you're using **pytest** instead of nosetests for running tests outside of the SeleniumBase repo, **you'll need a copy of [pytest.ini](https://github.com/seleniumbase/SeleniumBase/blob/master/pytest.ini) at the base of the new folder structure, already provided here.** (NOTE: If you're using **pytest** instead of nosetests for running tests outside of the SeleniumBase repo, **you'll need a copy of [pytest.ini](https://github.com/seleniumbase/SeleniumBase/blob/master/pytest.ini) at the base of the new folder structure, already provided here.**
If you want to pass additional data from the command line to your tests, you can use ``--data=STRING``. Now inside your tests, you can use ``self.data`` to access that.
<a id="creating_visual_reports"></a> <a id="creating_visual_reports"></a>
### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Creating Visual Test Suite Reports:** ### ![http://seleniumbase.com](https://cdn2.hubspot.net/hubfs/100006/images/super_logo_tiny.png "SeleniumBase") **Creating Visual Test Suite Reports:**
@ -349,10 +349,10 @@ self.click('a[name*="partial_name"]')
#### Asserting visibility of text inside an element on a page within some number of seconds: #### Asserting visibility of text inside an element on a page within some number of seconds:
```python ```python
self.wait_for_text_visible("Make it so!", "div#trek div.picard div.quotes", timeout=3) self.assert_text("Make it so!", "div#trek div.picard div.quotes")
self.wait_for_text_visible("Tea. Earl Grey. Hot.", "div#trek div.picard div.quotes", timeout=1) self.assert_text("Tea. Earl Grey. Hot.", "div#trek div.picard div.quotes", timeout=3)
``` ```
(NOTE: The short versions of this are ``self.find_text(TEXT, ELEMENT)`` and ``self.assert_text(TEXT, ELEMENT)``) (NOTE: ``self.find_text(TEXT, ELEMENT)`` and ``self.wait_for_text(TEXT, ELEMENT)`` also do this. For backwords compatibility, older method names were kept, but the default timeout may be different.)
#### Asserting Anything #### Asserting Anything

View File

@ -1,6 +1,6 @@
## Running SeleniumBase Scripts ## Running SeleniumBase Scripts
(NOTE: If you didn't install SeleniumBase properly, these scripts won't work. Installation steps include "``pip install seleniumbase``" and/or "``python setup.py install``" from the top-level directory.) (NOTE: If you didn't install SeleniumBase properly, these scripts won't work. Installation steps include "``pip install seleniumbase``" and/or "``python setup.py develop``" from the top-level directory.)
To makes things easier, here's a simple GUI program that allows you to kick off a few example scripts by pressing a button: To makes things easier, here's a simple GUI program that allows you to kick off a few example scripts by pressing a button:
@ -14,7 +14,7 @@ python gui_test_runner.py
![](http://cdn2.hubspot.net/hubfs/100006/images/GUI_Test_Runner_5.png "GUI Test Runner") ![](http://cdn2.hubspot.net/hubfs/100006/images/GUI_Test_Runner_5.png "GUI Test Runner")
If you run scripts with logging enabled, (using ``--with-testing_base``), youll 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). Make sure to run ``python setup.py install`` for your changes to take effect if you make any changes to that file. If you run scripts with logging enabled, (using ``--with-testing_base``), youll 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).
**For running scripts the usual way, here are some of the example run commands:** **For running scripts the usual way, here are some of the example run commands:**

View File

@ -76,7 +76,7 @@ sudo pip install -r server_requirements.txt --upgrade
#### Step 12. Install SeleniumBase (Make sure you already installed the requirements above) #### Step 12. Install SeleniumBase (Make sure you already installed the requirements above)
```bash ```bash
sudo python server_setup.py install sudo python server_setup.py develop
``` ```
#### Step 13. Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) in Chrome to verify installation (Takes ~10 seconds) #### Step 13. Run an [example test](https://github.com/seleniumbase/SeleniumBase/blob/master/examples/my_first_test.py) in Chrome to verify installation (Takes ~10 seconds)
@ -146,7 +146,7 @@ If you have a web application that you want to test, you'll be able to create Se
* Give the instance a zone * Give the instance a zone
* Click "Create" * Click "Create"
#### Step 22. Get the Connection credentials for your new MySQL DB #### Step 22. Get the Connection credentials for your new MySQL Instance
* Under the Google Cloud Platform menu, go to "Compute Engine" * Under the Google Cloud Platform menu, go to "Compute Engine"
* Find your new MySQL instance and then write down the value written in the "External IP" section. * Find your new MySQL instance and then write down the value written in the "External IP" section.
@ -154,23 +154,23 @@ If you have a web application that you want to test, you'll be able to create Se
* Find your new MySQL instance and then click on it. * Find your new MySQL instance and then click on it.
* Write down the values for Admin username and password. (Username should be "root") * Write down the values for Admin username and password. (Username should be "root")
#### Step 23. Get a MySQL GUI tool so that you can connect to your MySQL DB #### Step 23. Get a MySQL GUI tool so that you can connect to your MySQL Instance
* You can download [MySQL Workbench](http://dev.mysql.com/downloads/tools/workbench/) for this. * You can download [MySQL Workbench](http://dev.mysql.com/downloads/tools/workbench/) for this.
#### Step 24. Create a new connection to your MySQL DB #### Step 24. Create a new connection to your MySQL Instance
* Use the MySQL DB credentials that you saved in Step 21 for this. * Use the MySQL DB credentials that you saved in Step 21 for this.
#### Step 25. Create a new schema in your MySQL DB #### Step 25. Create a new database/schema in your MySQL Instance
* You can name your schema ``test``. * You can name your database/schema ``test_db``.
#### Step 26. Create the necessary tables in your MySQL schema #### Step 26. Create the necessary tables in your MySQL database/schema
* Run a SQL script in your MySQL schema using [testcaserepository.sql](https://raw.githubusercontent.com/seleniumbase/SeleniumBase/master/seleniumbase/core/testcaserepository.sql) * Run a SQL script in your MySQL database/schema using [testcaserepository.sql](https://raw.githubusercontent.com/seleniumbase/SeleniumBase/master/seleniumbase/core/testcaserepository.sql)
#### Step 27. Have your local clone of SeleniumBase connect to your MySQL DB #### Step 27. Have your local clone of SeleniumBase connect to your MySQL Instance
* Update the MySQL connection details in your [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) file to use the credentials that you saved in Step 21. * Update the MySQL connection details in your [settings.py](https://github.com/seleniumbase/SeleniumBase/blob/master/seleniumbase/config/settings.py) file to use the credentials that you saved in Step 21.
* Run the following command again from the top-level SeleniumBase folder to make sure that SeleniumBase uses the updated credentials: * Run the following command again from the top-level SeleniumBase folder to make sure that SeleniumBase uses the updated credentials:
@ -179,7 +179,7 @@ If you have a web application that you want to test, you'll be able to create Se
sudo python setup.py install sudo python setup.py install
``` ```
#### Step 28. Have your SeleniumBase Jenkins jobs use your MySQL DB #### Step 28. Have your SeleniumBase Jenkins jobs use your MySQL Instance
* For the "Execute shell", use the following as your updated "Command": * For the "Execute shell", use the following as your updated "Command":
@ -192,6 +192,6 @@ nosetests examples/my_test_suite.py --with-selenium --headless --browser=chrome
#### Step 29. Run your new Jenkins job #### Step 29. Run your new Jenkins job
* Click on "Build Now" * Click on "Build Now"
* If all goes well, you should be seeing new rows appear in your MySQL DB. * If all goes well, you should be seeing new rows appear in your MySQL DB tables.
#### Step 30. Congratulations! If you made it this far, you're awesome! #### Step 30. Congratulations! If you made it this far, you're awesome!