def go_to_basket(self, bulk_purchase=False):
        """
        Perform all the steps from dashboard to reaching the basket page.

        If bulk_purchase is set to 'True' then go to multi seat basket,
        otherwise go to single seat basket.

        Arguments:
            bulk_purchase(bool): Indicates type of the purchase.
        """
        course_about_page = CourseAboutPage(self.browser, self.course_id)
        # Check that course is not already present on dashboard and use find
        # course link to go to courses page
        self.assertFalse(self.dashboard_page.is_course_present(self.course_id))
        self.dashboard_page.click_courses_button()
        self.courses_page.wait_for_page()
        # find the target course and click on it to go to about page
        self.courses_page.click_on_the_course(self.course_id)
        course_about_page.wait_for_page()
        # Verify that course price is correct on course about page
        self.assertEqual(
            self.course_price, course_about_page.course_price
        )
        if bulk_purchase:
            # go to multi seat basket page
            course_about_page.click_on_multi_seat_basket()
            self.multi_seat_basket_page.wait_for_page()
        else:
            # go to single seat basket page
            course_about_page.click_on_single_seat_basket()
            self.single_seat_basket_page.wait_for_page()
        # Verify course name, course price and total price on basket page
        # self.verify_course_name_on_basket()
        self.verify_price_on_basket()
Esempio n. 2
0
 def setUp(self):
     """
     Prepare setup for running tests
     """
     super(TestDynamicEnrollmentCoupon, self).setUp()
     # Initialize common variables
     course_id, course_info = random.choice(COURSES_CATALOG.items())
     self.course_id = course_id
     self.course_price = course_info['price']
     self.total_price = course_info['price']
     self.course_title = course_info['title']
     # Initialize all page objects
     self.course_about = CourseAboutPage(self.browser, self.course_id)
 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)