Пример #1
0
 def validate_filtering_by_stage(user_content, stage):
     FEGeneral.re_open(Constants.Default.LoginURL.TEXT)
     # Validate Scrolling    #
     FEUser.login(user_content['el_email'], Constants.Default.Password.TEXT)
     FEOverview.click_on_vf(user_content)
     Click.id(Constants.Dashboard.Statuses.ID, wait_for_page=True)
     Wait.text_by_id("dashboard-title", "Statuses", wait_for_page=True)
     Wait.id("search-filter-stage")
     Select(session.ice_driver.find_element_by_id(
         "search-filter-stage")).select_by_visible_text(stage)
     Wait.id(Constants.Dashboard.Statuses.ExportExcel.ID,
             wait_for_page=True)
     engLeadID = DBUser.select_user_native_id(user_content['el_email'])
     # Query for fetching count of rows per stage.
     countOfEngInStagePerUser = DBUser.select_user_engagements_by_stage(
         stage, engLeadID)
     #    Calculate number of pages    #
     NUM_OF_RESULTS_PER_PAGES = 8
     number_of_pages = countOfEngInStagePerUser // NUM_OF_RESULTS_PER_PAGES
     logger.debug("Number of pages: " + str(number_of_pages))
     if (countOfEngInStagePerUser % NUM_OF_RESULTS_PER_PAGES != 0):
         number_of_pages += 1
     logger.debug("number_of_pages " + str(number_of_pages))  # Scroll    #
     Wait.id("engagements-pagination", wait_for_page=True)
     element = session.ice_driver.find_element_by_id(
         "engagements-pagination")
     element.location_once_scrolled_into_view
     Click.link_text(str(number_of_pages), wait_for_page=True)
Пример #2
0
 def validate_multi_eng(user_content, checklist_content, newEL_content,
                        actualVfNameid):
     query = "UPDATE ice_user_profile SET role_id=2 WHERE email = '" + \
         str(newEL_content['email']) + "';"
     DBGeneral.update_by_query(query)
     FEWizard.invite_team_members_modal(newEL_content['email'])
     # Fetch one AT&T user ID.
     enguuid = DBGeneral.select_where("uuid", "ice_engagement",
                                      "engagement_manual_id",
                                      user_content['engagement_manual_id'],
                                      1)
     invitation_token = DBUser.select_invitation_token(
         "invitation_token", "ice_invitation", "engagement_uuid", enguuid,
         newEL_content['email'], 1)
     URL = Constants.Default.InviteURL.Login.TEXT + invitation_token
     FEGeneral.re_open(URL)
     FEUser.login(newEL_content['email'],
                  Constants.Default.Password.TEXT,
                  expected_element=actualVfNameid)
     Click.id(actualVfNameid, wait_for_page=True)
     count = None
     try:
         session.ice_driver.find_element_by_id("checklist-" +
                                               checklist_content['uuid'])
         count += 1
     except BaseException:
         logger.debug("check list not visible for EL invited : " +
                      str(newEL_content['email']))
     assertTrue(count is None)
     query = "UPDATE ice_user_profile SET role_id=1 WHERE email = '" + \
         str(newEL_content['email']) + "';"
     DBGeneral.update_by_query(query)
Пример #3
0
 def search_in_dashboard(user_content, vfcName, users):
     engName = user_content['engagement_manual_id'] + ": " + user_content[
         'vfName']
     engSearchID = "eng-" + engName
     for user in users:
         FEGeneral.re_open(Constants.Default.LoginURL.TEXT)
         logger.debug("Login with user " + user)
         FEUser.login(user, Constants.Default.Password.TEXT)
         logger.debug("Search engagement by engagement_manual_id")
         Enter.text_by_id(Constants.Dashboard.Statuses.SearchBox.ID,
                          user_content['engagement_manual_id'])
         eng_manual_id = user_content['engagement_manual_id'] + ":"
         Wait.text_by_id(engSearchID, eng_manual_id)
         logger.debug("Engagement found (searched by engagement_manual_id)")
         FEGeneral.smart_refresh()
         logger.debug("Search engagement by VF name")
         # Search by VF name.
         Enter.text_by_id(Constants.Dashboard.Statuses.SearchBox.ID,
                          user_content['vfName'])
         Wait.text_by_id(engSearchID, eng_manual_id)
         logger.debug("Engagement found (searched by VF name)")
         FEGeneral.smart_refresh()
         logger.debug("Search engagement by VFC")
         # Search by VFC.
         Enter.text_by_id(Constants.Dashboard.Statuses.SearchBox.ID,
                          vfcName)
         Wait.text_by_id(engSearchID, eng_manual_id)
         logger.debug("Engagement found (searched by VFC)")
         FEGeneral.smart_refresh()
         logger.debug("Negative search: search by random string")
         # Search by VFC.
         Enter.text_by_id(Constants.Dashboard.Statuses.SearchBox.ID,
                          "RND_STR_" + Helper.rand_string("randomString"))
         Wait.text_by_id("search-results", "Export to Excel >>")
Пример #4
0
 def activate_and_login(
         email,
         password,
         expected_element=Constants.Dashboard.Statuses.Title.ID,
         element_type="id"):
     activationUrl = DBUser.get_activation_url(email)
     FEGeneral.re_open(activationUrl)
     FEUser.login(email, password, expected_element, element_type)
 def add_remove_deployment_targets(user_content, users):
     for user in users:
         FEGeneral.re_open(Constants.Default.LoginURL.TEXT)
         logger.debug("Login with user " + user)
         FEUser.login(user, Constants.Default.Password.TEXT)
         FEDetailedView.search_vf_and_go_to_detailed_view(
             user_content['engagement_manual_id'], user_content['vfName'])
         FEDetailedView.add_deployment_target(user_content)
         FEDetailedView.remove_deployment_target(user_content)
 def validate_deployment_targets(user_content, users):
     for user in users:
         FEGeneral.re_open(Constants.Default.LoginURL.TEXT)
         logger.debug("Login with user " + user)
         FEUser.login(user, Constants.Default.Password.TEXT)
         FEDetailedView.search_vf_and_go_to_detailed_view(
             user_content['engagement_manual_id'], user_content['vfName'])
         Wait.id(Constants.Dashboard.DetailedView.DeploymentTarget.
                 AddDeploymentTargetButton.ID)
