def add_vf():
     try:
         logger.debug("Tab Add Virtual Functions")
         Wait.text_by_css(
             Constants.Dashboard.Wizard.Title.CSS,
             Constants.Dashboard.Wizard.AddVF.Title.TEXT,
             wait_for_page=True)
         vfName = "newVF" + Helper.rand_string("randomString")
         vfVersion = "newVFVersion" + \
             Helper.rand_string(
                 "randomNumber") + Helper.rand_string("randomString")
         Enter.text_by_name("virtualFunction", vfName)
         Enter.text_by_name("VFversion", vfVersion, wait_for_page=True)
         FEWizard.date_picker_wizard()
         Select(session.ice_driver.find_element_by_id(
             Constants.Dashboard.Wizard.AddVF.AIC_Version.TEXT
         )).select_by_visible_text("AIC 3.5")
         Select(session.ice_driver.find_element_by_id(
             Constants.Dashboard.Wizard.AddVF.ECOMP_Release.TEXT
         )).select_by_visible_text("Unknown")
         session.E2Edate = FEWizard.get_lab_entry_date()
         Click.css(Constants.SubmitButton.CSS, wait_for_page=True)
         Wait.page_has_loaded()
         Wait.name_to_dissappear("Add Virtual Function")
         return vfName
     # If failed - count the failure and add the error to list of errors.
     except Exception as e:
         errorMsg = "Failed to add a Virtual Function via modal window. " +\
             "Exception " +\
             str(e)
         raise Exception(errorMsg)
Beispiel #2
0
 def search_in_left_searchbox_by_param(manual_id, vf_name, param):
     myVfName = manual_id + ": " + vf_name
     Enter.text_by_xpath(
         Constants.Dashboard.LeftPanel.SearchBox.Results.XPATH, param)
     Wait.text_by_css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS,
                      myVfName)
     Click.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS)
    def add_ssh_key(is_negative=False):
        logger.debug("About to add an SSH Key in modal window")
        try:  # Add SSH Key from modal window and return key value.
            Wait.text_by_name(Constants.Dashboard.Wizard.AddSSHKey.Title.NAME,
                              Constants.Dashboard.Wizard.AddSSHKey.Title.TEXT)
            # Generate an SSH Public Key.
            sshKey = Helper.generate_sshpub_key()
            if is_negative:
                sshKey = sshKey[8:]
            Enter.text_by_name("key", sshKey)

            # Check that the submit button exists.
            Wait.text_by_css(
                Constants.SubmitButton.CSS,
                Constants.Dashboard.Wizard.AddSSHKey.Title.TEXT)

            Click.css(Constants.SubmitButton.CSS)  # Click on submit button.
            if is_negative:
                Wait.text_by_id(
                    Constants.Toast.ID,
                    Constants.Dashboard.Avatar.Account
                    .SSHKey.UpdateFailed.TEXT)
            else:
                Wait.name_to_dissappear(
                    Constants.Dashboard.Wizard.AddSSHKey.Title.NAME)
                logger.debug("SSH Key added via modal window.")
            return sshKey
        # If failed - count the failure and add the error to list of errors.
        except Exception as e:
            errorMsg = "Failed to add an SSH Key in " +\
                "the modal window. Exception=" + \
                str(e)
            raise Exception(errorMsg)
 def validate_target_lab_entry(date):
     Wait.text_by_css(Constants.Dashboard.DetailedView.TargetLabEntry.CSS,
                      Constants.Dashboard.DetailedView.TargetLabEntry.TEXT,
                      wait_for_page=True)
     actualDate = Get.by_css(
         Constants.Dashboard.DetailedView.TargetLabEntry.CONTENT_CSS)
     Helper.internal_assert(actualDate, date)
Beispiel #5
0
 def get_to_create_new_ns_modal_via_overview():
     Click.id(Constants.Dashboard.Overview.NextSteps.Add.ID,
              wait_for_page=True)
     Wait.text_by_css(Constants.Dashboard.Checklist.AddNS.CSS,
                      Constants.Dashboard.Overview.NextSteps.Add.TITLE)
     Helper.internal_assert(Constants.Dashboard.Checklist.AddNS.TITLE,
                            Get.by_css(Constants.FEGeneral.CSS.H2))
