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)
Exemple #2
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)
 def search_by_manual_id(manual_id):
     Enter.text_by_id(Constants.Dashboard.LeftPanel.SearchBox.ID,
                      manual_id,
                      wait_for_page=True)
     Click.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS,
               wait_for_page=True)
     Wait.id(Constants.Dashboard.Overview.Title.ID)
 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)
Exemple #5
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 search_by_vfname_for_not_local(user_content):
     vfFullName = user_content[
         'engagement_manual_id'] + ": " + user_content['vfName']
     if settings.DATABASE_TYPE != 'local':
         Enter.text_by_id(Constants.Dashboard.LeftPanel.SearchBox.ID,
                          user_content['vfName'])
         Click.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS)
         Wait.text_by_id(Constants.Dashboard.Overview.Title.ID, vfFullName)
 def update_cl_associated_files(engagement_manual_id):
     Click.id("edit-checklist", True)
     Wait.text_by_id("modal-header-checklist-15", "Update Checklist")
     # Select associated files from multi-select drop-down.
     Click.xpath("//multiselect/div/button")
     Click.link_text("file2")
     Click.xpath("//multiselect/div/button")
     Click.css(Constants.SubmitButton.CSS)
     Wait.id(engagement_manual_id, True)
Exemple #8
0
    def test_search_bar(self):
        """ Create user and VF, log in, add VFC, search by EID, VF and VFC """
        vfFullName = self.user_content[
            'engagement_manual_id'] + ": " + self.user_content['vfName']
        try:
            Enter.text_by_id(
                Constants.Dashboard.LeftPanel.SearchBox.ID,
                self.user_content['vfName'])
            Wait.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS)
            Click.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS)
            Wait.text_by_id(
                Constants.Dashboard.Overview.Title.ID, vfFullName)
        except BaseException:
            errorMsg = "Failed to search by VF name."
            raise Exception(errorMsg)

        try:
            Enter.text_by_id(
                Constants.Dashboard.LeftPanel.SearchBox.ID,
                self.user_content['engagement_manual_id'])
            Enter.text_by_id(
                Constants.Dashboard.LeftPanel.SearchBox.ID,
                self.user_content['engagement_manual_id'])
            Wait.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS)
            Click.css(Constants.Dashboard.LeftPanel.SearchBox.Results.CSS)
            Wait.text_by_id(
                Constants.Dashboard.Overview.Title.ID, vfFullName)
        except BaseException:
            errorMsg = "Failed to search by Engagement Manual ID."
            raise Exception(errorMsg)
        Frontend.Overview.click_on_vf(self.user_content)
        detailedViewID = Constants.Dashboard.DetailedView.ID + vfFullName
        Wait.text_by_id(detailedViewID, "Detailed View", wait_for_page=True)
        Click.id(detailedViewID, wait_for_page=True)
        Click.id(
            Constants.Dashboard.DetailedView.VFC.Add.ID, wait_for_page=True)
        vfcName = Helper.rand_string("randomString")
        extRefID = Helper.rand_string("randomNumber")
        Enter.text_by_name("name", vfcName)
        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(self.user_content['vendor'])
        Click.id(
            Constants.Dashboard.DetailedView.VFC.Save_button.ID,
            wait_for_page=True)
        try:
            Enter.text_by_id(
                Constants.Dashboard.LeftPanel.SearchBox.ID,
                vfcName,
                wait_for_page=True)
            Click.id(
                "search-" + self.user_content['vfName'], wait_for_page=True)
            Wait.id("clickable-" + vfFullName, wait_for_page=True)
        except Exception as e:
            errorMsg = "Failed to search by VFC name."
            raise Exception(errorMsg + str(e))
 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)
