def get_url(url_path, course_info): """ Construct a URL to the page within the course. Arguments: url_path: course_info: """ course_key = get_course_key(course_info) return "/".join([LOGIN_BASE_URL, url_path, text_type(course_key)])
def url(self): """ Construct a URL to the page within the course. """ course_key = get_course_key(self.course_info) url = "/".join([ LOGIN_BASE_URL, self.url_path, urllib.quote_plus(unicode(course_key)) ]) return url if url[-1] is '/' else url + '/'
def setUp(self): super(TestDiscountCoupon, self).setUp() # Initialize common variables self.course_info = get_wl_course_info(org=COURSE_ORG, num=COURSE_NUMBER, run=COURSE_RUN) self.course_id = str(get_course_key(self.course_info)) self.course_title = self.course_info["display_name"] self.course_price = DEFAULT_COURSE_PRICE self.total_price = DEFAULT_COURSE_PRICE self.stock_record_id = self.ecommerce_api.get_stock_record_id( self.course_id, self.course_title)
def setUp(self): """ Initialize all objects """ super(TestEnrollmentOtto, self).setUp() self.course_info = get_wl_course_info(org=COURSE_ORG, num=COURSE_NUMBER, run=COURSE_RUN) self.course_id = str(get_course_key(self.course_info)) self.course_title = self.course_info["display_name"] self.course_price = DEFAULT_COURSE_PRICE self.total_price = DEFAULT_COURSE_PRICE # Initialize page objects self.course_about = CourseAboutPage(self.browser, self.course_id)
def click_view_live_button(self): """ Clicks view live button """ disable_animations(self) course_info = get_course_info() course_key = get_course_key({ 'course_org': course_info['org'], 'course_num': course_info['number'], 'course_run': course_info['run'] }) self.browser.execute_script( "document.querySelectorAll('[data-course-key = \"" "{}\"] .view-button')[0].click();".format(str(course_key))) self.browser.switch_to_window(self.browser.window_handles[-1])
def setUp(self): """ Initialize all objects """ super(TestEnrollmentOtto, self).setUp() self.course_info = get_wl_course_info( org=COURSE_ORG, num=COURSE_NUMBER, run=COURSE_RUN ) self.course_id = str(get_course_key(self.course_info)) self.course_title = self.course_info["display_name"] self.course_price = DEFAULT_COURSE_PRICE self.total_price = DEFAULT_COURSE_PRICE # Initialize page objects self.course_about = CourseAboutPage(self.browser, self.course_id)
def setUp(self): super(TestDiscountCoupon, self).setUp() # Initialize common variables self.course_info = get_wl_course_info( org=COURSE_ORG, num=COURSE_NUMBER, run=COURSE_RUN ) self.course_id = str(get_course_key(self.course_info)) self.course_title = self.course_info["display_name"] self.course_price = DEFAULT_COURSE_PRICE self.total_price = DEFAULT_COURSE_PRICE self.stock_record_id = self.ecommerce_api.get_stock_record_id( self.course_id, self.course_title )
def url(self): """ Construct a URL to the page within the course. """ course_id = get_course_key(self.course_info) return LOGIN_BASE_URL + "/" + self.url_path + "/" + unicode(course_id)
def url(self): """ Construct a URL to the page within the course. """ course_id = get_course_key(self.course_info) return "/".join((LOGIN_BASE_URL, self.url_path, text_type(course_id)))
def get_url(url_path, course_info): """ Construct a URL to the page within the course. """ course_key = get_course_key(course_info) return "/".join([LOGIN_BASE_URL, url_path, unicode(course_key)])