Beispiel #6
0
 def test_starred_recent_searchbar(self):
     actualVfName = Get.by_id(self.left_panel_eng_id)
     Helper.internal_assert(self.eng_title, actualVfName)
     Click.id(self.left_panel_eng_id)
     Wait.id("title-id-" + self.eng_title)
     Helper.internal_assert(
         self.user_content['engagement_manual_id'] +
         ":",
         Get.by_id(
             "title-id-" +
             self.eng_title))
     Click.id(Constants.Dashboard.Overview.Star.ID, wait_for_page=True)
     Wait.id("title-id-" + self.eng_title)
     Click.id(Constants.Dashboard.Overview.Star.ID, wait_for_page=True)
     Wait.id("title-id-" + self.eng_title, wait_for_page=True)
     Helper.internal_assert(
         self.eng_title, Get.by_id(self.left_panel_eng_id))
     Enter.text_by_xpath(
         "//input[@type='text']",
         self.user_content['engagement_manual_id'],
         wait_for_page=True)
     Wait.text_by_css(
         Constants.Dashboard.LeftPanel.SearchBox.Results.CSS,
         self.eng_title)
     Click.css(
         Constants.Dashboard.LeftPanel.SearchBox.Results.CSS,
         wait_for_page=True)
Beispiel #7
0
 def click_on_account():
     try:
         Click.link_text(Constants.Dashboard.Avatar.Account.LINK_TEXT)
         Wait.text_by_css(Constants.Dashboard.Avatar.Account.Title.CSS,
                          Constants.Dashboard.Avatar.Account.Title.TEXT)
     except Exception as e:
         errorMsg = "Failed to click_on on Admin."
         raise Exception(errorMsg, e)
 def test_login_page_dont_have_accaunt_button(self):
     '''
         Go to login page, click_on on "Don't have an account",
         verify user is redirected to signup page.
     '''
     Click.id(Constants.Login.DontHaveAccount.ID)
     Wait.text_by_css(Constants.Signup.Title.CSS,
                      Constants.Signup.Title.TEXT)
 def test_login_negative_required_password(self):
     ''' Check that password is a required field on login page. '''
     user_content = API.User.create_new_user()
     logger.debug("Verifying and Insert Login page elements:")
     Enter.text_by_name(Constants.Login.Email.NAME, user_content['email'])
     Enter.text_by_name(Constants.Login.Password.NAME, "1")
     Enter.text_by_name(Constants.Login.Password.NAME, "")
     Wait.text_by_css(Constants.Login.Password.Error.CSS,
                      Constants.Login.Password.Error.TEXT)
 def test_Validate_SSHkeyNS(self):
     ''' Insert a valid ssh key in wizard, validate "add ssh key"
         next step marked as completed.
     '''
     user_content = API.User.create_new_user()
     activationUrl = DB.User.get_activation_url(user_content['email'])
     Frontend.General.re_open(activationUrl)
     Frontend.User.login(user_content['email'],
                         Constants.Default.Password.TEXT)
     Wait.text_by_id(Constants.Toast.ID,
                     Constants.Dashboard.ActivateMsg.Success.TEXT)
     Click.id(Constants.Dashboard.Wizard.CloseButton.ID)
     Wait.modal_to_dissappear()
     Frontend.User.logout()
     Frontend.User.login(user_content['email'],
                         Constants.Default.Password.TEXT)
     Wait.text_by_css(Constants.Dashboard.LeftPanel.Title.CSS,
                      Constants.Dashboard.LeftPanel.Title.TEXT)
     logger.debug("click_on on + Dashboard")
     Click.id(Constants.Dashboard.LeftPanel.AddEngagement.ID)
     #    Wizard
     vfName = Frontend.Wizard.add_vf()
     Frontend.Wizard.add_vendor_contact()
     inviteEmail = Helper.rand_invite_email()
     Frontend.Wizard.invite_team_members(inviteEmail)
     sshKey = Frontend.Wizard.add_ssh_key()
     Frontend.User.go_to_account()
     Wait.id(user_content['email'])
     actualFullName = Get.value_by_name(
         Constants.Dashboard.Avatar.Account.FullName.NAME)
     Helper.internal_assert(user_content['full_name'], actualFullName)
     actualSSHkey = Get.value_by_name(
         Constants.Dashboard.Avatar.Account.SSHKey.NAME)
     Helper.internal_assert(sshKey, actualSSHkey)
     Click.id(Constants.Dashboard.Statuses.ID)
     #    VALIDATION FOR CONFIRMED BY ENG. LEAD
     engLeadEmail = DB.User.select_el_email(vfName)
     engagement_id = DB.General.select_where("engagement_id", "ice_vf",
                                             "name", vfName, 1)
     engagement_manual_id = DB.General.select_where("engagement_manual_id",
                                                    "ice_engagement",
                                                    "uuid", engagement_id,
                                                    1)
     myVfName = engagement_manual_id + ": " + vfName
     actualVfNameid = "clickable-" + myVfName
     Click.id(actualVfNameid)
     Click.id("overview-" + myVfName)
     Click.css("span.engagement_detail_menu_name")
     Click.xpath("//span[2]/multiselect/div/button")
     Click.link_text("Completed")
     elFullName = DB.General.select_where("full_name", "ice_user_profile",
                                          "email", engLeadEmail, 1)
     idNs = elFullName + "_Completed"
     actualConfirmBy = str(Get.by_id(idNs))
     expectedConfirmBy = "System Next Step  Completed: "
     Helper.internal_assert(expectedConfirmBy, actualConfirmBy)
