def test_124(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ActivityHubPage()
     page.open()
     page.add_location_button.click()
     page = AddStartingLocationPage()
     OldLocationNamePart = "AutoTestLoc"
     page.search_location.send_keys(OldLocationNamePart)
     page = LocationLink()
     for i in range(0, len(page.location_links)):
         if OldLocationNamePart in page.location_links[i].get_attribute(
                 "textContent"):
             if page.location_links[i].is_displayed():
                 page.location_links[i].click()
     page = AddStartingLocationPage()
     ExistedLocationName = page.location_name.get_attribute('value')
     get_driver().back()
     page.location_name.send_keys(ExistedLocationName)
     time.sleep(4)
     assert page.is_element_present('alert_message') == True
     assert page.save_button.is_enabled() == False
Exemplo n.º 2
0
 def test_728(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ActivityHubPage()
     page.open()
     page.add_location_button.click()
     page = AddStartingLocationPage()
     select = Select(page.location_Country)
     select.select_by_visible_text('United States')
     select = Select(page.location_state)
     time.sleep(3)
     select.select_by_visible_text('Florida')
     page.location_zipcode.send_keys('54321')
     State = select.first_selected_option.text
     Zip = page.location_zipcode.get_attribute('value')
     select = Select(page.location_Country)
     select.select_by_visible_text('Canada')
     time.sleep(3)
     select = Select(page.location_state)
     assert select.first_selected_option.text == State
     assert page.location_zipcode.get_attribute('value') == Zip
     select = Select(page.location_Country)
     select.select_by_visible_text('Mexico')
     time.sleep(3)
     assert page.location_zipcode.get_attribute('value') == Zip
     select = Select(page.location_Country)
     select.select_by_visible_text('United States')
     time.sleep(3)
     select = Select(page.location_state)
     assert select.first_selected_option.text == State
     assert page.location_zipcode.get_attribute('value') == Zip
 def test_729(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ActivityHubPage()
     page.open()
     page.add_location_button.click()
     page = AddStartingLocationPage()
     page.search_location.send_keys('Chris Falvey')
     page = LocationLink()
     for i in range(0, len(page.location_links)):
         if page.location_links[i].is_displayed():
             page.location_links[i].click()
     page = AddStartingLocationPage()
     select = Select(page.location_state)
     State = select.first_selected_option.text
     Zip = page.location_zipcode.get_attribute('value')
     select = Select(page.location_Country)
     select.select_by_visible_text('Canada')
     time.sleep(3)
     select = Select(page.location_state)
     assert select.first_selected_option.text == State
     assert page.location_zipcode.get_attribute('value') == Zip
     select = Select(page.location_Country)
     select.select_by_visible_text('Mexico')
     time.sleep(3)
     assert page.location_zipcode.get_attribute('value') == Zip
     select = Select(page.location_Country)
     select.select_by_visible_text('United States')
     time.sleep(3)
     select = Select(page.location_state)
     assert select.first_selected_option.text == State
     assert page.location_zipcode.get_attribute('value') == Zip
Exemplo n.º 4
0
 def test_108(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page=ActivityHubPage()
     page.open()
     page.add_location_button.click()
     page = AddStartingLocationPage()
     OldLocationNamePart = "AutoTestLoc"
     page.search_location.send_keys(OldLocationNamePart)
     page = LocationLink()
     for i in range(0, len(page.location_links)):
         if OldLocationNamePart in page.location_links[i].get_attribute("textContent"):
             if page.location_links[i].is_displayed():
                 page.location_links[i].click()
     page = AddStartingLocationPage()
     OldLocationName = page.location_name.get_attribute('value')
     OldLocationAddress1 = page.location_address_1.get_attribute('value')
     OldLocationAddress2 = page.location_address_2.get_attribute('value')
     select = Select(page.location_Country)
     OldLocationCountry = select.first_selected_option.text
     select = Select(page.location_state)
     OldLocationState = select.first_selected_option.text
     OldLocationCity = page.location_city.get_attribute('value')
     OldLocationZipcode = page.location_zipcode.get_attribute('value')
     OldLocationDescription = page.location_description.get_attribute('value')
     NewLocationName = ("ATLedit" + ''.join(choice(digits) for i in range(3)))
     page.location_name.send_keys(NewLocationName)
     NewLocationAddress1 = 'MAIN STREET'
     page.location_address_1.send_keys(NewLocationAddress1)
     NewLocationAddress2 = '10-123 1/2'
     page.location_address_2.send_keys(NewLocationAddress2)
     NewLocationCountry = "Canada"
     select = Select(page.location_Country)
     select.select_by_visible_text(NewLocationCountry)
     NewLocationState = "Quebec"
     select = Select(page.location_state)
     select.select_by_visible_text(NewLocationState)
     NewLocationCity = "Montreal"
     page.location_city.send_keys(NewLocationCity)
     NewLocationZipcode = "H3Z 2Y7"
     page.location_zipcode.send_keys(NewLocationZipcode)
     NewLocationDescription = "Edited location"
     page.location_description.clear()
     page.location_description.send_keys(NewLocationDescription)
     page.save_button.click()
     page.search_location.send_keys(NewLocationName)
     time.sleep(3)
     page = LocationLink()
     for i in range(0, len(page.location_links)):
         if NewLocationName in page.location_links[i].get_attribute("textContent"):
             page.location_links[i].click()
     time.sleep(5)
     page = AddStartingLocationPage()
     assert page.location_name.get_attribute('value') == NewLocationName
     assert page.location_address_1.get_attribute('value') == NewLocationAddress1
     assert page.location_address_2.get_attribute('value') == NewLocationAddress2
     select = Select(page.location_Country)
     assert select.first_selected_option.text == NewLocationCountry
     select = Select(page.location_state)
     assert select.first_selected_option.text == NewLocationState
     assert page.location_city.get_attribute('value') == NewLocationCity
     assert page.location_zipcode.get_attribute('value') == NewLocationZipcode
     assert page.location_description.get_attribute('value') == NewLocationDescription
     page = ActivityHubPage()
     page.open()
     page.add_activity_button.click()
     page = AddEditActivityPage()
     time.sleep(10)
     select = Select(page.starting_location)
     select.select_by_visible_text(NewLocationName)
     assert select.first_selected_option.text == NewLocationName
 def test_242(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(username_list[0])  #STEP1
     page.password_field.send_keys(pwd_list[0])
     page.button.click()
     time.sleep(5)
     page = EmployeePage()  # STEP2
     page.open()
     time.sleep(2)
     assert page.is_element_present('add_new_user') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = ActivityHubPage()  #STEP3
     page.open()
     time.sleep(2)
     assert page.is_element_present('add_activity_button') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = NavigationBar()  #STEP 4
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = ChannelPage()  #STEP 5
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = WaiverAddPage()  #STEP 6
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = DiscountPage()  #STEP 7
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = GrouponPage()  #STEP 8
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = CertificatePage()  #STEP 9
     page.open()
     time.sleep(2)
     assert page.is_element_present('add_new_certificate_button') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = InvoicePageV2()  #STEP 10
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = PeopleHubPage()  #STEP 11
     page.open()
     time.sleep(2)
     assert page.is_element_present('add_guide_button') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = GuidePayrollPage()  # STEP 12
     page.open()
     time.sleep(2)
     assert page.is_element_present('guide_list') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = ChannelPayrollPage()  #STEP 13
     page.open()
     time.sleep(2)
     assert page.is_element_present('channel_payment_due') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = EventCalendarPage()  #STEP 14
     page.open()
     time.sleep(2)
     assert page.is_element_present('date_picker') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = GuideBulAssignmentPage()  #STEP 15
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = AddStartingLocationPage()  #STEP 16
     page.open()
     assert page.is_element_present('location_name') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = TaxesReportPage()  #STEP 17
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = AnalyticsDashboardPage()  #STEP 18
     page.open()
     time.sleep(2)
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = EditCompanyPage()  #STEP 19
     page.open()
     assert page.is_element_present('company_name_field') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = SelfProfilePage()  #STEP 20
     page.open()
     assert page.is_element_present('first_name_field') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
     page = CustomerListPage()  #STEP 21
     page.open()
     assert page.is_element_present('add_customer_button') == True
     page = NoPermission()
     assert page.is_element_present('no_permission_alert') == False
Exemplo n.º 6
0
 def test_106(self):
     get_driver().maximize_window()
     page = loginpage()
     page.open()
     page.login_field.send_keys(admin_login)
     page.password_field.send_keys(admin_password)
     page.button.click()
     page = ActivityHubPage()
     page.open()
     page.add_location_button.click()
     page = AddStartingLocationPage()
     NewLocationName = ("AutoTestLoc" +
                        ''.join(choice(digits) for i in range(3)))
     page.location_name.send_keys(NewLocationName)
     NewLocationAddress1 = '221 Breckenridge St'
     page.location_address_1.send_keys(NewLocationAddress1)
     NewLocationAddress2 = 'qwerty'
     page.location_address_2.send_keys(NewLocationAddress2)
     NewLocationCountry = "United States"
     select = Select(page.location_Country)
     select.select_by_visible_text(NewLocationCountry)
     NewLocationState = "Montana"
     select = Select(page.location_state)
     select.select_by_visible_text(NewLocationState)
     NewLocationCity = "Helena"
     page.location_city.send_keys(NewLocationCity)
     NewLocationZipcode = "59601"
     page.location_zipcode.send_keys(NewLocationZipcode)
     NewLocationDescription = "This location has been created automatically"
     page.location_description.clear()
     page.location_description.send_keys(NewLocationDescription)
     page.save_button.click()
     page.search_location.send_keys(NewLocationName)
     time.sleep(3)
     page = LocationLink()
     for i in range(0, len(page.location_links)):
         if NewLocationName in page.location_links[i].get_attribute(
                 "textContent"):
             page.location_links[i].click()
     time.sleep(5)
     page = AddStartingLocationPage()
     assert page.location_name.get_attribute('value') == NewLocationName
     assert page.location_address_1.get_attribute(
         'value') == NewLocationAddress1
     assert page.location_address_2.get_attribute(
         'value') == NewLocationAddress2
     select = Select(page.location_Country)
     assert select.first_selected_option.text == NewLocationCountry
     select = Select(page.location_state)
     assert select.first_selected_option.text == NewLocationState
     assert page.location_city.get_attribute('value') == NewLocationCity
     assert page.location_zipcode.get_attribute(
         'value') == NewLocationZipcode
     assert page.location_description.get_attribute(
         'value') == NewLocationDescription
     page = ActivityHubPage()
     page.open()
     page.add_activity_button.click()
     page = AddEditActivityPage()
     time.sleep(10)
     select = Select(page.starting_location)
     select.select_by_visible_text(NewLocationName)
     assert select.first_selected_option.text == NewLocationName
     cnxn = pyodbc.connect(
         'DRIVER={ODBC Driver 17 for SQL Server};SERVER=' + server +
         ';DATABASE=' + database + ';UID=' + username + ';PWD=' + password)
     cursor = cnxn.cursor()
     cursor.execute(
         "SELECT TOP 1 * FROM location ORDER BY location_id DESC")
     row = cursor.fetchone()
     assert row[1] == 68  # company id
     assert row[2] == NewLocationName
     assert row[3] == NewLocationAddress1
     assert row[4] == NewLocationAddress2
     assert row[5] == NewLocationCity
     assert row[6] == 'MT'  #Location STATE
     assert row[7] == 'USA'  # Location country
     assert row[8] == NewLocationZipcode
     assert row[9] == NewLocationDescription
     assert row[11] == 1  #Location status