-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStandarUserTime.py
More file actions
79 lines (58 loc) · 2.27 KB
/
StandarUserTime.py
File metadata and controls
79 lines (58 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import unittest
import time
class Test_Saucedemo01(unittest.TestCase):
def setUp(self):
chrome_options = webdriver.ChromeOptions()
chrome_options.add_argument("--no-sandbox")
chrome_options.add_argument("--disable-gpu")
self.driver = webdriver.Chrome(options=chrome_options)
driver = self.driver
#driver.implicitly_wait(10)
def test_StandarUser(self):
driver = self.driver
driver.get('https://www.saucedemo.com')
driver.maximize_window()
usuario = driver.find_element(By.ID,"user-name")
usuario.send_keys("standard_user")
time.sleep(5)
contra = driver.find_element(By.ID,"password")
contra.send_keys("secret_sauce")
time.sleep(5)
usuario.send_keys(Keys.ENTER)
ButtonSauceBack = driver.find_element(By.ID,"add-to-cart-sauce-labs-backpack")
ButtonSauceBack.click()
time.sleep(5)
ButtonSauceBike = driver.find_element(By.ID,"add-to-cart-sauce-labs-bike-light")
ButtonSauceBike.click()
time.sleep(5)
Carrito = driver.find_element(By.CLASS_NAME,"shopping_cart_link")
Carrito.click()
time.sleep(5)
CheckOut = driver.find_element(By.ID,"checkout")
CheckOut.click()
time.sleep(5)
FirstName = driver.find_element(By.ID,"first-name")
FirstName.send_keys("Diego")
time.sleep(5)
LastName = driver.find_element(By.ID,"last-name")
LastName.send_keys("Cruz")
time.sleep(5)
Zip = driver.find_element(By.ID,"postal-code")
Zip.send_keys("1234")
time.sleep(5)
BContinue = driver.find_element(By.ID,"continue")
BContinue.click()
time.sleep(5)
BFinish = driver.find_element(By.ID,"finish")
BFinish.click()
time.sleep(5)
AlertFinish = driver.find_element(By.CLASS_NAME,"complete-header")
assert AlertFinish.text == "Thank you for your order!", "El valor obtenido no es igual al esperado"
time.sleep(5)
def tearDown(self):
self.driver.quit()
if __name__ == "__main__":
unittest.main()