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 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 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 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()