Beispiel #11
0
 def search_documentation_content(title, content):
     FEDashboard.open_documentation(title)
     Wait.text_by_id(title, title)
     logger.debug("Search Documentation by content")
     Enter.text_by_id(Constants.Cms.SearchDocumentation,
                      content,
                      wait_for_page=True)
     Wait.text_by_id(title, title)
     Click.id(title, wait_for_page=True)
     Wait.text_by_css(Constants.Cms.DocumentationPageContent, content)
     logger.debug("Documentation found (searched by content)")
Beispiel #12
0
 def send_reset_password(email):
     FEGeneral.go_to_reset_password_from_login()
     Wait.text_by_css(Constants.ResetPassword.Title.CSS,
                      Constants.ResetPassword.Title.TEXT)
     Enter.text_by_name(Constants.ResetPassword.Email.NAME, email)
     Wait.text_by_css(Constants.SubmitButton.CSS,
                      Constants.ResetPassword.Button.TEXT)
     Click.css(Constants.SubmitButton.CSS)
     Wait.text_by_id(Constants.Toast.ID,
                     Constants.ResetPassword.Toast.Success.TEXT)
     logger.debug(Constants.ResetPassword.Toast.Success.TEXT)
Beispiel #13
0
 def add_line_item_audit_log():
     try:
         log_txt = Helper.rand_string("randomString")
         Enter.text_by_id("new-audit-log-text", log_txt, wait_for_page=True)
         Click.id("submit-new-audit-lop-text")
         Wait.text_by_css(
             Constants.Dashboard.Checklist.AuditLog.LastLocalAuditLog.CSS,
             log_txt,
             wait_for_page=True)
         return log_txt
     except Exception as e:
         errorMsg = "Failed to add audit log to line item."
         raise Exception(errorMsg, e)
 def test_XSS_script(self):
     user_content = API.VirtualFunction.create_engagement(
         wait_for_gitlab=False)
     validate = API.User.update_account_injec_script(user_content)
     assertTrue(validate)
     Frontend.User.login(user_content['email'],
                         Constants.Default.Password.TEXT)
     Frontend.User.open_account_form()
     script = "<script>;</script>"
     Enter.text_by_name("fullname", script, wait_for_page=True)
     Wait.text_by_css(Constants.SubmitButton.CSS, "Update")
     Click.css(Constants.SubmitButton.CSS, wait_for_page=True)
     Wait.text_by_css(Constants.Toast.CSS,
                      "Account was updated successfully!")
Beispiel #15
0
 def edit_description_lineitem_and_save():
     desc = Helper.rand_string("randomString")
     Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
              FIRST_LINE_ITEM_ID)
     Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
              EDIT_LINE_ITEM_BTN)
     Enter.text_by_id(
         Constants.Dashboard.LeftPanel.EditChecklistTemplate.
         EDIT_LINE_ITEM_NAME, Helper.rand_string("randomString"))
     Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
              EDIT_LINE_ITEM_DESC)
     editor_element = Get.wysiwyg_element_by_id(
         Constants.Dashboard.LeftPanel.EditChecklistTemplate.
         LINE_ITEM_DESC_TEXT_BOX)
     editor_element.clear()
     editor_element.send_keys(desc)
     Wait.page_has_loaded()
     actionChains = ActionChains(session.ice_driver)
     actionChains.double_click(editor_element).perform()
     Wait.page_has_loaded()
     Click.xpath(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
                 WYSIWYG_BUTTON_BOLD)
     Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
              EDIT_LINE_ITEM_BTN,
              wait_for_page=True)
     isBold = Wait.is_css_exists("b")
     while not isBold:
         Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
                  EDIT_LINE_ITEM_BTN,
                  wait_for_page=True)
         actionChains.double_click(editor_element).perform()
         Click.xpath(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
                     WYSIWYG_BUTTON_BOLD,
                     wait_for_page=True)
         Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
                  EDIT_LINE_ITEM_BTN,
                  wait_for_page=True)
         isBold = Wait.is_css_exists("b")
     if isBold:
         FEChecklistTemplate.click_on_save_and_assert_success_msg()
     FEGeneral.refresh()
     Click.name(Constants.Dashboard.LeftPanel.EditChecklistTemplate.HEAT,
                wait_for_page=True)
     Click.id(Constants.Dashboard.LeftPanel.EditChecklistTemplate.
              FIRST_LINE_ITEM_ID,
              wait_for_page=True)
     Wait.css("b")
     Wait.text_by_css("b", desc, wait_for_page=True)
