Exemplo n.º 1
0
 def incorrect_login(self):
     h = HomePage()
     h.open_default_url()
     l = h.go_to_login_page()
     l.username = "foo"
     l.password = "bar"
     l.do_login()
     self.assertEqual(l.error_message, "Incorrect username or password.")
 def test_incorrect_login_with_soft_assert(self):
     h = HomePage()
     h.open_default_url()
     l = h.go_to_login_page()
     l.username = "foo"
     l.password = "bar"
     l.do_login()
     self.matchers.verify_equal(l.error_message, "Incorrect username or password.")
Exemplo n.º 3
0
 def incorrect_login_fails(self):
     h = HomePage()
     h.open_default_url()
     l = h.go_to_login_page()
     l.username = "foo"
     l.password = "bar"
     l.do_login()
     self.assertEqual(l.error_message, "This message is deliberately incorrect to trigger a failed test.")
 def test_incorrect_login(self):
     h = HomePage()
     h.open_default_url()
     l = h.go_to_login_page()
     l.username = "foo"
     l.password = "bar"
     l.do_login()
     self.matchers.assert_equal(l.error_message, self.bad_password)
Exemplo n.º 5
0
 def incorrect_login_with_random_username_and_password(self):
     h = HomePage()
     h.open_default_url()
     l = h.go_to_login_page()
     
     from saunter.generators.string_data import random_string
     l.username = random_string(5)
     l.password = random_string()
     
     l.do_login()
     self.assertEqual(l.error_message, "Incorrect username or password.")
Exemplo n.º 6
0
    def incorrect_login_from_sqlite3(self):
        h = HomePage()
        h.open_default_url()
        l = h.go_to_login_page()

        from saunter.providers.sqlite3_provider import DBProvider
        p = DBProvider()
        data = p.get_random_user()
        l.username = data['username']
        l.password = data['password']

        l.do_login()
        self.assertEqual(l.error_message, "Incorrect username or password.")
Exemplo n.º 7
0
 def incorrect_login_from_csv(self):
     h = HomePage()
     h.open_default_url()
     l = h.go_to_login_page()
     
     from saunter.providers.csv_provider import CSVProvider
     p = CSVProvider('invalid_usernames.csv')
     data = p.randomRow()
     l.username = data['username']
     l.password = data['password']
     
     l.do_login()
     self.assertEqual(l.error_message, "Incorrect username or password.")
Exemplo n.º 8
0
    def test_incorrect_login_from_sqlite3(self):
        h = HomePage()
        h.open_default_url()
        l = h.go_to_login_page()

        from providers.invalid_usernames import InvalidUsernames
        p = InvalidUsernames()
        data = p.get_random_user()
        l.username = data['username']
        l.password = data['password']

        l.do_login()
        self.assertEqual(l.error_message, "Incorrect username or password.")
Exemplo n.º 9
0
    def testCreatePost(self):
        print 'testCreatePost'

        #登陆
        theLoginPage = LoginPage(self.driver,self.loginPageUrl)
        theLoginPage.login(self.username,self.passwd)

        # title 由当前时间组成,以免输入固定字符Sam、Test Content
        title = 'Sam'+time.strftime("%Y-%m-%d %H:%M:%S")

        #创建 新文章
        createPostPage = PostFormPage(self.driver)
        createPostPage.createPost(title)

        #进入首页,进行断言
        theHomePage = HomePage(self.driver)
        self.assertEqual(title,theHomePage.getfirstPostLink().text)
Exemplo n.º 10
0
 def test_create_new_experience(self):
     """
     Create a new experience "from scratch", i.e. not from a "me too!" button
     """
     h = HomePage()
     h.open_default_url()