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 0d1abad

Browse files
Add files via upload
1 parent 73be0aa commit 0d1abad

File tree

1 file changed

+62
-0
lines changed

1 file changed

+62
-0
lines changed

‎lambdatest_test.py

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import unittest, time, re
2+
import base_test
3+
from selenium import webdriver
4+
5+
from selenium.webdriver.common.keys import Keys
6+
7+
class LambdaTest(base_test.BaseTest):
8+
9+
def test_unit_user_should_able_to_add_item(self):
10+
11+
# try:
12+
13+
driver = self.driver
14+
15+
# Url
16+
17+
driver.get(self.base_url)
18+
19+
# Click on check box
20+
21+
check_box_one = driver.find_element_by_name("li1")
22+
23+
check_box_one.click()
24+
25+
# Click on check box
26+
27+
check_box_two = driver.find_element_by_name("li2")
28+
29+
check_box_two.click()
30+
31+
# Enter item in textfield
32+
33+
textfield = driver.find_element_by_id("sampletodotext")
34+
35+
textfield.send_keys("Yey, Let's add it to list")
36+
37+
# Click on add button
38+
39+
add_button = driver.find_element_by_id("addbutton")
40+
41+
add_button.click()
42+
43+
# Verified added item
44+
45+
added_item = driver.find_element_by_xpath("/html/body/div/div/div/ul/li[6]/span").text
46+
47+
print (added_item)
48+
49+
#Assertion
50+
if "Yey, Let's add it to list" in added_item:
51+
driver.execute_script("lambda-status=passed")
52+
53+
else:
54+
driver.execute_script("lambda-status=failed")
55+
56+
57+
58+
59+
60+
if __name__ == "__main__":
61+
62+
unittest.main()

0 commit comments

Comments
(0)

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