Ejemplo n.º 1
0
    def testName(self):
        # Define PageObjects
        wp = WaitForPageLoad(self.browser)
        lg = LoginPage(self.browser)
        oc = OnlineCoursesPage(self.browser)
        wbd = WebDevelopmentPage(self.browser)
        se = SeleniumPage(self.browser)

        lg.login(self.browser, self.EMAIL, self.PASSWORD)
        wp.old_page_loaded_()
        wp.wait_for_page_redirect()
        oc.selectwebdevelopmentfromcategories(self.browser)
        wp.wait_for_page_redirect()
        # WebDevelopment Search Selenium Courses
        wbd.seleniumsearch(self.browser)
        wp.wait_for_page_redirect()
        free_courses = se.search4freecourses(self.browser)
        assert free_courses > 2 and free_courses < 10
        # Verify Selenium word in courses and all are Free
        [selenium_list, free_list] = se.selenium_free_list(self.browser)
        for i in range(0, len(free_list)):
            if free_list[i] != self.FREE:
                assert False
        name_list_splitted = " ".join(selenium_list).split()
        keyword_list = [self.SELENIUM]
        if any(word in name_list_splitted for word in keyword_list):
            assert True
        else:
            assert False
        pass
Ejemplo n.º 2
0
 def test_login(self):
     login_page = LoginPage(self.driver)
     login_page.login('18410078814','123456')
     time.sleep(5)
     try:
         assert 'home' in login_page.get_page_url()
         logger.info('login sucess.')
     except Exception as e:
         logger.error('login Fail.%s', format(e))
Ejemplo n.º 3
0
class TestLogin(unittest.TestCase):

    # 所有的case执行前都会运行
    def setUp(self):
        self.login_page = LoginPage()
        self.login_page.get_url('http://122.225.207.133:20001')

    # 加了修饰器的case才会调用
    @classmethod
    def setUpClass(cls):

        # cls.webdriver = BasePage()
        # cls.webdriver.get_url('http://122.225.207.133:20001')
        # sleep(4)
        pass

    def test_login_success(self):
        #self.webdriver.max_window()
        self.login_page.login('Admin', '123456', '1234')
        a = 1 - self.login_page.islogin()
        print(f'-----------------{a}')
        self.assertTrue(a)

    def test_login_faild(self):
        #self.webdriver.max_window()
        self.login_page.login('Admin', '123456', '2222')
        self.assertTrue(self.login_page.islogin())

    def test_login_faild2(self):
        #self.webdriver.max_window()
        self.login_page.login('Admin', '123456', '2222')
        self.assertFalse(self.login_page.islogin())
Ejemplo n.º 4
0
    def test_mainland_login(self):
        # 登陆
        loginpage = LoginPage(self.driver)
        loginpage.click_login_btn()
        loginpage.login(username, password)
        logger.info('登陆成功')

        # 信息编辑
        infofill = InfoFill(self.driver)
        infofill.message_edit('测试', '测试', username)

        # 搜索筛选
        searchfilter = SearchFilter(self.driver)
        searchfilter.search('葡萄酒')
        searchfilter.filter()

        # 现货购买流程
        goodsprompt = GoodsPrompt(self.driver)
        goodsprompt.navbox_buy()

        # 期酒购买流程
        primeur = Primeur(self.driver)
        primeur.primeur_buy('*****@*****.**')
        primeur.primeur_search('葡萄')