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 #2
0
 def validate_account_details(full_name, phone_number, ssh_key):
     Helper.internal_assert(
         full_name,
         Get.value_by_name(
             Constants.Dashboard.Avatar.Account.FullName.NAME))
     Helper.internal_assert(
         phone_number,
         Get.value_by_name(Constants.Dashboard.Avatar.Account.Phone.NAME))
     Helper.internal_assert(
         ssh_key,
         Get.value_by_name(Constants.Dashboard.Avatar.Account.SSHKey.NAME))
    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))
 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")
    def test_invite_new_user_of_service_provider_internal(self):
        '''
        TC Name: test_invite_new_user_aservice_provider_internal
        Steps:
        Create new NOT-MainServiceProvider APIUser via SignUp request-->
        Login with This One--> build "activationUrl"-->
        Validation of successful activate-->
        close Wizard --> Logout from Dashboard -->login-->Open Wizard-->
        fill all fields in all Tab's(4)-->
        validate second Tab is a "add_service_provider_internal"-->
        build inviteURL from email--> reopen browser with inviteURL-->
        Validate Login Form opened -->
        Login--> Validate Dashboard Form opened
        '''
        user_content = API.User.create_new_user(company="Amdocs")
        uuid = DB.General.select_where_email("uuid", "ice_user_profile",
                                             user_content['email'])
        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)
        Wait.id(Constants.Dashboard.Statuses.Title.ID)
        Click.id(Constants.Dashboard.LeftPanel.AddEngagement.ID)
        # Wizard
        vfName = Frontend.Wizard.add_vf()
        service_provider_internal = \
            Frontend.Wizard.add_service_provider_internal()
        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)
        invitation_token = DB.User.select_invitation_token(
            "invitation_token", "ice_invitation", "engagement_uuid", enguuid,
            inviteEmail, 1)
        inviterURL = Constants.Default.InviteURL.Signup.TEXT + \
            invitation_token + "&email=" + inviteEmail

        Frontend.General.re_open(inviterURL)
        actualInvitedEmail = Get.value_by_name(Constants.Signup.Email.NAME)
        Helper.internal_assert(inviteEmail, actualInvitedEmail)
        signUpURLforContact = DB.User.get_contact_signup_url(
            invitation_token, uuid, service_provider_internal["email"],
            service_provider_internal["full_name"],
            service_provider_internal["phone"],
            service_provider_internal["company"])
        Frontend.General.re_open(signUpURLforContact)
        actualInvitedEmail = Get.value_by_name(Constants.Signup.Email.NAME)
        Helper.internal_assert(service_provider_internal["email"],
                               actualInvitedEmail)
        Helper.internal_assert("+" + service_provider_internal["phone"],
                               Get.value_by_name(Constants.Signup.Phone.NAME))
        Helper.internal_assert(
            service_provider_internal["full_name"],
            Get.value_by_name(Constants.Signup.FullName.NAME))
        signupCompany = Get.value_by_name(Constants.Signup.Company.NAME, True)
        Helper.internal_assert(service_provider_internal["company"],
                               signupCompany)
    def test_add_service_provider_internal(self):
        '''
        TC Name: test_add_service_provider_internal
        Steps:
        Invite is_service_provider_contact Sponsor and
        activate the invited user. Validate sponsor has the right VF.
        '''
        user_content = API.User.create_new_user(company="Amdocs")
        uuid = DB.General.select_where_email("uuid", "ice_user_profile",
                                             user_content['email'])
        activationUrl = DB.User.get_activation_url(user_content['email'])
        Frontend.General.re_open(activationUrl)
        Frontend.User.login(user_content['email'],
                            Constants.Default.Password.TEXT)  # new
        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)
        Wait.id(Constants.Dashboard.Statuses.Title.ID)
        logger.debug("click_on on + Dashboard")
        Click.id(Constants.Dashboard.LeftPanel.AddEngagement.ID)
        # Wizard
        vfName = Frontend.Wizard.add_vf()
        service_provider_internal = \
            Frontend.Wizard.add_service_provider_internal()
        inviteEmail = "automationqatt" + \
            Helper.rand_string("randomString") + "@gmail.com"
        Frontend.Wizard.invite_team_members(inviteEmail)
        Frontend.Wizard.add_ssh_key()
        enguuid = DB.General.select_where("uuid", "ice_vf", "name", vfName, 1)
        invitation_token = DB.User.select_invitation_token(
            "invitation_token", "ice_invitation", "engagement_uuid", enguuid,
            inviteEmail, 1)
        inviterURL = Constants.Default.InviteURL.Signup.TEXT + \
            invitation_token + "&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(
            invitation_token, uuid, service_provider_internal["email"],
            service_provider_internal["full_name"],
            service_provider_internal["phone"],
            service_provider_internal["company"])
        Frontend.General.re_open(signUpURLforContact)
        actualInvitedEmail = Get.value_by_name(Constants.Signup.Email.NAME)
        Helper.internal_assert(str("+" + service_provider_internal["phone"]),
                               Get.value_by_name(Constants.Signup.Phone.NAME))
        Helper.internal_assert(
            service_provider_internal["full_name"],
            Get.value_by_name(Constants.Signup.FullName.NAME))
        Helper.internal_assert(
            service_provider_internal["company"],
            Get.value_by_name(Constants.Signup.Company.NAME))
        # Fetch one is_service_provider_contact user ID.
        engagement_id = DB.General.select_where("engagement_id", "ice_vf",
                                                "name", vfName, 1)
        # SignUp for MainServiceProviderSponsorContact
        engagement_manual_id = DB.General.select_where("engagement_manual_id",
                                                       "ice_engagement",
                                                       "uuid", engagement_id,
                                                       1)

        invitation_token = DB.User.select_invitation_token(
            "invitation_token", "ice_invitation", "engagement_uuid",
            engagement_id, service_provider_internal["email"], 1)
        engLeadEmail = DB.User.select_el_email(vfName)
        user_content['engagement_uuid'] = engagement_id
        user_content['engagement_manual_id'] = engagement_manual_id
        user_content['vfName'] = vfName
        user_content['el_email'] = engLeadEmail

        API.User.signup_invited_user(service_provider_internal["company"],
                                     service_provider_internal["email"],
                                     invitation_token, signUpURLforContact,
                                     user_content, True)
        activationUrl2 = DB.User.get_activation_url(
            service_provider_internal["email"])
        # Activate for VendorContact

        engagement_manual_id = DB.General.select_where("engagement_manual_id",
                                                       "ice_engagement",
                                                       "uuid", engagement_id,
                                                       1)
        # Validate opened right VF for VendorContact
        myVfName = engagement_manual_id + ": " + vfName
        actualVfNameid = "clickable-" + myVfName
        Frontend.General.re_open(activationUrl2)
        Frontend.User.login(service_provider_internal["email"],
                            Constants.Default.Password.TEXT, actualVfNameid)
        actualVfName = Get.by_id(actualVfNameid, wait_for_page=True)
        Helper.internal_assert(myVfName, actualVfName)
Exemple #7
0
 def form_validate_ssh(key):
     key_in_ui = Get.value_by_name(
         Constants.Dashboard.Avatar.Account.SSHKey.NAME)
     Helper.internal_assert(key, key_in_ui)
Exemple #8
0
 def form_validate_company(company):
     company_in_ui = Get.value_by_name(
         Constants.Dashboard.Avatar.Account.Company.NAME)
     Helper.internal_assert(company, company_in_ui)
Exemple #9
0
 def form_validate_phone(phone):
     phone_in_ui = Get.value_by_name(
         Constants.Dashboard.Avatar.Account.Phone.NAME)
     Helper.internal_assert(phone, phone_in_ui)
Exemple #10
0
 def form_validate_email(email):
     email_in_ui = Get.value_by_name(
         Constants.Dashboard.Avatar.Account.Email.NAME)
     Helper.internal_assert(email, email_in_ui)
Exemple #11
0
 def form_validate_name(name):
     name_in_ui = Get.value_by_name(
         Constants.Dashboard.Avatar.Account.FullName.NAME)
     Helper.internal_assert(name, name_in_ui)