Skip to content

Commit d6d48d5

Browse files
Merge pull request #14 from testdevlab/update_readme
Update README.md to include warning to install Python certificates
2 parents 07e1a71 + 71dc198 commit d6d48d5

2 files changed

Lines changed: 56 additions & 19 deletions

File tree

README.md

Lines changed: 55 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,63 @@
11
# Py-TestUI Framework
22

3-
## Appium
3+
# Installation
44

5-
The folder testui contains the logic for Appium Driver and actions. Then you can start a session by using:
5+
Py-TestUI can be installed via `pip`
66

7-
<pre>
8-
driver: TestUIDriver = NewDriver()\
9-
.set_app_path("app.apk")\
10-
.set_app_package_activity("com.package.package", "com.activity.Activity")\
11-
.set_logger("pytest").set_appium_driver()
12-
</pre>
7+
```bash
8+
pip3 install git+https://github.com/testdevlab/Py-TestUI@v1.0.6
9+
```
10+
11+
Or if you prefer `requirements.txt`, you can add the following dependecy
12+
13+
```
14+
git+https://github.com/testdevlab/Py-TestUI@v1.0.6
15+
```
16+
17+
# Appium driver
1318

14-
By default it takes the first connected device to your machine, but you can specify device by calling `.set_udid("udid")`
15-
before the `set_appium_driver()` call
19+
You can create `TestUIDriver` for Appium automation like so:
20+
21+
```py
22+
driver: TestUIDriver = (
23+
NewDriver()
24+
.set_app_path("app.apk")
25+
.set_app_package_activity("com.package.package", "com.activity.Activity")
26+
.set_logger("pytest")
27+
.set_appium_driver()
28+
)
29+
```
1630

17-
## Selenium Desktop
31+
By default it takes the first connected device to your machine, but you can specify device by calling `.set_udid("udid")` before the `.set_appium_driver()` call.
1832

19-
In mac start by `brew install chromedriver`
33+
# Selenium Desktop driver
2034

21-
<pre>
22-
driver: TestUIDriver = NewDriver() \
23-
.set_logger("pytest").set_soft_assert(True).set_selenium_driver()
24-
</pre>
35+
Py-TestUI supports the following browser drivers:
36+
37+
- Google Chrome (`'chrome'`)
38+
- Mozzila Firefox (`'firefox'`)
39+
- Safari (`'safari'`)
40+
- Microsoft Edge (`'edge'`)
41+
- Microsoft Internet Explorer (`'ie'`)
42+
- Opera (`'opera'`)
43+
- PhantomJS(`'pantomjs'`)
44+
45+
> All these drivers must be installed and added to you `$PATH` variable
46+
47+
> Mozzila Firefox is downloaded automatically and added to `$PATH` but
48+
> double-check that you have installed
49+
> [Python certificates if you are using macOS](https://stackoverflow.com/a/53310545/13179904)
50+
51+
You can create `TestUIDriver` for Selenium Desktop automation like so
52+
53+
```python
54+
driver: TestUIDriver = (
55+
NewDriver()
56+
.set_logger("pytest")
57+
.set_soft_assert(True)
58+
.set_selenium_driver()
59+
)
60+
```
2561

2662
# Configuration
2763

@@ -45,9 +81,10 @@ driver: TestUIDriver = (
4581
.set_selenium_driver()
4682
)
4783
```
84+
4885
## Configuration via `driver.configuration`
4986

50-
Another possible way to change default global parameters is to use
87+
Another possible way to change default global parameters is to use
5188
`configuration` attribute located under `driver: TestUIDriver` object. These
5289
parameters can be changed like this at any point of the execution:
5390

@@ -83,7 +120,7 @@ The automation infrastructure implements the Page Object Model (POM) pattern. Th
83120
.
84121
```
85122

86-
The test case scripts are in a different class. The scripts import the respective screen package along with additional packages such as PyTest. Each class has any amount of tests. All test methods start with the word “test_” such as:
123+
The test case scripts are in a different class. The scripts import the respective screen package along with additional packages such as PyTest. Each class has any amount of tests. All test methods start with the word “test\_” such as:
87124

88125
```py
89126
def test_add_existing_contact(self, appium_driver):

testui/support/testui_driver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ def save_screenshot(self, image_name=""):
168168
root_dir = config.screenshot_path
169169
if not config.screenshot_path:
170170
root_dir = path.dirname(path.dirname(path.dirname(path.abspath(__file__))))
171+
root_dir = path.join(root_dir, "report_screenshots")
171172

172-
root_dir = path.join(root_dir, "report_screenshots")
173173
Path(root_dir).mkdir(parents=True, exist_ok=True)
174174

175175
current_time = datetime.now().strftime("%Y-%m-%d%H%M%S")

0 commit comments

Comments
 (0)