Beispiel #16
0
 def test_validate_duplicate_invite(self):
     user_content = []
     for _ in range(3):
         user_content.append(
             API.VirtualFunction.create_engagement(wait_for_gitlab=False))
     Frontend.User.login(user_content[0]['email'],
                         Constants.Default.Password.TEXT)
     engName = user_content[0][
         'engagement_manual_id'] + ": " + user_content[0]['vfName']
     vf_left_nav_id = "clickable-" + engName
     Click.id(vf_left_nav_id)
     Frontend.Wizard.invite_team_members_modal(user_content[1]['email'])
     enguuid = DB.General.select_where(
         "uuid", "ice_engagement", "engagement_manual_id",
         user_content[0]['engagement_manual_id'], 1)
     invitation_token = DB.User.select_invitation_token(
         "invitation_token", "ice_invitation", "engagement_uuid", enguuid,
         user_content[1]['email'], 1)
     inviterURL = Constants.Default.InviteURL.Login.TEXT + invitation_token
     Frontend.General.re_open(inviterURL)
     title_id = "title-id-" + engName
     Frontend.User.login(user_content[1]['email'],
                         Constants.Default.Password.TEXT, title_id)
     vf_left_nav_id = "clickable-" + engName
     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)
     Frontend.User.logout()
     Frontend.User.login(user_content[0]['email'],
                         Constants.Default.Password.TEXT)
     engName = user_content[0][
         'engagement_manual_id'] + ": " + user_content[0]['vfName']
     vf_left_nav_id = "clickable-" + engName
     Click.id(vf_left_nav_id)
     Click.id(Constants.Dashboard.Overview.TeamMember.ID)
     Wait.text_by_css(
         Constants.Dashboard.Wizard.Title.CSS,
         Constants.Dashboard.Wizard.InviteTeamMembers.Title.TEXT)
     Enter.text_by_name("email", user_content[1]['email'])
     Wait.text_by_css(
         Constants.SubmitButton.CSS,
         Constants.Dashboard.Wizard.InviteTeamMembers.Button.TEXT)
     Click.css(Constants.SubmitButton.CSS)
     Wait.id(Constants.Toast.ID)
     Helper.internal_assert(Get.by_id(Constants.Toast.ID),
                            "Invite couldn't be created")
