Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0436963

Browse files
Fixes
1 parent 6745be4 commit 0436963

File tree

5 files changed

+34
-11
lines changed

5 files changed

+34
-11
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__pycache__

‎.gitpod.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# This configuration file was automatically generated by Gitpod.
2+
# Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file)
3+
# and commit this file to your remote git repository to share the goodness with others.
4+
5+
tasks:
6+
- init: pip install -r requirements.txt
7+
command: python lambdatest_test.py && nosetests test_sample.py
8+
vscode:
9+
extensions:
10+
- ms-python.python
11+

‎README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
- Run following command
4141
* Execution
4242
```
43-
$ python lambdatest_test.py or nosetests test_sample.py
43+
$ python lambdatest_test.py
44+
nosetests lambdatest_test.py
4445
```
4546
4647
##### Routing traffic through your local machine

‎lambdatest_test.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,31 @@
66
username = os.environ.get("LT_USERNAME")
77
access_key = os.environ.get("LT_ACCESS_KEY")
88

9+
910
class FirstSampleTest(unittest.TestCase):
1011

1112
# setUp runs before each test case
1213
def setUp(self):
1314
desired_caps = {
14-
"build": 'unittest sample build',
15-
"name": 'Py-UnitTest',
16-
"platform": 'Windows 10',
17-
"browserName": 'firefox',
18-
"version": 'latest'
15+
'LT:Options': {
16+
"user": username,
17+
"accessKey": access_key,
18+
"build": "UnitTest-Selenium-Sample",
19+
"name": "UnitTest-Selenium-Test",
20+
"platformName": "Windows 11",
21+
"selenium_version": "4.0.0"
22+
},
23+
"browserName": "Chrome",
24+
"browserVersion": "latest",
1925
}
26+
2027
self.driver = webdriver.Remote(
21-
command_executor="http://{}:{}@hub.lambdatest.com:80/wd/hub".format(username, access_key),
22-
desired_capabilities=desired_caps)
28+
command_executor="http://hub.lambdatest.com:80/wd/hub",
29+
desired_capabilities=desired_caps)
2330

2431

2532
# tearDown runs after each test case
33+
2634
def tearDown(self):
2735
self.driver.quit()
2836

@@ -50,8 +58,10 @@ def test_unit_user_should_able_to_add_item(self):
5058
add_button.click()
5159

5260
# Verified added item
53-
added_item = driver.find_element_by_xpath("//span[@class='done-false']").text
54-
print (added_item)
61+
added_item = driver.find_element_by_xpath(
62+
"//span[@class='done-false']").text
63+
print(added_item)
64+
5565

5666
if __name__ == "__main__":
5767
unittest.main()

‎requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
ConfigParser
2-
selenium>2.5
2+
selenium>4.0.0
33
pytest
44
nose
55
pytest-xdist

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /