Ejemplo n.º 1
0
 def setUp(self):
     """
     Prepare the tests :
      - Create user and set permission
     :return:
     """
     util.initTestUser()
    def test_valid_non_admin_login(self):
        """
        Test the opening of the connexion page
        :return:
        """
        self.getUrl("/")
        assert "Concurent Cooking" in self.selenium.title

        util.initTestUser()

        user_name_field = self.selenium.find_element_by_id('userId')
        user_name_field.send_keys('test_user')
        user_password_field = self.selenium.find_element_by_id('passwordId')
        user_password_field.send_keys('test_password')
        login_button = self.selenium.find_element_by_id('login_btn')
        login_button.click()
        logout_btn = self.selenium.find_element_by_id('logout_btn')
        self.assertTrue(self.is_element_present('logout_btn'))
        assert self.is_element_present('cooking_link')
        assert self.is_element_present('it_link')
        self.assertFalse(self.is_element_present('admin_link'))
        self.take_screen_shot('valid__non_admin_login')