Beispiel #17
0
 def add_next_step_updated(checklistName, newFileName):
     Click.id(Constants.Dashboard.Checklist.AddNS.ID)
     Wait.id(Constants.Dashboard.Modal.CLOSE_BUTTON_ID)
     Wait.text_by_css("span.font_header.ng-binding", "Checklist:")
     Wait.text_by_css("h2.ng-binding", "Add Next Steps")
     # First NS
     Click.id("description")
     Enter.text_by_id("description", "description of NS")
     Click.css("div.modal-content")
     Click.xpath("(//button[@type='button'])[10]")
     Click.link_text(newFileName)
     Click.css("div.modal-content")
     Click.xpath("(//button[@type='button'])[11]")
     try:
         Click.xpath("//div[3]/multiselect/div/ul/li/a")
     except BaseException:
         Wait.link_text("Homer Simpson")
         Click.link_text("Homer Simpson")
     Wait.css("div.modal-content")
     Click.css("div.modal-content")
     Wait.xpath("(//button[@type='button'])[12]")
     count = 0
     FEWizard.date_picker_add_ns(count)
     count = +1
     Click.css("span.add-text")
     Click.xpath("(//div[@id='description'])[2]")
     Enter.text_by_xpath("(//div[@id='description'])[2]",
                         "description of NS2")
     Click.css("div.modal-content")
     Click.xpath("(//button[@type='button'])[14]")
     Click.xpath("(//button[@type='button'])[22]")
     Click.xpath("//div[3]/div/div[2]/multiselect/div/ul/li[2]/a")
     Click.css("div.modal-content")
     Click.xpath("(//button[@type='button'])[23]")
     Click.css("div.btn-group.open > ul.dropdown-menu > " +
               "li.ng-scope > a.ng-binding")
     Click.link_text("Add Another Next Step")
     Wait.xpath("(//button[@type='button'])[25]")
     Click.xpath("(//button[@type='button'])[25]")
     Wait.xpath("(//button[@type='button'])[24]")
     FEWizard.date_picker_add_ns(count)
     Wait.xpath("//div[4]/div/span")
     Click.xpath("//div[4]/div/span")
     Wait.id("btn-submit")
     Wait.text_by_id("btn-submit", "Submit Next Steps")
     Click.id("btn-submit")
 def invite_and_validate_limit(user_content, vf_left_nav_id):
     Click.id(Constants.Dashboard.LeftPanel.AddEngagement.ID)
     FEWizard.add_vf()
     Click.id(Constants.Dashboard.Wizard.CloseButton.ID, wait_for_page=True)
     Click.id(vf_left_nav_id)
     Click.id(Constants.Dashboard.Overview.TeamMember.ID)
     Wait.text_by_css(
         Constants.Dashboard.Wizard.Title.CSS,
         Constants.Dashboard.Wizard.InviteTeamMembers.Title.TEXT)
     Enter.text_by_name("email", user_content[1]['email'])
     Wait.text_by_css(
         Constants.SubmitButton.CSS,
         Constants.Dashboard.Wizard.InviteTeamMembers.Button.TEXT)
     Click.css(Constants.SubmitButton.CSS)
     Wait.id(Constants.Toast.ID)
     Helper.internal_assert(Get.by_id(Constants.Toast.ID),
                            "Invite couldn't be created")
 def invite_team_members(email):
     try:
         logger.debug("Tab Invite Team Members")
         Wait.text_by_name(
             Constants.Dashboard.Wizard.InviteTeamMembers.Title.NAME,
             Constants.Dashboard.Wizard.InviteTeamMembers.Title.TEXT)
         Enter.text_by_name("email", email)
         Wait.text_by_css(
             Constants.SubmitButton.CSS,
             Constants.Dashboard.Wizard.InviteTeamMembers.Button.TEXT)
         Click.css(Constants.SubmitButton.CSS)
         Wait.name_to_dissappear(
             Constants.Dashboard.Wizard.InviteTeamMembers.Title.NAME)
     # If failed - count the failure and add the error to list of errors.
     except Exception as e:
         errorMsg = "FAILED in Tab Invite Team Members. Exception = %s" % e
         raise Exception(errorMsg)
 def invite_team_members_modal(email, wait_modal_to_disappear=True):
     try:
         Click.id(
             Constants.Dashboard.Overview.TeamMember.ID,
             wait_for_page=True)
         Wait.text_by_css(
             Constants.Dashboard.Wizard.Title.CSS,
             Constants.Dashboard.Wizard.InviteTeamMembers.Title.TEXT)
         Enter.text_by_name("email", email)
         Wait.text_by_css(
             Constants.SubmitButton.CSS,
             Constants.Dashboard.Wizard.InviteTeamMembers.Button.TEXT)
         Click.css(".inviteMembers-form button.btn.btn-primary", True)
         if wait_modal_to_disappear:
             Wait.modal_to_dissappear()
     # If failed - count the failure and add the error to list of errors.
     except Exception as e:
         errorMsg = "FAILED in PopUp Invite Team Members. Exception=" + \
             str(e)
         raise Exception(errorMsg)
 def add_deployment_target(user_content):
     Click.id(Constants.Dashboard.DetailedView.TargetLabEntry.Add.ID)
     Wait.text_by_id(
         Constants.Dashboard.Modal.TITLE_ID,
         Constants.Dashboard.DetailedView.DeploymentTarget.TITLE)
     # FIXME: empty drop-down, tests will fail.
     Select(session.ice_driver.find_element_by_xpath(
         "//select")).select_by_visible_text("Lisle (DPA3)")
     Click.id(Constants.Dashboard.DetailedView.DeploymentTarget.SAVE,
              wait_for_page=True)
     Wait.text_by_css(Constants.Dashboard.DetailedView.DeploymentTarget.CSS,
                      "Lisle (DPA3)",
                      wait_for_page=True)
     Wait.text_by_id(
         Constants.Dashboard.DetailedView.AIC.ID +
         user_content['target_aic'], user_content['target_aic'])
     e2edate = FEGeneral.date_short_formatter()
     Wait.text_by_css(
         Constants.Dashboard.DetailedView.TargetLabEntry.CONTENT_CSS,
         e2edate)
 def add_vendor_contact():
     logger.debug("Tab Add Vendor Contact")
     Wait.text_by_css(
         Constants.Dashboard.Wizard.Title.CSS,
         Constants.Dashboard.Wizard.AddVendorContact.Title.TEXT,
         wait_for_page=True)
     Select(session.ice_driver.find_element_by_name(
         "company")).select_by_visible_text("Ericsson")
     fullname = Helper.rand_string(
         "randomString") + Helper.rand_string("randomString")
     Enter.text_by_name("fullname", fullname)
     email = Helper.rand_string("randomString") + "@ericson.com"
     Enter.text_by_name("email", email)
     phone = "201" + Helper.rand_string("randomNumber", 6)
     Enter.text_by_name("phone", phone)
     Click.css(Constants.SubmitButton.CSS, wait_for_page=True)
     Wait.name_to_dissappear("Add Vendor Contact", wait_for_page=True)
     vendor = {"company": "Ericsson", "full_name": fullname,
               "email": email, "phone": phone}
     return vendor