Пример #7
0
 def create_new_checklist(newObj):
     try:
         newObjWithChecklist = None
         vfName = newObj[0]
         uuid = newObj[1]
         inviteEmail = newObj[2]
         # Fetch one AT&T user ID.
         vfuuid = DBGeneral.select_where("uuid", "ice_vf", "name", vfName,
                                         1)
         engagement_id = DBVirtualFunction.select_eng_uuid(vfName)
         engLeadEmail = DBUser.select_el_email(vfName)
         logger.debug("EL email: " + engLeadEmail)
         engagement_manual_id = DBGeneral.select_where(
             "engagement_manual_id", "ice_engagement", "uuid",
             engagement_id, 1)
         #    Click on all default next steps
         myVfName = engagement_manual_id + ": " + vfName
         actualVfNameid = "clickable-" + myVfName
         actualVfName = Get.by_id(actualVfNameid)
         Helper.internal_assert(myVfName, actualVfName)
         #    NEXT STEP ID
         Click.id(actualVfNameid, wait_for_page=True)
         FEOverview.complete_defaults_nextsteps(engagement_id)
         inviterURL = Constants.Default.InviteURL.Signup.TEXT + \
             vfuuid + "&inviter_uuid=" + uuid + "&email=" + inviteEmail
         #             time.sleep(2)
         FEGeneral.re_open(inviterURL)
         FEGeneral.form_validate_email(inviteEmail)
         #    Login with EL role
         FEGeneral.re_open(Constants.Default.LoginURL.TEXT)
         FEUser.login(engLeadEmail, Constants.Default.Password.TEXT)
         Wait.id(Constants.Dashboard.Statuses.Title.ID)
         Wait.id(engagement_manual_id)  # cheklist
         #    VALIDATE SCROLLING
         actualVfName = Get.by_id(actualVfNameid)
         myVfName = engagement_manual_id + ": " + vfName
         #             Wait.id(actualVfNameid)
         Wait.id(engagement_manual_id, wait_for_page=True)
         Click.id(actualVfNameid, wait_for_page=True)
         #    Create new checklist
         checklistName = FEChecklist.create_checklist(
             engagement_id, vfName, actualVfName, engagement_manual_id)
         checklistUuid = DBGeneral.select_where("uuid", "ice_checklist",
                                                "name", checklistName, 1)
         newObjWithChecklist = [
             checklistUuid, engLeadEmail, engagement_manual_id,
             actualVfNameid, myVfName, checklistName
         ]
         return newObjWithChecklist
     # If failed - count the failure and add the error to list of errors.
     except Exception as e:
         errorMsg = "Failed to create checklist." + str(e)
         raise Exception(errorMsg, "create_new_checklist")
 def validate_negative_role_for_deployment_targets(user_content, users):
     for user in users:
         FEGeneral.re_open(Constants.Default.LoginURL.TEXT)
         logger.debug("Login with user " + user)
         FEUser.login(user, Constants.Default.Password.TEXT)
         FEDetailedView.search_vf_and_go_to_detailed_view(
             user_content['engagement_manual_id'], user_content['vfName'])
         session.run_negative(
             lambda: Click.id(Constants.Dashboard.DetailedView.
                              DeploymentTarget.AddDeploymentTargetButton.ID
                              ),
             "Negative test failed at click_on_ deployment-targets " +
             "with user  %s" % user)
Пример #9
0
 def check_cl_after_lineitem_added():
     template_name = Constants.Dashboard.LeftPanel.\
         EditChecklistTemplate.HEAT
     user_content = APIVirtualFunction.create_engagement()
     FEUser.login(Constants.Users.Admin.EMAIL,
                  Constants.Default.Password.TEXT)
     vfName = user_content['vfName']
     engagement_id = DBChecklist.fetchEngByVfName(vfName)
     engLeadEmail = DBUser.select_el_email(vfName)
     engagement_manual_id = DBChecklist.fetchEngManIdByEngUuid(
         engagement_id)
     FEOverview.click_on_vf(user_content)
     FEGeneral.re_open(Constants.Default.LoginURL.TEXT)
     FEUser.login(engLeadEmail, Constants.Default.Password.TEXT,
                  engagement_manual_id)
     Click.id(
         Constants.Dashboard.LeftPanel.EditChecklistTemplate.DASHBOARD_ID)
     Enter.text_by_id(
         Constants.Dashboard.LeftPanel.EditChecklistTemplate.SEARCH_ENG_ID,
         vfName)
     Click.id("test_" + vfName)
     checklistName = FEChecklist.create_checklist(engagement_id, vfName,
                                                  None,
                                                  engagement_manual_id)
     FEUser.go_to_admin()
     result = DBChecklist.fetchChecklistByName(checklistName)
     FEUser.go_to_admin()
     FEChecklistTemplate.click_on_template_name_on_navigation(
         Constants.Dashboard.LeftPanel.EditChecklistTemplate.HEAT,
         template_name)
     Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
              EDIT_LINE_ITEM_BTN)
     Enter.text_by_id(
         Constants.Dashboard.LeftPanel.EditChecklistTemplate.
         EDIT_LINE_ITEM_NAME,
         "test_lineitem_added_and_audit_log_on_dupl_cl-NAME")
     Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
              EDIT_LINE_ITEM_BTN)
     FEChecklistTemplate.click_on_save_and_assert_success_msg()
     Click.id(
         Constants.Dashboard.LeftPanel.EditChecklistTemplate.DASHBOARD_ID)
     Enter.text_by_id(
         Constants.Dashboard.LeftPanel.EditChecklistTemplate.SEARCH_ENG_ID,
         vfName)
     Click.id("test_" + vfName)
     Click.id("checklist-" + str(result))
     Helper.internal_assert(
         "1. automation",
         session.ice_driver.find_element_by_xpath("//li[@id='']").text)
