class TestloginU15678(unittest.TestCase): def setUp(self): self.driver = create_driver.get_browser_instance() self.driver.maximize_window() self.driver.implicitly_wait(30) self.login = LoginPage(self.driver) self.home = HomePage(self.driver) def tearDown(self): self.driver.close() def test_valid_login_TC156826(self): data = json.load(open('./test/regression/login/test-data/U15678.json')) self.login.wait_for_login_page_to_load() time.sleep(10) self.login.get_username_textbox().send_keys(data['TC156826']['UN']) self.login.get_password_textbox().send_keys(data['TC156826']['PWD']) self.login.get_login_buton().click() #Verify Home Page self.home.wait_for_home_page_to_load() print("Actual title :", self.driver.title) actual_title = self.driver.title expected_title = data['TC156826']['title'] assert actual_title == expected_title #Logout from application self.home.get_logout_button().click() #Verify the LoginPage self.login.wait_for_login_page_to_load() def test_valid_login_TC156826(self): self.driver.get_screenshot_as_file('Sampleimage.jpg')
class TestLoginS123(unittest.TestCase): def setUp(self): self.driver=create_drivers.get_driver_instance() #self.driver=Chrome('C:/Users/dinu/PycharmProjects/New_actiTIME/browser_server/chromedriver.exe') #self.driver.get("http://localhost") #self.driver.implicitly_wait(30) #self.driver.maximize_window() self.login=LoginPage(self.driver) self.home=HomePage(self.driver) def tearDown(self): self.driver.close() def test_valid_login_tc132(self): data=json.load(open('C:/Users/dinu/PycharmProjects/actiTIME/test/regression/login/test_data.json')) self.login.wait_for_login_page_to_load() self.login.get_username_textbox().send_keys(data['TC123567']['username']) self.login.get_password_textbox().send_keys(data['TC123567']['pwd']) # self.login.get_username_textbox().send_keys("admin") # self.login.get_password_textbox().send_keys("manager") self.login.get_login_button().click() self.home.wait_for_home_page_to_load() actual_title=self.driver.title assert actual_title==data['TC123567']['title'] print(actual_title) #expected_title = 'actiTIME - Enter Time-Track' #assert actual_title==expected_title self.home.get_logout_button().click() self.login.wait_for_login_page_to_load()
class TestLoginS13576(unittest.TestCase): def setUp(self): self.driver = create_driver.get_driver_instance() self.login_page = LoginPage(self.driver) self.home_page = HomePage(self.driver) def tearDown(self): self.driver.close() def test_login_valid_tc123456(self): data = json.load(open('./test/regression/login/S13576.json')) # Go to Login page self.login_page.wait_for_login_page_to_load() # Enter valid Username self.login_page.get_username_textbox().send_keys( data['TC123456']['username']) # Enter Valid password self.login_page.get_password_textbox().send_keys( data['TC123456']['password']) # Click on Login Button self.login_page.get_login_button().click() # Wait for Home Page get Title and verify self.home_page.wait_for_home_page_to_load() actual_title = self.driver.title expected_title = data['TC123456']['home_page_title'] assert actual_title == expected_title # Click on Logout self.home_page.get_logout_button().click() # Wait for Login page get Title and Verify self.login_page.wait_for_login_page_to_load() actual_title = self.driver.title expected_title = data['TC123456']['login_page_title'] assert actual_title == expected_title
class TestLoginS15826(unittest.TestCase): def setUp(self): self.driver = create_driver.get_driver_instance() self.login = Login_Page(self.driver) self.home = HomePage(self.driver) def tearDown(self): self.driver.close() def test_valid_login_TC123567(self): data = json.load(open('./test/regression/login/S15826.json')) #Go to login page self.login.wait_for_login_page_to_load() #Enter UN self.login.get_username_textbox().send_keys( data['TC123567']['username']) #Enter password self.login.get_password_textbox().send_keys(data['TC123567']['pwd']) #Click on login button self.login.get_login_button().click() #Get title of the webpage and verify self.home.wait_for_home_page_to_load() actual_title = self.driver.title print('actual title', actual_title) assert actual_title == data['TC123567'][ 'title'], 'Failed due to title mismatched' self.home.get_logout_button().click() self.login.wait_for_login_page_to_load()
class TestLoginS13245(unittest.TestCase): def setUp(self): self.driver = create_driver.get_driver_instance() self.login_page = LoginPage(self.driver) self.home_page = HomePage(self.driver) def tearDown(self): self.driver.close() def test_login_success_tc14578(self): data = json.load(open("./test/regression/login/S13245.json")) # 1. Go to Login page self.login_page.wait_for_login_page_to_load() # 2. Enter valid UN and PWD self.login_page.get_username_textbox().send_keys( data['TC14578']['username']) self.login_page.get_password_textbox().send_keys( data['TC14578']['password']) # 3. Click on Login Button self.login_page.get_login_button().click() # 4. Select time track user name self.home_page.wait_for_home_page_to_load() user_name = self.home_page.get_time_drop_down() act = ActionChains(self.driver) time.sleep(5) act.move_to_element(user_name).click().send_keys( data['TC14578']['drop_down_name']).click().perform()
def setUp(self): self.driver = Chrome("C://chromedriver.exe") self.driver.maximize_window() self.driver.implicitly_wait(40) self.driver.get("https://demo.actitime.com/") self.login = LoginPage(self.driver) self.home = HomePage(self.driver) self.user = UserPage(self.driver)
def setUp(self): self.driver=create_drivers.get_driver_instance() #self.driver=Chrome('C:/Users/dinu/PycharmProjects/New_actiTIME/browser_server/chromedriver.exe') #self.driver.get("http://localhost") #self.driver.implicitly_wait(30) #self.driver.maximize_window() self.login=LoginPage(self.driver) self.home=HomePage(self.driver)
class TestLoginS13245(unittest.TestCase): def setUp(self): self.driver = create_driver.get_driver_instance() self.login_page = LoginPage(self.driver) self.home_page = HomePage(self.driver) self.userlist_page = UserListPage(self.driver) def tearDown(self): self.driver.close() def test_login_success_tc14578(self): data = json.load(open("./test/regression/login/S13245.json")) # 1. Go to Login page self.login_page.wait_for_login_page_to_load() # 2. Enter valid UN and PWD self.login_page.get_username_textbox().send_keys( data['TC14578']['username']) self.login_page.get_password_textbox().send_keys( data['TC14578']['password']) # 3. Click on Login Button self.login_page.get_login_button().click() # 4. Click on user tab self.home_page.get_user_tab().click() # 5. Click on New user self.userlist_page.get_new_user_tab().click() time.sleep(3) # 6. Add new user to list self.userlist_page.get_new_user_first_name_textbox().send_keys( data["TC13246"]["first_name"]) self.userlist_page.get_new_user_last_name_textbox().send_keys( data["TC13246"]["last_name"]) self.userlist_page.get_new_user_email_textbox().send_keys( data["TC13246"]["mail_id"]) department = self.userlist_page.get_departname() act = ActionChains(self.driver) act.move_to_element(department).click().send_keys( data["TC13246"]["depart_name"]).click().perform() time.sleep(5) hire_date = self.userlist_page.get_hire_date() act.move_to_element(hire_date).click().send_keys( data["TC13246"]["hire1_date"]).perform() time.sleep(5) # 7. Click on save and send button self.userlist_page.get_save_send_button().click() time.sleep(5) # 8 . Verify success message actual_success_message = self.userlist_page.get_success_msg().text print(actual_success_message) expected_success_message = data["TC13246"]["success_message"] print(expected_success_message) assert actual_success_message == expected_success_message, "New user is not added successfully"
class CreateTaskU15632(unittest.TestCase): def setUp(self): self.driver = create_drivers.get_driver_instance() self.login = LoginPage(self.driver) self.home = HomePage(self.driver) self.open_task = OpenTaskPage(self.driver) self.add_task = AddNewTaskPage(self.driver) def tearDown(self): self.driver.close() def test_create_taskTC132576(self): data = json.load( open( "C:/Users/dinu/PycharmProjects/actiTIME/test/regression/login/test_data.json" )) self.login.wait_for_login_page_to_load() self.login.get_username_textbox().send_keys( data['TC123567']['username']) self.login.get_password_textbox().send_keys(data['TC123567']['pwd']) self.login.get_login_button().click() self.open_task.wait_for_open_task_page_to_load() self.open_task.get_add__new_task_button().click() self.add_task.wait_for_add_new_task_page_to_load() self.add_task.select_customer() self.add_task.get_customer_textbox().send_keys( data['TC132576']['cName']) self.add_task.get_project_textbox().send_keys( data['TC132576']['project']) self.add_task.get_task_textbox().send_keys(data['TC132576']['task']) self.add_task.get_create_task_button().click() self.open_task.wait_for_open_task_page_to_load() customer_msg = self.open_task.get_creation_msg(1).text assert data['TC132576']['cName'] in customer_msg project_msg = self.open_task.get_creation_msg(2).text assert data['TC132576']['project'] in project_msg task_msg = self.open_task.get_creation_msg(3).text assert data['TC132576']['cName'] in task_msg assert data['TC132576']['project'] in task_msg self.home.get_logout_button().click() self.login.wait_for_login_page_to_load()
class TestComponent(unittest.TestCase): def setUp(self): self.driver = create_driver.get_driver_instance() self.home = HomePage(self.driver) self.login = LoginPage(self.driver) self.logout = LogOut(self.driver) def tearDown(self): self.driver.close() def test_framework_component(self): self.home.wait_for_home_page_to_load() self.home.get_login_button().click() self.login.wait_for_login_page_to_load() self.login.get_email_textbox().send_keys('*****@*****.**') self.login.get_password_textbox().send_keys('Mgaurav1107') self.login.get_login_btton().click() self.logout.get_setting_button().click() self.logout.get_logout_button().click()
class TestSample(unittest.TestCase): def setUp(self): self.driver = Chrome("C://chromedriver.exe") self.driver.maximize_window() self.driver.implicitly_wait(40) self.driver.get("https://demo.actitime.com/") self.login = LoginPage(self.driver) self.home = HomePage(self.driver) self.user = UserPage(self.driver) def tearDown(self): self.driver.close() def test_invalid_login_TC13121(self): Data = json.load(open("./test/regression/login/UserStory123.json")) self.login.wait_for_login_page_to_load() self.login.get_username_textbox().send_keys( Data['TC12345']['Username1']) self.login.get_password_textbox().send_keys( Data['TC12345']['Password1']) self.login.get_login_button().click() actual_error_msg = self.login.get_login_error_msg().text expected_error_msg = "Username or Password is invalid. Please try again." assert actual_error_msg == expected_error_msg, "Its invalid" def test_Add_User(self): Data = json.load(open("./test/regression/login/UserStory123.json")) self.login.wait_for_login_page_to_load() self.login.get_username_textbox().send_keys( Data['TC12345']['Username']) self.login.get_password_textbox().send_keys( Data['TC12345']['Password']) self.login.get_login_button().click() self.home.get_users_button().click() self.user.get_add_user_button().click() self.user.wait_for_add_user_to_load() self.user.get_first_name_textbox().send_keys("Kushal") self.user.get_last_name_textbox().send_keys("R") self.user.get_email_textbox().send_keys("*****@*****.**") self.user.get_dropdown_list().click() self.user.get_department_dropdown().click() self.user.get_save_send_invitation_button().click()
class createTaskU15632(unittest.TestCase): def setUp(self): self.driver = create_driver.get_driver_instance() self.login = Login_Page(self.driver) self.home = HomePage(self.driver) self.open_task = open_task_page(self.driver) self.add_task = AddNewTaskPage(self.driver) def tearDown(self): self.driver.close() def test_create_task_TC132576(self): data = json.load(open('./test/regression/task/415632.json')) self.login.wait_for_login_page_to_load() self.login.get_username_textbox().send_keys(data['un']) self.login.get_password_textbox().send_keys(data['pwd']) self.login.get_login_button().click() self.home.task_page_link().click() self.open_task.wait_for_open_task_to_load() self.open_task.get_add_new_task_button().click() self.add_task.wait_for_add_new_task_page() self.add_task.select_customer() self.add_task.get_customername_textbox().send_keys( data['TC132576']['cName']) self.add_task.get_projectname_textbox().send_keys( data['TC132576']['project']) self.add_task.get_task_first_textbox().send_keys( data['TC132576']['task']) self.add_task.get_create_task_button().click() self.open_task.wait_for_open_task_to_load() customer_msg = self.open_task.get_creation_msg(1).text assert data['TC132576']['cName'] in customer_msg project_msg = self.open_task.get_creation_msg(2).text assert data['TC132576']['project'] in project_msg task_msg = self.open_task.get_creation_msg(3).text assert data['TC132576']['cName'] in task_msg assert data['TC132576']['project'] in task_msg self.home.get_logout_button().click() self.login.wait_for_login_page_to_load()
class TestLoginS13570(TestCase): def setUp(self): self.driver = create_driver.get_browser_instance() self.login_page = LoginPage(self.driver) self.home_page = HomePage(self.driver) def tearDown(self): self.driver.close() def test_login_valid_tc12323(self): data= json.load(open('./test/regression/login/S13570.json')) self.login_page.wait_for_login_page_to_load() self.login_page.get_username_textbox().send_keys(data['TC12323'] ['username']) self.login_page.get_password_testbox().send_keys(data['TC12323'] ['password']) self.login_page.get_loggin_button().click() self.home_page.wait_for_home_page_to_load() actual_title = self.driver.title assert actual_title = data['TC12323'] ['home_page_title'] logout_link_status = self.home_page.get_logout_button().is_enabled() assert logout_link_status == True self.home_page.get_logout_button().click self.login_page.wait_for_login_page_to_load()
def setUp(self): self.driver = create_driver.get_driver_instance() self.login = Login_Page(self.driver) self.home = HomePage(self.driver)
def setUp(self): self.driver = create_driver.get_driver_instance() self.login_page = LoginPage(self.driver) self.home_page = HomePage(self.driver) self.userlist_page = UserListPage(self.driver)
def setUp(self): self.driver = create_driver.get_browser_instance() self.driver.maximize_window() self.driver.implicitly_wait(30) self.login = LoginPage(self.driver) self.home = HomePage(self.driver)
def setUp(self): self.driver = create_driver.get_browser_instance() self.login_page = LoginPage(self.driver) self.home_page = HomePage(self.driver)
def setUp(self): self.driver = create_driver.get_driver_instance() self.login = Login_Page(self.driver) self.home = HomePage(self.driver) self.open_task = open_task_page(self.driver) self.add_task = AddNewTaskPage(self.driver)