class RegisterCoursesTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def class_setup(self):
        self.courses = RegisterCoursesPage(self.driver)
        self.nav = NavigationPage(self.driver)
        self.ts = Status(self.driver)

    def setUp(self):
        self.nav.click_header_logo()
        self.nav.navigate_to_all_courses()

    @pytest.mark.run(order=1)
    @data(*get_csv_data(
        "C:\\Users\\Ctramm\\PycharmProjects\\ExampleAutomationFramework\\testdata.csv"
    ))
    @unpack
    def test_invalid_enrollment(self, course_name, cc_num, cc_exp, cc_cvv,
                                zip_code):
        self.courses.enter_course_name(course_name)
        self.courses.select_course_to_enroll(course_name)
        self.courses.enroll_course(cc_num, cc_exp, cc_cvv, zip_code)
        result = self.courses.verify_enroll_button_is_disabled()
        self.ts.mark_final("test_invalid_enrollment", result,
                           "Enrollment Failed Verification")
        self.courses.take_screenshot("test_invalid_enrollment")
예제 #2
0
class RegisterCoursesTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def class_setup(self):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = Status(self.driver)

    @pytest.mark.run(order=1)
    def test_invalid_enrollment(self):
        self.courses.enter_course_name("JavaScript")
        self.courses.select_course_to_enroll("JavaScript for beginners")
        self.courses.enroll_course(num="10",
                                   exp="1220",
                                   cvv="10",
                                   zip_code="76710")
        result = self.courses.verify_enroll_button_is_disabled()
        self.ts.mark_final("test_invalid_enrollment", result,
                           "Enrollment Failed Verification")
class RegisterCoursesTests(unittest.TestCase):
    @pytest.fixture(autouse=True)
    def class_setup(self):
        self.courses = RegisterCoursesPage(self.driver)
        self.ts = Status(self.driver)

    @pytest.mark.run(order=1)
    @data(("JavaScript for beginners", "10", "1220", "10", "76710"),
          ("Learn Python 3 from scratch", "20", "1221", "20", "90210"))
    @unpack
    def test_invalid_enrollment(self, course_name, cc_num, cc_exp, cc_cvv,
                                zip_code):
        self.courses.enter_course_name(course_name)
        self.courses.select_course_to_enroll(course_name)
        self.courses.enroll_course(cc_num, cc_exp, cc_cvv, zip_code)
        result = self.courses.verify_enroll_button_is_disabled()
        self.ts.mark_final("test_invalid_enrollment", result,
                           "Enrollment Failed Verification")
        self.driver.get("https://letskodeit.teachable.com/courses")
예제 #4
0
class LoginTests(unittest.TestCase):

    @pytest.fixture(autouse=True)
    def class_setup(self, one_time_setup):
        self.lp = LoginPage(self.driver)
        self.ts = Status(self.driver)

    @pytest.mark.run(order=1)
    def test_invalid_login(self):
        self.lp.logout()
        self.lp.login("*****@*****.**", "badPassword")
        result = self.lp.verify_login_failure()
        self.ts.mark_final("test_invalid_login", result, "Invalid Login passed")

    @pytest.mark.run(order=2)
    def test_valid_login(self):
        self.lp.login("*****@*****.**", "abcabc")
        result = self.lp.verify_title()
        self.ts.mark(result, "Verify Title passed")
        result2 = self.lp.verify_login_success()
        self.ts.mark_final("test_valid_login", result2, "Valid login passed")