forked from Priyansh-15/Job_Helper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
UI_test.py
50 lines (36 loc) · 1.39 KB
/
UI_test.py
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
# lambdatest_test.py
import os
import time
import unittest
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.common.by import By
username = os.environ.get("LT_USERNAME")
access_key = os.environ.get("LT_ACCESS_KEY")
class FirstSampleTest(unittest.TestCase):
# setUp runs before each test case
def setUp(self):
#object of ChromeOptions
options = webdriver.ChromeOptions()
#setting headless parameter
options.headless = True
self.driver = webdriver.Chrome(options=options)
# tearDown runs after each test case
def tearDown(self):
self.driver.quit()
def test_unit_user_should_able_to_add_item(self):
# try:
driver = self.driver
# Url
driver.get("http://localhost:3001/")
# Click on name txt box
name_box = driver.find_element(By.XPATH,'//*[@id="root"]/div/div/div/form/div/div[1]/fieldset/div/div[1]/input')
name_box.send_keys("Koustubh Sinha")
# Click on slider
slider = driver.find_element(By.XPATH,'//*[@id="root"]/div/div/div/form/div/div[2]/fieldset/div/div[1]/span[2]/span[3]')
slider.click()
# Enter next
next= driver.find_element(By.XPATH,'//*[@id="root"]/div/div/div/form/div/center/a/div')
next.click()
if __name__ == "__main__":
unittest.main()