Example #1
0
 def wait_for_approvals_msg(self, string=None):
     Wait(self.driver, util.get_short_timeout()).until(
         ec.visibility_of_element_located(SignUpPage.APPROVALS_MSG))
     if string:
         app.logger.info(
             f'Visible: {self.element(SignUpPage.APPROVALS_MSG).get_attribute("innerText")}'
         )
         self.wait_for_text_in_element(SignUpPage.APPROVALS_MSG, string)
Example #2
0
 def test_invt_role(self):
     self.sign_up_page.log_out()
     util.set_instructor_role(self.section, self.instructor, 'INVT')
     self.login_page.dev_auth(self.instructor.uid)
     self.ouija_page.wait_for_element(OuijaBoardPage.NO_COURSES_MSG,
                                      util.get_short_timeout())
     self.sign_up_page.hit_url(self.section.term.id, self.section.ccn)
     self.sign_up_page.wait_for_diablo_title('Page not found')
 def click_edit_template_link(self, template):
     app.logger.info(
         f'Clicking link to edit template type "{template.template_type.value}"'
     )
     self.wait_for_page_and_click_js(
         EmailTemplatesPage.edit_template_link_locator(template),
         util.get_short_timeout(),
     )
Example #4
0
 def load_page(self):
     app.logger.info('Loading email')
     self.driver.get('https://mail.yahoo.com')
     self.wait_for_element(EmailPage.COMPOSE_BUTTON,
                           util.get_short_timeout())
     # Pause then hit escape to dismiss any modals that appear
     time.sleep(1)
     self.hit_escape()
Example #5
0
 def open_printable_schedule(self):
     app.logger.info('Opening the printable room schedule')
     self.wait_for_page_and_click_js(RoomPrintablePage.PRINT_SCHED_LINK)
     time.sleep(1)
     windows = self.window_handles()
     self.switch_to_last_window(windows)
     Wait(self.driver, util.get_short_timeout()).until(
         ec.visibility_of_element_located(RoomPrintablePage.ROOM_NAME))
Example #6
0
 def log_in(self):
     app.logger.info('Logging in to Kaltura')
     self.driver.get(f'{app.config["KALTURA_MEDIA_SPACE_URL"]}/user/login')
     self.wait_for_element_and_type(KalturaPage.USERNAME_INPUT,
                                    app.config['XENA_KALTURA_USERNAME'])
     self.wait_for_element_and_type(KalturaPage.PASSWORD_INPUT,
                                    app.config['XENA_KALTURA_PASSWORD'])
     self.wait_for_element_and_click(KalturaPage.LOG_IN_BUTTON)
     Wait(self.driver, util.get_short_timeout()).until(
         ec.presence_of_element_located(KalturaPage.LOG_OUT_LINK))
Example #7
0
 def click_element(self, locator, addl_pause=None):
     self.hide_diablo_footer()
     sleep_default = app.config['CLICK_SLEEP']
     time.sleep(addl_pause or sleep_default)
     Wait(driver=self.driver, timeout=util.get_short_timeout()).until(
         method=ec.element_to_be_clickable(locator),
         message=f'Failed to click_element: {str(locator)}',
     )
     time.sleep(addl_pause or sleep_default)
     self.element(locator).click()
Example #8
0
 def test_ineligible_room(self):
     self.sign_up_page.log_out()
     meet = {'room': {'name': 'Chavez 3'}}
     meeting = Meeting(meet)
     util.set_meeting_location(self.section, meeting)
     util.set_instructor_role(self.section, self.instructor, 'PI')
     self.login_page.dev_auth(self.instructor.uid)
     self.ouija_page.wait_for_element(OuijaBoardPage.NO_COURSES_MSG,
                                      util.get_short_timeout())
     self.sign_up_page.load_page(self.section)
     assert self.sign_up_page.is_present(SignUpPage.NOT_ELIGIBLE_MSG)
Example #9
0
 def delete_series(self, recording_schedule):
     app.logger.info('Clicking the delete button')
     self.load_event_edit_page(recording_schedule.series_id)
     self.wait_for_element(KalturaPage.SERIES_DELETE_BUTTON,
                           util.get_medium_timeout())
     self.scroll_to_bottom()
     self.wait_for_page_and_click(KalturaPage.SERIES_DELETE_BUTTON, 3)
     self.wait_for_element_and_click(
         KalturaPage.SERIES_DELETE_CONFIRM_BUTTON)
     redirect_url = f'{app.config["KALTURA_MEDIA_SPACE_URL"]}/calendar/index/calendar/'
     Wait(self.driver,
          util.get_short_timeout()).until(ec.url_to_be(redirect_url))
Example #10
0
 def wait_for_text_in_element(self, locator, string):
     tries = 0
     retries = util.get_short_timeout()
     while tries <= retries:
         tries += 1
         try:
             assert string in self.element(locator).get_attribute('innerText')
             break
         except AssertionError:
             if tries == retries:
                 raise
             else:
                 time.sleep(1)
