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)
def invite_x_users(user_content, vf_left_nav_id, x): for _ in range(x): # Invites 2-5 Click.id(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) FEWizard.invite_team_members_modal(user_content[1]['email']) FEGeneral.refresh()
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 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_x_users_and_verify_VF_appers_for_invited(user_content, engName): inviteEmail = Helper.rand_string( 'randomString') + "@" + ServiceProvider.email vflist = FEInvite.create_x_vfs(user_content, engName, x=3) 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) FEWizard.invite_team_members_modal(inviteEmail, wait_modal_to_disappear=False) FEGeneral.refresh() # validations FEInvite.validations_for_user2(user_content, inviteEmail, vflist)
class Frontend: User = FEUser() Invite = FEInvite() Checklist = FEChecklist() Dashboard = FEDashboard() DetailedView = FEDetailedView() General = FEGeneral() Overview = FEOverview() Wizard = FEWizard() Cms = FECms() ChecklistTemplate = FEChecklistTemplate()
def create_x_vfs(user_content, engName, x): vflist = [] FEUser.login(user_content['email'], Constants.Default.Password.TEXT) for _ in range(x): vf_left_nav_id = "clickable-" + engName Click.id(vf_left_nav_id) Click.id(Constants.Dashboard.LeftPanel.AddEngagement.ID) vfName = FEWizard.add_vf() vflist.append(vfName) Click.id(Constants.Dashboard.Wizard.CloseButton.ID, wait_for_page=True) return vflist
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 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