Exemple #10
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)
Exemple #11
0
 def set_ssh_key_from_account(key, is_negative=False):
     FEUser.go_to_account()
     Enter.text_by_name(Constants.Dashboard.Avatar.Account.SSHKey.NAME, key)
     Click.css(Constants.SubmitButton.CSS)
     if is_negative:
         Wait.text_by_id(
             Constants.Toast.ID,
             Constants.Dashboard.Avatar.Account.SSHKey.UpdateFailed.TEXT)
     else:
         Wait.text_by_id(
             Constants.Toast.ID,
             Constants.Dashboard.Avatar.Account.Update.Success.TEXT)
 def update_target_lab_entry():
     Click.id(Constants.Dashboard.DetailedView.TargetLabEntry.CHANGE,
              wait_for_page=True)
     Enter.date_picker('#lab-entry-date',
                       'vm.targetLabDate',
                       wait_for_page=True)
     Click.css(Constants.Dashboard.DetailedView.TargetLabEntry.INPUT_CSS,
               wait_for_page=True)
     Click.css(Constants.SubmitButton.CSS, wait_for_page=True)
     actualDate = Get.by_css(
         Constants.Dashboard.DetailedView.TargetLabEntry.CONTENT_CSS,
         wait_for_page=True)
     return str(actualDate)
 def update_cl_name_and_associated_files(engagement_manual_id):
     Click.id("edit-checklist", True)
     Wait.text_by_id("modal-header-checklist-15", "Update Checklist")
     newfileName = "file" + Helper.rand_string("randomString")
     Enter.text_by_xpath("//div[3]/div/div/input", newfileName)
     updatedFileName = "file2"
     # Select associated files from multi-select drop-down.
     Click.xpath("//multiselect/div/button")
     Click.link_text("file2")
     Click.css(Constants.SubmitButton.CSS)
     Wait.id(engagement_manual_id)
     newFileNames = [newfileName, updatedFileName]
     return newFileNames
 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!")
Exemple #15
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)
Exemple #16
0
 def announcement_validate_toast(title, description, user_content):
     Wait.text_by_id(Constants.Toast.CMS_ID, title + ".")
     FEDashboard.open_announcement()
     Wait.text_by_id(Constants.Cms.Toast_title_id, title)
     Wait.text_by_id(Constants.Cms.Toast_description, description)
     Click.id(Constants.Cms.Test_addDT_close_modal_button)
     Click.css("button.close")
     FEUser.logout()
     FEUser.login(user_content['email'], Constants.Default.Password.TEXT)
     # Validate Announcement displayed in News & Announcements sections
     session.run_negative(
         lambda: FEDashboard.open_announcement(),
         "Announcement toast disappear after 2 days %s" % title)
     Wait.text_by_id(title, title)
     Wait.text_by_id(description, description)
    def date_picker_add_ns(count):
        try:
            session.ice_driver.execute_script(
                "var el = angular.element(document.querySelector" +
                "('.addNextSteps')); el.scope().vm.nextSteps[" +
                str(count) +
                "].duedate = new Date('" +
                str(
                    datetime.today().isoformat()) +
                "')")
            Click.css("div.modal-content", wait_for_page=True)
        except Exception as e:
            errorMsg = "Failed to select date with datePicker."

            raise Exception(errorMsg, str(e))
Exemple #18
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")
 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_x_users_from_tm(list_of_invite_emails, countofUser, countOfem,
                            num):
     Enter.text_by_name("email",
                        list_of_invite_emails[countofUser],
                        wait_for_page=True)
     for _ in range(num):
         try:
             session.run_negative(lambda: Click.css("span.add-icon"),
                                  "css appears")
             break
         except BaseException:  # button exists
             pass
         countofUser += 1
         #             Click.css("span.add-icon")
         Wait.xpath("//fieldset[" + str(countOfem) + "]/div/input")
         Enter.text_by_xpath("//fieldset[" + str(countOfem) + "]/div/input",
                             list_of_invite_emails[countofUser])
         countOfem += 1
     Click.css(Constants.SubmitButton.CSS, wait_for_page=True)
 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_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
 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
 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)
