from unittest import TestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys


class LogInTest(TestCase):

    def setUp(self):
        self.driver = webdriver.Chrome('chromedriver.exe')
        self.driver.get('http://127.0.0.1:5000/sign_in')
        self.username = self.driver.find_element_by_id('l_username')
        self.password = self.driver.find_element_by_id('l_password')
        self.submit = self.driver.find_element_by_id('l_submit')

    def test_correct_login(self):
        self.username.send_keys('TestUser')
        self.password.send_keys('superhemligt')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Min sida', self.driver.page_source)

    def test_wrong_password_login(self):
        self.username.send_keys('TestUser')
        self.password.send_keys('superhemlis')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def test_wrong_username_login(self):
        self.username.send_keys('TestTest')
        self.password.send_keys('superhemligt')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def test_wrong_username_and_password_login(self):
        self.username.send_keys('TestTest')
        self.password.send_keys('superhemlis')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def tearDown(self):
        self.driver.close()

798861de09a8ce393c935a348453d7ec0a072106
<mask token>


class LogInTest(TestCase):
    <mask token>

    def test_correct_login(self):
        self.username.send_keys('TestUser')
        self.password.send_keys('superhemligt')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Min sida', self.driver.page_source)
    <mask token>

    def test_wrong_username_login(self):
        self.username.send_keys('TestTest')
        self.password.send_keys('superhemligt')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def test_wrong_username_and_password_login(self):
        self.username.send_keys('TestTest')
        self.password.send_keys('superhemlis')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)
    <mask token>

<mask token>


class LogInTest(TestCase):
    <mask token>

    def test_correct_login(self):
        self.username.send_keys('TestUser')
        self.password.send_keys('superhemligt')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Min sida', self.driver.page_source)
    <mask token>

    def test_wrong_username_login(self):
        self.username.send_keys('TestTest')
        self.password.send_keys('superhemligt')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def test_wrong_username_and_password_login(self):
        self.username.send_keys('TestTest')
        self.password.send_keys('superhemlis')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def tearDown(self):
        self.driver.close()

<mask token>


class LogInTest(TestCase):

    def setUp(self):
        self.driver = webdriver.Chrome('chromedriver.exe')
        self.driver.get('http://127.0.0.1:5000/sign_in')
        self.username = self.driver.find_element_by_id('l_username')
        self.password = self.driver.find_element_by_id('l_password')
        self.submit = self.driver.find_element_by_id('l_submit')

    def test_correct_login(self):
        self.username.send_keys('TestUser')
        self.password.send_keys('superhemligt')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Min sida', self.driver.page_source)

    def test_wrong_password_login(self):
        self.username.send_keys('TestUser')
        self.password.send_keys('superhemlis')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def test_wrong_username_login(self):
        self.username.send_keys('TestTest')
        self.password.send_keys('superhemligt')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def test_wrong_username_and_password_login(self):
        self.username.send_keys('TestTest')
        self.password.send_keys('superhemlis')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def tearDown(self):
        self.driver.close()

from unittest import TestCase
from selenium import webdriver
from selenium.webdriver.common.keys import Keys


class LogInTest(TestCase):

    def setUp(self):
        self.driver = webdriver.Chrome('chromedriver.exe')
        self.driver.get('http://127.0.0.1:5000/sign_in')
        self.username = self.driver.find_element_by_id('l_username')
        self.password = self.driver.find_element_by_id('l_password')
        self.submit = self.driver.find_element_by_id('l_submit')

    def test_correct_login(self):
        self.username.send_keys('TestUser')
        self.password.send_keys('superhemligt')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Min sida', self.driver.page_source)

    def test_wrong_password_login(self):
        self.username.send_keys('TestUser')
        self.password.send_keys('superhemlis')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def test_wrong_username_login(self):
        self.username.send_keys('TestTest')
        self.password.send_keys('superhemligt')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def test_wrong_username_and_password_login(self):
        self.username.send_keys('TestTest')
        self.password.send_keys('superhemlis')
        self.submit.send_keys(Keys.RETURN)
        self.driver.implicitly_wait(3)
        self.assertIn('Felaktigt användarnamn eller lösenord', self.driver.
            page_source)

    def tearDown(self):
        self.driver.close()