Example #11
0
 def is_message_delivered(self, message):
     app.logger.info(f'Waiting for email subject {message.subject}')
     self.load_page()
     tries = 0
     retries = app.config['XENA_EMAIL_DELIVERY_RETRIES']
     while tries <= retries:
         tries += 1
         try:
             app.logger.info(f'Attempt {tries}')
             assert self.is_message_present(message)
             return True
         except Exception as e:
             app.logger.info(f'Error: {e}')
             time.sleep(util.get_short_timeout())
             if tries == retries:
                 return False
Example #12
0
 def load_page(self):
     tries = 0
     retries = 2
     while tries <= retries:
         tries += 1
         try:
             app.logger.info('Loading email')
             self.driver.get('https://mail.yahoo.com')
             self.wait_for_element(EmailPage.COMPOSE_BUTTON,
                                   util.get_short_timeout())
             # Pause then hit escape to dismiss any modals that appear
             time.sleep(1)
             self.hit_escape()
             tries = retries + 1
         except TimeoutException:
             if tries == retries:
                 raise
             else:
                 time.sleep(1)
Example #13
0
 def wait_for_room_result(self, room):
     self.wait_for_element(RoomsPage.room_row_locator(room), util.get_short_timeout())
Example #14
0
 def open_recurrence_modal(self):
     app.logger.info('Clicking recurrence button')
     self.wait_for_element_and_click(KalturaPage.SERIES_RECUR_BUTTON)
     self.wait_for_element(KalturaPage.RECUR_MODAL_H3,
                           util.get_short_timeout())
Example #15
0
 def close_recurrence_modal(self):
     app.logger.info('Closing recurrence modal')
     self.wait_for_element_and_click(KalturaPage.RECUR_MODAL_CANCEL_BUTTON)
     self.when_not_present(KalturaPage.RECUR_MODAL_CANCEL_BUTTON,
                           util.get_short_timeout())
 def wait_for_course_row(self, section):
     loc = By.XPATH, CourseChangesPage.course_container_xpath(section)
     Wait(self.driver, util.get_short_timeout()).until(
         ec.visibility_of_element_located(loc))
     time.sleep(1)
Example #17
0
 def test_selected_rec_type(self):
     self.sign_up_page.wait_for_element(SignUpPage.RECORDING_TYPE_SCHEDULED,
                                        util.get_short_timeout())
     assert self.sign_up_page.scheduled_rec_type(
     ) == self.recording_schedule.recording_type.value['selection']
Example #18
0
 def wait_for_title(self, string):
     app.logger.info(f"'Waiting for page title '{string}'")
     Wait(self.driver, util.get_short_timeout()).until(
         method=(ec.title_is(string)),
         message=f'Failed wait_for_title: {string}',
     )
 def wait_for_results(self):
     Wait(self.driver, util.get_short_timeout()).until(
         ec.visibility_of_element_located(CourseChangesPage.PAGE_HEADING))
Example #20
0
 def test_not_eligible_user(self):
     self.sign_up_page.log_out()
     self.login_page.dev_auth('61889')
     self.login_page.wait_for_element(LoginPage.ALERT_MSG,
                                      util.get_short_timeout())
Example #21
0
 def wait_for_course_results(self):
     Wait(self.driver, util.get_short_timeout()).until(
         ec.visibility_of_any_elements_located(OuijaBoardPage.COURSE_ROW), )
Example #22
0
 def wait_for_rooms_list(self):
     Wait(self.driver, util.get_short_timeout()).until(ec.visibility_of_any_elements_located(RoomsPage.ROOM_LINK))
Example #23
0
 def test_not_course_instructor(self):
     util.change_course_instructor(self.section, self.instructor)
     self.sign_up_page.hit_url(self.section.term.id, self.section.ccn)
     self.sign_up_page.wait_for_element(
         SignUpPage.not_authorized_msg_locator(self.section),
         util.get_short_timeout())
 def click_save(self):
     app.logger.info('Clicking save')
     Wait(self.driver, util.get_short_timeout()).until(
         ec.presence_of_element_located(EmailTemplatesPage.SAVE_BUTTON), )
     self.click_element_js(EmailTemplatesPage.SAVE_BUTTON)
 def wait_for_template_row(self, template):
     Wait(self.driver, util.get_short_timeout()).until(
         ec.visibility_of_element_located(
             EmailTemplatesPage.edit_template_link_locator(template)), )
Example #26
0
 def wait_for_title_contains(self, string):
     app.logger.info(f"Waiting for page title containing '{string}")
     Wait(self.driver, util.get_short_timeout()).until(
         method=(ec.title_contains(string)),
         message=f'Failed wait_for_title_contains: {string}',
     )
Example #27
0
 def wait_for_approval_confirmation(self):
     Wait(self.driver, util.get_short_timeout()).until(ec.visibility_of_element_located(SignUpPage.CONFIRMATION_MSG))
Example #28
0
 def wait_for_course_result(self, section):
     Wait(self.driver, util.get_short_timeout()).until(
         ec.visibility_of_element_located(
             OuijaBoardPage.course_row_locator(section)), )
Example #29
0
 def wait_for_delete_button(self):
     self.wait_for_element(KalturaPage.SERIES_DELETE_BUTTON,
                           util.get_short_timeout())
Example #30
0
 def wait_for_element_and_click(self, locator, addl_pause=None):
     self.wait_for_element(locator, util.get_short_timeout())
     self.click_element(locator, addl_pause)