Exemple #26
0
 def login(email,
           password,
           expected_element=Constants.Dashboard.Statuses.Title.ID,
           element_type="id"):
     try:
         logger.debug("Verifying and Insert Login page elements:")
         logger.debug("Insert Email " + email)
         Wait.name(Constants.Login.Email.NAME, wait_for_page=True)
         Enter.text_by_name(Constants.Login.Email.NAME, email)
         logger.debug("Insert Password")
         Enter.text_by_name(Constants.Login.Password.NAME, password)
         logger.debug("Click Login Button")
         Click.css(Constants.SubmitButton.CSS)
         logger.debug("Login Button clicked")
         if element_type == 'id':
             Wait.id(expected_element, True)
         elif element_type == 'css':
             Wait.css(expected_element, True)
     # If failed - count the failure and add the error to list of errors.
     except Exception as e:
         errorMsg = "Login FAILED: email=%s password=%s" % (email, password)
         logger.error(errorMsg)
         raise Exception(errorMsg, e)
Exemple #27
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
Exemple #28
0
 def click_on_submit():
     Click.css(Constants.SubmitButton.CSS)
 def test_current_status(self):
     user_content = API.VirtualFunction.create_engagement(
         wait_for_gitlab=False)
     vfName = user_content['vfName']
     Frontend.User.login(user_content['email'],
                         Constants.Default.Password.TEXT)  # new
     Frontend.Overview.click_on_vf(user_content)
     Frontend.User.go_to_account()
     Wait.id(user_content['email'])
     actualFullName = Get.value_by_name("fullname")
     Helper.internal_assert(user_content['full_name'], actualFullName)
     Click.id(Constants.Dashboard.Statuses.ID)
     Frontend.Overview.click_on_vf(user_content)
     Helper.internal_assert(
         "Current Status",
         Get.by_css(Constants.Dashboard.Overview.Status.Header.ID))
     Wait.text_by_id(Constants.Dashboard.Overview.Status.Description.ID,
                     "No status update has been provided yet.")
     Click.id(Constants.Dashboard.Avatar.ID)
     Click.link_text("Logout")
     engLeadEmail = DB.User.select_el_email(vfName)
     Frontend.User.relogin(engLeadEmail, Constants.Default.Password.TEXT)
     Frontend.Overview.click_on_vf(user_content)
     Click.css(Constants.Dashboard.Overview.Status.Add.CSS)
     Helper.internal_assert("Add Status",
                            Get.by_css("h3.modal-title.ng-binding"))
     Helper.internal_assert(
         "Use the form below to add the current status of the engagement.",
         Get.by_css("span.ng-binding"))
     Click.css("textarea[name=\"description\"]")
     Enter.text_by_css("textarea[name=\"description\"]",
                       "Add new Status",
                       wait_for_page=True)
     Helper.internal_assert(
         "Add status",
         Get.by_id(Constants.Dashboard.DetailedView.VFC.Save_button.ID))
     Click.id(Constants.Dashboard.DetailedView.VFC.Save_button.ID,
              wait_for_page=True)
     Helper.assertTrue("Last updated" in Get.by_id("status-update-details"))
     Wait.text_by_id(Constants.Dashboard.Overview.Status.Description.ID,
                     "Add new Status")
     Wait.css(Constants.Dashboard.Overview.Status.Edit.CSS)
     Wait.modal_to_dissappear()
     Click.css(Constants.Dashboard.Overview.Status.Edit.CSS)
     Helper.internal_assert("Current Status",
                            Get.by_css("h3.modal-title.ng-binding"))
     Click.css("textarea[name=\"description\"]")
     Enter.text_by_css("textarea[name=\"description\"]", "Update Status")
     Click.id(Constants.Dashboard.DetailedView.VFC.Save_button.ID)
     Wait.modal_to_dissappear()
     Wait.text_by_id(Constants.Dashboard.Overview.Status.Description.ID,
                     "Update Status")
     Frontend.User.logout()
     Frontend.User.relogin(user_content['email'],
                           Constants.Default.Password.TEXT)
     Frontend.Overview.click_on_vf(user_content)
     Helper.internal_assert(
         "Current Status",
         Get.by_css(Constants.Dashboard.Overview.Status.Header.ID))
     Wait.text_by_id(Constants.Dashboard.Overview.Status.Description.ID,
                     "Update Status")
Exemple #30
0
 def invite_single_user_to_team(email):
     Enter.text_by_name("email", email, wait_for_page=True)
     Click.css(Constants.SubmitButton.CSS, wait_for_page=True)