本文整理汇总了Python中helperRecip.WebdriverUtilities.WebdriverUtilities.focus方法的典型用法代码示例。如果您正苦于以下问题:Python WebdriverUtilities.focus方法的具体用法?Python WebdriverUtilities.focus怎么用?Python WebdriverUtilities.focus使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类helperRecip.WebdriverUtilities.WebdriverUtilities
的用法示例。
在下文中一共展示了WebdriverUtilities.focus方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: testProgramAuditInterviewRequest
# 需要导入模块: from helperRecip.WebdriverUtilities import WebdriverUtilities [as 别名]
# 或者: from helperRecip.WebdriverUtilities.WebdriverUtilities import focus [as 别名]
#.........这里部分代码省略.........
util.selectFromDropdownUntilSelected(objective2_select, "Interview") # didn't work the first time
print "Hover over +PBC Request then click on Create PBC Response to launch modal"
add_pbc_response_link_within_the_objective = element.audit_pbc_request.replace("TITLE",grcobject.objective_title[1] )+element.section_add_link
create_pbc_response_link_within_the_objective = element.audit_pbc_request.replace("TITLE",grcobject.objective_title[1] )+element.section_create_link
util.waitForElementToBePresent(add_pbc_response_link_within_the_objective)
util.scrollIntoView(add_pbc_response_link_within_the_objective)
util.hoverOverAndWaitFor(add_pbc_response_link_within_the_objective,create_pbc_response_link_within_the_objective)
util.clickOn(add_pbc_response_link_within_the_objective)
util.clickOn(create_pbc_response_link_within_the_objective)
#Description field : "Response foir Interview Type", Save
print "creating new interview response"
do.NewResponseCreate("Response for Interview Type")
#Click on Response for Interview Type header to reveal response 2nd tier info
#click +Object to open Map Object Selector. Change top filter to Org Group if neccessary (should not be). Choose Reciprocity Dev Team and hit Map button. (use search to find this if easier to implement)
#Confirm Reciprocity Dev Team is mapped to the Response and appears in the area provided
#after creating a new response, the whole response section gets expanded automatically now,
#just need to wait for all elements to load (+Object, +Person, + Meeting)
add_object_link = element.audit_pbc_request_response_add_object_link_within_response.replace("TITLE",grcobject.objective_title[1] )
add_person_link = element.audit_pbc_request_response_add_person_within_response.replace("TITLE",grcobject.objective_title[1] )
add_meeting_link = element.audit_pbc_request_response_add_meeting.replace("TITLE",grcobject.objective_title[1] )
util.waitForElementToBePresent(add_object_link)
self.assertTrue(util.isElementPresent(add_object_link), "do not see the open close button for the response")
util.waitForElementToBePresent(add_person_link)
self.assertTrue(util.isElementPresent(add_person_link), "do not see the + Person link")
util.waitForElementToBePresent(add_meeting_link)
self.assertTrue(util.isElementPresent(add_meeting_link), "do not see the + Meeting link")
#click +Object to open Map Object Selector.
util.clickOn(add_object_link)
#Change top filter to Org Group.
util.waitForElementToBePresent(element.mapping_modal_window)
self.assertTrue(util.isElementPresent(element.mapping_modal_window), "do not see the modal window")
util.waitForElementToBePresent(element.mapping_modal_top_filter_selector_dropdown)
self.assertTrue(util.isElementPresent(element.mapping_modal_top_filter_selector_dropdown), "do not see the modal window")
util.selectFromDropdownByValue(element.mapping_modal_top_filter_selector_dropdown, "OrgGroup")
#Choose Reciprocity Dev Team and hit Map button. (use search to find this if easier to implement)
util.waitForElementToBePresent(element.mapping_modal_top_filter_selector_dropdown_reciprocity_dev_team_option)
self.assertTrue(util.isElementPresent(element.mapping_modal_top_filter_selector_dropdown_reciprocity_dev_team_option), "do not see the open close button for the response")
util.clickOn(element.mapping_modal_top_filter_selector_dropdown_reciprocity_dev_team_option)
util.waitForElementToBePresent(element.mapping_modal_window_map_button)
self.assertTrue(util.isElementPresent(element.mapping_modal_window_map_button), "no Map button")
util.clickOn(element.mapping_modal_window_map_button)
util.waitForElementNotToBePresent(element.mapping_modal_window)
#Confirm Reciprocity Dev Team is mapped to the Response and appears in the area provided
util.waitForElementToBePresent(element.audit_pbc_request_response_mapped_org_group_object_withrecipprocity_dev_team)
self.assertTrue(util.isElementPresent(element.audit_pbc_request_response_mapped_org_group_object_withrecipprocity_dev_team), "no Mapped org group button")
#click on +Person link to launch Map People modal
print "click on +Person link to launch Map People modal"
#add_person_link = element.audit_pbc_request_response_add_person_within_response.replace("TITLE",grcobject.objective_title[1] )
util.waitForElementToBePresent(add_person_link)
self.assertTrue(util.isElementPresent(add_person_link), "do not see the + Person link")
util.clickOn(add_person_link)
#search for "silas"
print "searching and mapping another participant"
person_email=do.mapPerson("silas")
#confirm silas has been added to Participant area
print "confirming another participant has been mapped"
participant_email = element.audit_pbc_request_response_participant_email.replace("EMAIL",person_email)
util.waitForElementToBePresent(participant_email)
self.assertTrue(util.isElementPresent(participant_email), "do not see the Person Mapped email")
#click on +Meetings in Meetings area
print "click on +Meetings in Meetings area"
add_meeting_link = element.audit_pbc_request_response_add_meeting.replace("TITLE",grcobject.objective_title[1] )
print "add meeting link is " +add_meeting_link
util.waitForElementToBePresent(add_meeting_link)
self.assertTrue(util.isElementPresent(add_meeting_link), "do not see +Meeting link")
create_meeting_link = element.audit_pbc_request_response_create_meeting.replace("TITLE",grcobject.objective_title[1] )
util.scrollIntoView(add_meeting_link)
util.scrollIntoView(add_meeting_link)
util.move_mouse_over(add_meeting_link)
util.scrollIntoView(add_meeting_link)
util.hoverOver(add_meeting_link)
util.clickOn(create_meeting_link)
meeting_date = (date.today())+ datetime.timedelta(days=14)
meeting_date_into_format = do.convertDateIntoFormat(meeting_date)
#Enter Title: Auto Test of Audit - Interview Response - Scheduling a meeting, Choose date : current date + 2 weeks, Set start time to 12pm, Set end time to 1pm, Confirm particpants are silas and testrecip
do.scheduleMeeting("Auto Test of Audit - Interview Response - Scheduling a meeting-"+strftime("%Y_%m_%d__%H_%M_%S"),meeting_date_into_format, "03:00 PM", "04:00 PM")
#do.closeOtherWindows()
#util.switch_to_active_element()
util.focus()
util.waitForElementToBePresent(element.meeting_expnad_link)
util.clickOn(element.meeting_expnad_link)
do.verifyMeetingData(meeting_date_into_format, "03:00 PM", "04:00 PM")
示例2: testProgramAudit
# 需要导入模块: from helperRecip.WebdriverUtilities import WebdriverUtilities [as 别名]
# 或者: from helperRecip.WebdriverUtilities.WebdriverUtilities import focus [as 别名]
#.........这里部分代码省略.........
util.waitForElementToBePresent(element.mapping_modal_window_map_button)
self.assertTrue(util.isElementPresent(element.mapping_modal_window_map_button), "no Map button")
util.clickOn(element.mapping_modal_window_map_button)
util.waitForElementNotToBePresent(element.mapping_modal_window)
#Confirm Reciprocity Dev Team is mapped to the Response and appears in the area provided
util.waitForElementToBePresent(element.audit_pbc_request_response_mapped_org_group_object_withrecipprocity_dev_team)
self.assertTrue(util.isElementPresent(element.audit_pbc_request_response_mapped_org_group_object_withrecipprocity_dev_team), "no Mapped org group button")
#click on +Person link to launch Map People modal
print "click on +Person link to launch Map People modal"
#add_person_link = element.audit_pbc_request_response_add_person_within_response.replace("TITLE",grcobject.objective_title[1] )
util.waitForElementToBePresent(add_person_link)
self.assertTrue(util.isElementPresent(add_person_link), "do not see the + Person link")
util.clickOn(add_person_link)
#search for "silas"
print "searching and mapping another participant"
person_email=do.mapPerson("silas")
#confirm silas has been added to Participant area
print "confirming another participant has been mapped"
participant_email = element.audit_pbc_request_response_participant_email.replace("EMAIL",person_email)
util.waitForElementToBePresent(participant_email)
self.assertTrue(util.isElementPresent(participant_email), "do not see the Person Mapped email")
#click on +Meetings in Meetings area
print "click on +Meetings in Meetings area"
add_meeting_link = element.audit_pbc_request_response_add_meeting.replace("TITLE",grcobject.objective_title[1] )
print "add meeting link is " +add_meeting_link
util.waitForElementToBePresent(add_meeting_link)
self.assertTrue(util.isElementPresent(add_meeting_link), "do not see +Meeting link")
create_meeting_link = element.audit_pbc_request_response_create_meeting.replace("TITLE",grcobject.objective_title[1] )
util.scrollIntoView(add_meeting_link)
util.scrollIntoView(add_meeting_link)
util.move_mouse_over(add_meeting_link)
util.scrollIntoView(add_meeting_link)
util.hoverOver(add_meeting_link)
util.clickOn(create_meeting_link)
meeting_date = (date.today())+ datetime.timedelta(days=14)
meeting_date_into_format = do.convertDateIntoFormat(meeting_date)
#Enter Title: Auto Test of Audit - Interview Response - Scheduling a meeting, Choose date : current date + 2 weeks, Set start time to 12pm, Set end time to 1pm, Confirm particpants are silas and testrecip
do.scheduleMeeting("Auto Test of Audit - Interview Response - Scheduling a meeting-"+strftime("%Y_%m_%d__%H_%M_%S"),meeting_date_into_format, "03:00 PM", "04:00 PM")
#do.closeOtherWindows()
#util.switch_to_active_element()
util.focus()
util.waitForElementToBePresent(element.meeting_expnad_link)
util.clickOn(element.meeting_expnad_link)
do.verifyMeetingData(meeting_date_into_format, "03:00 PM", "04:00 PM")
do.expandCollapseRequest(grcobject.objective_title[1])
time.sleep(3)
#11. Click on Objective 3 for Auto Test of Audit to open 2nd tier info (Population Sample)
print "11. Click on Objective 3 for Auto Test of Audit to open 2nd tier info (Population Sample)"
do.expandCollapseRequest(grcobject.objective_title[2])
print "Hover over +PBC Request then click on Create PBC Response to launch modal"
add_pbc_response_link_within_the_objective = element.audit_pbc_request.replace("TITLE",grcobject.objective_title[2] )+element.section_add_link
create_pbc_response_link_within_the_objective = element.audit_pbc_request.replace("TITLE",grcobject.objective_title[2] )+element.section_create_link
util.waitForElementToBePresent(add_pbc_response_link_within_the_objective)
util.scrollIntoView(add_pbc_response_link_within_the_objective)
util.hoverOverAndWaitFor(add_pbc_response_link_within_the_objective,create_pbc_response_link_within_the_objective)
util.clickOn(add_pbc_response_link_within_the_objective)
util.clickOn(create_pbc_response_link_within_the_objective)
#Description field : ""Response for Population Sample Type"", Save
print "creating new interview response"
do.NewResponseCreate("Response for Population Sample Type")
#click +Object to open Map Object Selector.
add_object_link = element.audit_pbc_request_response_add_object_link_within_response.replace("TITLE",grcobject.objective_title[2] )
util.waitForElementToBePresent(add_object_link)
util.clickOn(add_object_link)
#Change top filter to Org Group.
util.waitForElementToBePresent(element.mapping_modal_window)
self.assertTrue(util.isElementPresent(element.mapping_modal_window), "do not see the modal window")
util.waitForElementToBePresent(element.mapping_modal_top_filter_selector_dropdown)
self.assertTrue(util.isElementPresent(element.mapping_modal_top_filter_selector_dropdown), "do not see the modal window")
util.clickOn(element.mapping_modal_search_reset)
util.selectFromDropdownByValue(element.mapping_modal_top_filter_selector_dropdown, "OrgGroup")
#Choose Reciprocity Dev Team and hit Map button. (use search to find this if easier to implement)
util.waitForElementToBePresent(element.mapping_modal_top_filter_selector_dropdown_reciprocity_dev_team_option)
self.assertTrue(util.isElementPresent(element.mapping_modal_top_filter_selector_dropdown_reciprocity_dev_team_option), "do not see the open close button for the response")
util.clickOn(element.mapping_modal_top_filter_selector_dropdown_reciprocity_dev_team_option)
util.waitForElementToBePresent(element.mapping_modal_window_map_button)
self.assertTrue(util.isElementPresent(element.mapping_modal_window_map_button), "no Map button")
util.clickOn(element.mapping_modal_window_map_button)
util.waitForElementNotToBePresent(element.mapping_modal_window)
#Confirm Reciprocity Dev Team is mapped to the Response and appears in the area provided
util.waitForElementToBePresent(element.audit_pbc_request_response_mapped_org_group_object_withrecipprocity_dev_team)
self.assertTrue(util.isElementPresent(element.audit_pbc_request_response_mapped_org_group_object_withrecipprocity_dev_team), "no Mapped org group button")