Skip to content

Commit c0502f4

Browse files
committed
Different tests with different browers
1 parent 272a079 commit c0502f4

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

ci/run_lambdatest.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ REMOTE_URL="https://$LT_USERNAME:$LT_ACCESS_KEY@hub.lambdatest.com/wd/hub"
99
# > config settings
1010
# > if/else conditionals
1111
# > and so much more!
12-
FILTER="tests/test_todo.py" # change/override this as needed!
12+
FILTER="tests/test_cross_browser.py" # change/override this as needed!
1313

1414
# 3. Execute the command
15-
python -m pytest $FILTER --remote_url=$REMOTE_URL
15+
python -m pytest $FILTER --remote_url=$REMOTE_URL -n 2

pylenium.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"page_load_wait_time": 0,
77
"options": [],
88
"capabilities": {
9-
"build": "pytest build 2",
9+
"build": "pytest build 3",
1010
"name": "pytest tutorial",
1111
"platform": "macOS Sierra",
1212
"browserName": "Edge",

tests/test_cross_browser.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
from pylenium.driver import Pylenium
2+
3+
4+
def search(py, query):
5+
py.visit('https://google.com')
6+
py.get('[name="q"]').type(query)
7+
py.get('[name="btnK"]').submit()
8+
return py.should().contain_title(query)
9+
10+
11+
def test_google_search_in_chrome(py: Pylenium):
12+
target = {
13+
"platform": "Windows 10",
14+
"browserName": "Chrome",
15+
"version": "85",
16+
"resolution": "1280x1024"
17+
}
18+
py.config.driver.capabilities.update(target)
19+
assert search(py, 'puppies')
20+
21+
22+
def test_google_search_in_firefox(py: Pylenium):
23+
target = {
24+
"platform": "Windows 10",
25+
"browserName": "Firefox",
26+
"version": "81",
27+
"resolution": "1280x1024"
28+
}
29+
py.config.driver.capabilities.update(target)
30+
assert search(py, 'puppies')

0 commit comments

Comments
 (0)