Пример #10
0
 def validations_for_user2(user_content, inviteEmail, vflist):
     # Fetch one AT&T user ID.
     engagement_id = DBGeneral.select_where("engagement_id", "ice_vf",
                                            "name", vflist[0], 1)
     engagement_manual_id = DBGeneral.select_where("engagement_manual_id",
                                                   "ice_engagement", "uuid",
                                                   engagement_id, 1)
     engLeadEmail = DBUser.select_el_email(vflist[0])
     user_content['engagement_uuid'] = engagement_id
     user_content['el_email'] = engLeadEmail
     uuid = DBGeneral.select_where_email("uuid", "ice_user_profile",
                                         user_content['email'])
     sponsor = [
         ServiceProvider.MainServiceProvider, 'aaaaaa', inviteEmail,
         '3058000000'
     ]
     invitation_token = DBUser.select_invitation_token(
         "invitation_token", "ice_invitation", "engagement_uuid",
         engagement_id, inviteEmail, 1)
     signUpURLforContact = DBUser.get_contact_signup_url(
         invitation_token, uuid, sponsor[2], sponsor[1], sponsor[3],
         sponsor[0])
     APIUser.signup_invited_user(sponsor[0],
                                 inviteEmail,
                                 invitation_token,
                                 signUpURLforContact,
                                 user_content,
                                 True,
                                 wait_for_gitlab=False)
     activationUrl2 = DBUser.get_activation_url(sponsor[2])
     FEGeneral.re_open(activationUrl2)  # Login with 2nd user    #
     engName = engagement_manual_id + ": " + vflist[0]
     title_id = "clickable-" + engName
     FEUser.login(inviteEmail, Constants.Default.Password.TEXT, title_id)
     for vfName in vflist:
         # Fetch one AT&T user ID.
         engagement_id = DBGeneral.select_where("engagement_id", "ice_vf",
                                                "name", vfName, 1)
         engagement_manual_id = DBGeneral.select_where(
             "engagement_manual_id", "ice_engagement", "uuid",
             engagement_id, 1)
         engName = engagement_manual_id + ": " + vfName
         vf_left_nav_id = "clickable-" + engName
         Click.id(vf_left_nav_id, wait_for_page=True)
Пример #11
0
 def invite_users(user_content):
     engName = user_content[0][
         'engagement_manual_id'] + ": " + user_content[0]['vfName']
     vf_left_nav_id = "clickable-" + engName
     Click.id(vf_left_nav_id)
     FEWizard.invite_team_members_modal(user_content[1]['email'])
     #         self.sleep(1)   # TODO need to wait until modal window is closed.
     invitation_token = DBUser.select_invitation_token(
         "invitation_token", "ice_invitation", "engagement_uuid",
         user_content[0]['engagement_uuid'], user_content[1]['email'], 1)
     inviterURL = Constants.Default.InviteURL.Login.TEXT + invitation_token
     FEGeneral.re_open(inviterURL)
     #    Login with 2nd user    #
     title_id = "title-id-" + engName
     FEUser.login(user_content[1]['email'], Constants.Default.Password.TEXT,
                  title_id)
     Click.id(vf_left_nav_id)
     actualVfName = Get.by_id(vf_left_nav_id)
     Helper.internal_assert(engName, actualVfName)
     Wait.text_by_id(Constants.Dashboard.Overview.Title.ID, engName)
     FEUser.logout()
     return vf_left_nav_id
Пример #12
0
 def relogin(email,
             password,
             expected_element=Constants.Dashboard.Statuses.Title.ID,
             element_type="id"):
     FEGeneral.re_open(Constants.Default.LoginURL.TEXT)
     FEUser.login(email, password, expected_element, element_type)