Beispiel #23
0
 def test_25_invitations_for_an_invited_by_user_uuid(self):
     user_content = API.VirtualFunction.create_engagement(
         wait_for_gitlab=False)
     list_of_invite_emails = []
     list_of_invite_emails.append(
         Constants.Users.LongEmailLengthStandardUser.EMAIL)
     for _ in range(29):
         list_of_invite_emails.append(Helper.rand_string("email"))
     Frontend.User.login(user_content['email'],
                         Constants.Default.Password.TEXT)
     engName = user_content['engagement_manual_id'] + ": " + user_content[
         'vfName']
     vf_left_nav_id = "clickable-" + engName
     Frontend.User.open_invite_team_member_form(vf_left_nav_id)
     countOfem = 2
     countofUser = 0
     Frontend.Invite.invite_x_users_from_tm(list_of_invite_emails,
                                            countofUser, countOfem, 9)
     #    Next 10 Users    #
     countOfem2 = 2
     countofUser2 = 10
     Click.id(Constants.Dashboard.Overview.TeamMember.ID,
              wait_for_page=True)
     Wait.text_by_css(
         Constants.Dashboard.Wizard.Title.CSS,
         Constants.Dashboard.Wizard.InviteTeamMembers.Title.TEXT)
     Frontend.Invite.invite_x_users_from_tm(list_of_invite_emails,
                                            countofUser2, countOfem2, 9)
     countOfem3 = 2
     countofUser3 = 20
     Click.id(Constants.Dashboard.Overview.TeamMember.ID,
              wait_for_page=True)
     Wait.text_by_css(
         Constants.Dashboard.Wizard.Title.CSS,
         Constants.Dashboard.Wizard.InviteTeamMembers.Title.TEXT)
     Frontend.Invite.invite_x_users_from_tm(list_of_invite_emails,
                                            countofUser3, countOfem3, 5)
     Wait.text_by_id(Constants.Toast.ID,
                     "Invite couldn't be created",
                     wait_for_page=True)
