Skip to content

Commit 13d68eb

Browse files
4D6172784D617278
4D617278
authored and
4D617278
committed
07/29
1 parent 46de0a8 commit 13d68eb

File tree

5 files changed

+97
-84
lines changed

5 files changed

+97
-84
lines changed

docs/testing/EXPLAIN_FILES.md

+81
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Understanding important files in the WebApp/tests/browserstack directory
2+
3+
-rw-r--r-- 1 rpite rpite 6122 Jul 5 14:00 add_devices.py</br>
4+
-rw-r--r-- 1 rpite rpite 3929 Jun 20 17:22 automate.py</br>
5+
-rw-r--r-- 1 rpite rpite 476 Jul 27 13:13 browserstack.config.js</br>
6+
-rw-r--r-- 1 rpite rpite 337 May 15 12:33 browserstack.config-template.js</br>
7+
-rw-r--r-- 1 rpite rpite 5358 Jul 29 08:25 config.py</br>
8+
-rw-r--r-- 1 rpite rpite 6603 Jul 15 14:16 devices_to_test.json</br>
9+
-rw-r--r-- 1 rpite rpite 112 Apr 27 05:15 .eslintrc</br>
10+
-rw-r--r-- 1 rpite rpite 4744 Jul 29 08:26 parallel.wdio.config.js</br>
11+
-rw-r--r-- 1 rpite rpite 117 May 21 18:51 README.md</br>
12+
-rw-r--r-- 1 rpite rpite 1551 Jul 13 10:33 remove_devices.py</br>
13+
-rw-r--r-- 1 rpite rpite 1852 Jul 27 13:30 repl</br>
14+
-rw-r--r-- 1 rpite rpite 78 Jul 29 10:42 requirements.txt</br>
15+
drwxr-xr-x 2 rpite rpite 4096 Jul 29 10:25 specs</br>
16+
-rwxr-xr-x 1 rpite rpite 1607 Jul 15 05:52 testScript</br>
17+
-rw-r--r-- 1 rpite rpite 7979 Jul 27 13:29 utils.js</br>
18+
-rw-r--r-- 1 rpite rpite 4169 Jul 29 08:21 wdio.conf.js</br>
19+
-rw-r--r-- 1 rpite rpite 4564 Jul 29 07:55 wdio.conf.template</br>
20+
21+
## Python Scripts
22+
23+
Requires python3+
24+
25+
To install python3 modules do:
26+
27+
$ pip3 install -r requirements.txt
28+
29+
### add_devices.py
30+
31+
Adds device json to the devices_to_test.json file. Use -h for help.
32+
33+
### automate.py
34+
35+
Automatically inserts code into test script file. Requires [i3-wm](https://i3wm.org/) and xclip. Use -h for help.
36+
37+
### remove_devices.py
38+
39+
Removes device json from the devices_to_test.json file. Use -h for help.
40+
41+
### config.py
42+
43+
Uses the wdio.config.template file to generate the wdio.config.js file, which is used for running the test. Use -h for help.
44+
45+
## Javascript files
46+
47+
### browserstack.config.js
48+
49+
Configuration file for test scripts.
50+
51+
### parallel.wdio.config.js
52+
53+
Template file for creating wdio.config.template.
54+
55+
### utils.js
56+
57+
Defines javascript functions used in test scripts.
58+
59+
### wdio.conf.js
60+
61+
Configuration for test run by webdriverio.
62+
63+
## Bash scripts
64+
65+
Requires bash
66+
67+
### testScript
68+
69+
Generates the template file named wdio.config.template which acts as a template for creating wdio.config.js as well as creates the script using the script name parameter if it does not already exist.
70+
71+
## Miscellaneous files
72+
73+
### repl
74+
75+
Copied and pasted into the [wdio repl](https://webdriver.io/docs/repl.html) to use the functions defined in utils.js
76+
77+
### wdio.conf.template
78+
79+
Template file for creating wdio.conf.js
80+
81+

tests/browserstack/config.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
parser.add_argument('-t', '--timeout', default=360000, type=int, help='time before test ends')
2121
parser.add_argument('-m', '--isMobileScreenSize', action='store_true', help='set mobile-screen to true')
2222
parser.add_argument('-d', '--isCordova', action='store_true', help='set isCordovaFromAppStore to true')
23-
parser.add_argument('-r', '--resolution', default='', type=str, help='set screen resolution')
23+
parser.add_argument('-r', '--resolution', default='', type=str, help='set screen resolution (1080x1920)')
24+
parser.add_argument('-o', '--orientation', default='', type=str, help='set screen orientation (LANDSCAPE/PORTRAIT)')
2425
parser.add_argument('--acceptSslCerts', action='store_false', help='do not use https')
2526
parser.add_argument('--connectionRetryTimeout', default=90000, type=int, help='time before connection is retried')
2627
parser.add_argument('--connectionRetryCount', default=3, type=int, help='number of times connection is retried')

tests/browserstack/example.wdio.config.js

-83
This file was deleted.

tests/browserstack/parallel.wdio.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ exports.config = {
2727
browser_version: '%browser_version0',
2828
real_mobile: %real_mobile,
2929
acceptSslCerts: %acceptSslCerts,
30+
resolution: '%resolution',
31+
orientation: '%orientation',
3032
'browserstack.console': 'info',
3133
'browserstack.appium_version': '%browserstack.appium_version0',
3234
'browserstack.local': %browserstack.local,
@@ -47,6 +49,8 @@ exports.config = {
4749
browser_version: '%browser_version1',
4850
real_mobile: %real_mobile,
4951
acceptSslCerts: %acceptSslCerts,
52+
resolution: '%resolution',
53+
orientation: '%orientation',
5054
'browserstack.console': 'info',
5155
'browserstack.appium_version': '%browserstack.appium_version1',
5256
'browserstack.local': %browserstack.local,
@@ -67,6 +71,8 @@ exports.config = {
6771
browser_version: '%browser_version2',
6872
real_mobile: %real_mobile,
6973
acceptSslCerts: %acceptSslCerts,
74+
resolution: '%resolution',
75+
orientation: '%orientation',
7076
'browserstack.console': 'info',
7177
'browserstack.appium_version': '%browserstack.appium_version2',
7278
'browserstack.local': %browserstack.local,
@@ -87,6 +93,8 @@ exports.config = {
8793
browser_version: '%browser_version3',
8894
real_mobile: %real_mobile,
8995
acceptSslCerts: %acceptSslCerts,
96+
resolution: '%resolution',
97+
orientation: '%orientation',
9098
'browserstack.console': 'info',
9199
'browserstack.appium_version': '%browserstack.appium_version3',
92100
'browserstack.local': %browserstack.local,
@@ -107,6 +115,8 @@ exports.config = {
107115
browser_version: '%browser_version4',
108116
real_mobile: %real_mobile,
109117
acceptSslCerts: %acceptSslCerts,
118+
resolution: '%resolution',
119+
orientation: '%orientation',
110120
'browserstack.console': 'info',
111121
'browserstack.appium_version': '%browserstack.appium_version4',
112122
'browserstack.local': %browserstack.local,

tests/browserstack/requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
selenium
2+
pyperclip
3+
pyautogui
4+
pynput

0 commit comments

Comments
 (0)