-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlockUser.py
More file actions
66 lines (45 loc) · 2.03 KB
/
lockUser.py
File metadata and controls
66 lines (45 loc) · 2.03 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
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
import unittest
import time
class Test_Saucedemo02(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_LockUser(self):
driver = self.driver
driver.get('https://www.saucedemo.com')
usuario = driver.find_element(By.ID,"user-name")
usuario.send_keys("locked_out_user")
contra = driver.find_element(By.ID,"password")
contra.send_keys("secret_sauce")
usuario.send_keys(Keys.ENTER)
ButtonSauceBack = driver.find_element(By.ID,"add-to-cart-sauce-labs-backpack")
ButtonSauceBack.click()
ButtonSauceBike = driver.find_element(By.ID,"add-to-cart-sauce-labs-bike-light")
ButtonSauceBike.click()
Carrito = driver.find_element(By.CLASS_NAME,"shopping_cart_link")
Carrito.click()
CheckOut = driver.find_element(By.ID,"checkout")
CheckOut.click()
FirstName = driver.find_element(By.ID,"first-name")
FirstName.send_keys("Diego")
LastName = driver.find_element(By.ID,"last-name")
LastName.send_keys("Cruz")
Zip = driver.find_element(By.ID,"postal-code")
Zip.send_keys("1234")
BContinue = driver.find_element(By.ID,"continue")
BContinue.click()
BFinish = driver.find_element(By.ID,"finish")
BFinish.click()
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"
def tearDown(self):
self.driver.quit()
if __name__ == "__main__":
unittest.main()