Beispiel #24
0
 def add_next_step(checklistName, newObj):
     Click.id(Constants.Dashboard.Checklist.AddNS.ID, wait_for_page=True)
     Wait.text_by_css("span.font_header", "Checklist:")
     Helper.internal_assert("Checklist:", Get.by_css("span.font_header"))
     Helper.internal_assert("Add Next Steps", Get.by_css("h2"))
     # First NS
     Click.id("description")
     Enter.text_by_id("description", "description of NS")
     Click.css("div.modal-content")
     Click.xpath("(//button[@type='button'])[10]")
     FEChecklist.assocciatedFileName = "file0"
     Click.link_text(FEChecklist.assocciatedFileName)
     Click.css("div.modal-content")
     Click.xpath("(//button[@type='button'])[11]")
     try:
         Click.xpath("//div[3]/multiselect/div/ul/li/a")
     except BaseException:
         Click.link_text("Homer Simpson")
     Click.css("div.modal-content")
     count = 0
     FEWizard.date_picker_add_ns(count)
     count = +1
     Click.css("span.add-text")
     Click.xpath("(//div[@id='description'])[2]")
     Enter.text_by_xpath("(//div[@id='description'])[2]",
                         "description of NS2")
     Click.css("div.modal-content")
     Click.xpath("(//button[@type='button'])[14]")
     Click.xpath("(//button[@type='button'])[22]")
     Click.xpath("//div[3]/div/div[2]/multiselect/div/ul/li[2]/a")
     Click.css("div.modal-content")
     Click.xpath("(//button[@type='button'])[23]")
     Click.css("div.btn-group.open > ul.dropdown-menu > " +
               "li.ng-scope > a.ng-binding")
     Click.link_text("Add Another Next Step")
     Click.xpath("(//button[@type='button'])[25]")
     FEWizard.date_picker_add_ns(count)
     Click.xpath("//div[4]/div/span")
     Helper.internal_assert("Submit Next Steps", Get.by_id("btn-submit"))
     Click.id("btn-submit", wait_for_page=True)
 def add_vfcs(name, extRefID):
     Click.id(Constants.Dashboard.DetailedView.VFC.Add.ID,
              wait_for_page=True)
     Wait.text_by_id(Constants.Dashboard.Modal.TITLE_ID,
                     "Add Virtual Function Components (VFCs)")
     Enter.text_by_name("name", name)
     Click.name("extRefID", wait_for_page=True)
     Enter.text_by_name("extRefID", extRefID, wait_for_page=True)
     Select(
         session.ice_driver.find_element_by_id(
             Constants.Dashboard.DetailedView.VFC.Choose_Company.ID)
     ).select_by_visible_text("Amdocs")
     Wait.text_by_css("span.add-text", "Add VFC", wait_for_page=True)
     Click.css("span.add-text", wait_for_page=True)
     logger.debug("Add VFC no.2")
     Enter.text_by_xpath("//div[2]/ng-form/div/input",
                         "djoni2",
                         wait_for_page=True)
     Enter.text_by_xpath("//div[2]/ng-form/div[2]/input", "loka2")
     Enter.text_by_xpath("//div[2]/ng-form/div[4]/input", "companyManual2")
     Click.id(Constants.Dashboard.DetailedView.VFC.Save_button.ID,
              wait_for_page=True)
 def add_service_provider_internal():
     logger.debug(
         "Tab Add " + ServiceProvider.MainServiceProvider + " Sponsor")
     Wait.text_by_css(
         Constants.Dashboard.Wizard.Title.CSS,
         "Add " +
         ServiceProvider.MainServiceProvider +
         " Sponsor")
     fullname = Helper.rand_string(
         "randomString") + Helper.rand_string("randomString")
     Enter.text_by_name("fullname", fullname)
     email = Helper.rand_string(
         "randomString") + "@" + ServiceProvider.email
     Enter.text_by_name("email", email)
     phone = "201" + Helper.rand_string("randomNumber", 6)
     logger.debug(phone)
     Enter.text_by_name("phone", phone)
     Click.css(Constants.SubmitButton.CSS)
     Wait.name_to_dissappear("Add AT&T Sponsor")
     sponsor = {"company": ServiceProvider.MainServiceProvider,
                "full_name": fullname, "email": email, "phone": phone}
     return sponsor
Beispiel #27
0
    def create_checklist(engagement_id, vfName, actualVfName,
                         engagement_manual_id):
        try:
            checklistName = Helper.rand_string("randomString")
            Wait.id("checklist-plus-" + engagement_id, wait_for_page=True)

            Click.id("checklist-plus-" + engagement_id, wait_for_page=True)

            Helper.internal_assert("Create Checklist",
                                   Get.by_id("modal-header-checklist-15"))
            # vm.checkListName
            Enter.text_by_name("checkListName",
                               checklistName,
                               wait_for_page=True)
            Wait.xpath("//select")

            Select(
                session.ice_driver.find_element_by_id(
                    Constants.Template.Subtitle.SelectTemplateTitle.TEXT)
            ).select_by_visible_text(Constants.Template.Heat.TEXT)
            Click.id(Constants.Template.Heat.TEXT, wait_for_page=True)
            #             Click.css("option.ng-binding.ng-scope")
            Helper.internal_assert(
                "Associate Files",
                Get.by_id("associated-files-title", wait_for_page=True))
            Click.xpath("//multiselect/div/button", wait_for_page=True)
            Click.link_text("file0", wait_for_page=True)
            Click.link_text("file1")
            Wait.text_by_css(Constants.SubmitButton.CSS, "Create Checklist")
            Click.id(Constants.Dashboard.LeftPanel.CreateChecklist.ID)
            Wait.modal_to_dissappear()
            Wait.id(engagement_manual_id)
            return checklistName
        # 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_checklist")
Beispiel #28
0
    def update_account_and_return_changes():
        try:
            Select(session.ice_driver.find_element_by_name(
                "company")).select_by_visible_text("Nokia")
            randomName = Helper.rand_string("randomString")
            Enter.text_by_name("fullname", randomName)
            phone = "97258" + Helper.rand_string("randomNumber", 6)
            Enter.text_by_name("phone", phone)
            password = Constants.Default.Password.NewPass.TEXT
            Enter.text_by_name("password", password)
            Enter.text_by_name("confirm_password", password)
            Wait.text_by_css("button.btn.btn-primary", "Update")
            Click.css("button.btn.btn-primary")
            Wait.text_by_id(Constants.Toast.ID,
                            "Account was updated successfully!")
            Click.id(Constants.Dashboard.Statuses.ID)

            accountObj = [randomName, phone, password]
            return accountObj
        # If failed - count the failure and add the error to list of errors.
        except BaseException:
            errorMsg = "Failed in update accaunt ."
            raise Exception(errorMsg)
            raise
Beispiel #29
0
 def reset_password():
     Wait.text_by_css(Constants.UpdatePassword.Title.CSS,
                      Constants.UpdatePassword.Title.TEXT)
     Wait.text_by_css(Constants.UpdatePassword.SubTitle.CSS,
                      Constants.UpdatePassword.SubTitle.TEXT)
     Wait.text_by_css(Constants.SubmitButton.CSS,
                      Constants.UpdatePassword.Button.TEXT)
     Enter.text_by_name(Constants.UpdatePassword.Password.NAME,
                        Constants.Default.Password.NewPass.TEXT)
     Enter.text_by_name(Constants.UpdatePassword.ConfirmPassword.NAME,
                        Constants.Default.Password.NewPass.TEXT)
     Click.css(Constants.SubmitButton.CSS)
     Wait.text_by_id(Constants.Toast.ID,
                     Constants.UpdatePassword.Toast.TEXT)
    def test_invite_new_user(self):
        """
        Name:
            test_invite_new_user
        Steps:
            Create new APIUser via SignUp request-->Login with This One-->
             build "activationUrl"-->
            Validation of successful activate-->
            close Wizard --> Logout-->login-->Open Wizard-->
             fill all fields in all Tab's(4)-->
            build inviteURL from email--> reopen browser with inviteURL-->
            Validate fields filled's in SignUp form
        """
        user_content = API.User.create_new_user()
        # Fetch one user ID.
        uuid = DB.General.select_where_email(
            "uuid", "ice_user_profile", user_content['email'])
        Frontend.User.activate_and_login(
            user_content['email'], Constants.Default.Password.TEXT)
        Wait.text_by_id(
            Constants.Toast.ID, Constants.Dashboard.ActivateMsg.Success.TEXT)
        Click.id(Constants.Dashboard.Wizard.CloseButton.ID)
        Wait.modal_to_dissappear()
        Frontend.User.logout()
        Frontend.User.login(
            user_content['email'], Constants.Default.Password.TEXT)
        Wait.text_by_css(
            Constants.Dashboard.LeftPanel.Title.CSS,
            Constants.Dashboard.LeftPanel.Title.TEXT)
        logger.debug("click_on on + Dashboard")
        Click.id(Constants.Dashboard.LeftPanel.AddEngagement.ID)
        # Wizard
        vfName = Frontend.Wizard.add_vf()
        vendor_contact = Frontend.Wizard.add_vendor_contact()
        inviteEmail = Helper.rand_invite_email()
        Frontend.Wizard.invite_team_members(inviteEmail)
        Frontend.Wizard.add_ssh_key()
        enguuid = DB.General.select_where("uuid", "ice_vf", "name", vfName, 1)
        inviterURL = Constants.Default.InviteURL.Signup.TEXT + \
            enguuid + "&inviter_uuid=" + uuid + "&email=" + inviteEmail
        Frontend.General.re_open(inviterURL)
        actualInvitedEmail = Get.value_by_name("email")
        Helper.internal_assert(inviteEmail, actualInvitedEmail)
        signUpURLforContact = DB.User.get_contact_signup_url(
            enguuid,
            uuid,
            vendor_contact["email"],
            vendor_contact["full_name"],
            vendor_contact["phone"],
            vendor_contact["company"])
        Frontend.General.re_open(signUpURLforContact)

        actualInvitedEmail = Get.value_by_name(Constants.Signup.Email.NAME)
        Helper.internal_assert(vendor_contact["email"], actualInvitedEmail)
        Helper.internal_assert(
            "+" + vendor_contact["phone"],
            Get.value_by_name(
                Constants.Signup.Phone.NAME))
        Helper.internal_assert(
            vendor_contact["full_name"],
            Get.value_by_name(
                Constants.Signup.FullName.NAME))
        Helper.internal_assert(
            vendor_contact["company"],
            Get.value_by_name(
                Constants.Signup.Company.NAME))