예제 #1
0
class Test03(BaseTestClass):

    def setUp(self):
        self.init_driver()
        self.driver.get('https://demo.applitools.com/hackathon.html')
        self.login_page = LoginPage(self.driver)
        self.login_page.login('seba', 'seba')
        self.home_page = HomePage(self.driver)

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

    def test_valid_amount_order_after_sort(self):
        original_table = self.home_page.get_transactions_table()
        amount_original = self.home_page.get_amount_order(original_table)
        amount_original.sort()
        self.home_page.click_amount_header()
        new_table = self.home_page.get_transactions_table()
        amount_new = self.home_page.get_amount_order(new_table)
        valid_amount_order = self.home_page.validate_amount_order(amount_original, amount_new)
        self.assertTrue(valid_amount_order)

    def test_valid_data_after_sort(self):
        original_table = self.home_page.get_transactions_table()
        self.home_page.click_amount_header()
        new_table = self.home_page.get_transactions_table()
        valid_data = self.home_page.validate_table_data(original_table, new_table)
        self.assertTrue(valid_data)
예제 #2
0
class Test03(BaseTestClass):
    def setUp(self):
        self.init_driver()
        self.driver.get('https://demo.applitools.com/hackathonV2.html')
        self.login_page = LoginPage(self.driver)
        self.login_page.login('seba', 'seba')
        self.home_page = HomePage(self.driver)

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

    #Issue: AMount order is not the correct
    def test_valid_amount_order_after_sort(self):
        original_table = self.home_page.get_transactions_table()
        amount_original = self.home_page.get_amount_order(original_table)
        amount_original.sort()
        self.home_page.click_amount_header()
        new_table = self.home_page.get_transactions_table()
        amount_new = self.home_page.get_amount_order(new_table)
        valid_amount_order = self.home_page.validate_amount_order(
            amount_original, amount_new)
        self.assertTrue(
            valid_amount_order,
            'Amount has not the correct order. Actual Order is: ' +
            str(amount_new) + 'and Expected Order is:' + str(amount_original))

    def test_valid_data_after_sort(self):
        original_table = self.home_page.get_transactions_table()
        self.home_page.click_amount_header()
        new_table = self.home_page.get_transactions_table()
        valid_data = self.home_page.validate_table_data(
            original_table, new_table)
        self.assertTrue(valid_data)
예제 #3
0
 def test_05_dynamic_add(self):
     self.driver.get('https://demo.applitools.com/hackathonV2.html?showAd=true')
     login_page = LoginPage(self.driver)
     login_page.login('seba', 'seba')
     self.eyes.open(self.driver, "Hackathon app", "Test 05: Dynamic content validation",
                         {'width': 800, 'height': 600})
     self.eyes.check_window()
     self.eyes.close()
 def setUp(self):
     self.generate_original_charts()
     self.init_driver()
     self.driver.get('https://demo.applitools.com/hackathon.html')
     login_page = LoginPage(self.driver)
     login_page.login('seba', 'seba')
     home_page = HomePage(self.driver)
     home_page.click_compare_expenses()
     self.chartPage = ChartPage(self.driver)
예제 #5
0
 def test_03_sort_order_and_data(self):
     login_page = LoginPage(self.driver)
     login_page.login('seba', 'seba')
     dr = self.eyes.open(self.driver, "Hackathon app", "Test 03: Table Sorting validation",
                         {'width': 800, 'height': 600})
     home_page = HomePage(dr)
     home_page.click_amount_header()
     home_page.scroll_down_to_chart()
     self.eyes.check_window()
     self.eyes.close()
예제 #6
0
 def test_04_chart_validation(self):
     login_page = LoginPage(self.driver)
     login_page.login('seba', 'seba')
     home_page = HomePage(self.driver)
     home_page.click_compare_expenses()
     dr = self.eyes.open(self.driver, "Hackathon app", "Test 04: Chart validation",
                         {'width': 800, 'height': 600})
     chart_page = ChartPage(dr)
     self.eyes.check_window()
     chart_page.click_show_next_year_button()
     self.eyes.check_window()
     self.eyes.close()
예제 #7
0
class Test05(BaseTestClass):
    def setUp(self):
        self.init_driver()
        self.driver.get(
            'https://demo.applitools.com/hackathon.html?showAd=true')
        self.login_page = LoginPage(self.driver)
        self.login_page.login('seba', 'seba')

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

    def test_dynamic_add(self):
        home_page = HomePage(self.driver)
        flash_sale_present = home_page.flash_sale_is_present()
        flash_sale2_present = home_page.flash_sale2_is_present()
        self.assertIsNotNone(flash_sale_present)
        self.assertIsNotNone(flash_sale2_present)
class Test05(unittest.TestCase):

    def setUp(self):
        self.driver = webdriver.Chrome('./chromedriver')
        self.driver.get('https://demo.applitools.com/hackathonV2.html?showAd=true')
        self.login_page = LoginPage(self.driver)
        self.login_page.login('seba', 'seba')

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

    #Issue: Flash sale img is not showed
    def test_dynamic_add(self):
        home_page = HomePage(self.driver)
        flash_sale_present = home_page.flash_sale_is_present()
        flash_sale2_present = home_page.flash_sale2_is_present()
        self.assertIsNotNone(flash_sale2_present)
        self.assertIsNotNone(flash_sale_present, 'Issue: Flash sale img is not showed')
예제 #9
0
 def test_02_login_errors(self, username, password):
     self.setUp()
     dr = self.eyes.open(self.driver, "Hackathon app",
                         "Test 02: user={} and password={}".format(username, password),
                         {'width': 800, 'height': 600})
     dr.get(self._url)
     login_page = LoginPage(dr)
     login_page.set_username(username)
     login_page.set_password(password)
     login_page.click_login_button()
     self.eyes.check_window()
     self.eyes.check_region(Region(left=170, top=280, width=350, height=100))
     self.eyes.close_async()
예제 #10
0
class Test01(BaseTestClass):

    def setUp(self):
        self.init_driver()
        self.driver.get('https://demo.applitools.com/hackathonV2.html')
        self.login_page = LoginPage(self.driver)

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

    def test_logo_big_img_is_present(self):
        element = self.login_page.logo_big_img_is_present()
        self.assertIsNotNone(element)

    #Issue: AssertionError: 'Logout Form' != 'Login Form'
    def test_title_is_login_form(self):
        title = self.login_page.get_title('Login Form')
        self.assertIsNotNone(title)
        self.assertEqual('Login Form', title, 'Issue: Actual:Logout Form. Expected: Login Form')

    def test_username_label_is_present(self):
        username = self.login_page.username_label_is_present()
        self.assertIsNotNone(username)
        self.assertEqual('Username', username)

    def test_username_box_is_present(self):
        element = self.login_page.get_username_box()
        self.assertIsNotNone(element)

    #Issue: username image is not present
    def test_username_img_is_present(self):
        element = self.login_page.username_img_is_present()
        self.assertIsNotNone(element, 'Issue: username image is not present')

    #Issue: Password != Pwd
    def test_password_label_is_present(self):
        password = self.login_page.password_label_is_present()
        self.assertIsNotNone(password)
        self.assertEqual('Password', password, 'Issue: Password != Pwd')

    def test_password_box_is_present(self):
        element = self.login_page.get_password_box()
        self.assertIsNotNone(element)

    #Issue: password img is not present
    def test_password_img_is_present(self):
        element = self.login_page.password_img_is_present()
        self.assertIsNotNone(element, 'Issue: password img is not present')

    def test_get_login_button(self):
        element = self.login_page.get_login_button()
        self.assertIsNotNone(element)

    def test_remember_me_button_is_clickable(self):
        element = self.login_page.remember_me_button_is_clickable()
        self.assertIsNotNone(element)

    def test_get_remember_me_label_text(self):
        remember_me = self.login_page.get_remember_me_label_text()
        self.assertEqual('Remember Me', remember_me.text)

    #Missing Linkedin Media img
    def test_count_social_media_imgs(self):
        count = self.login_page.count_social_media_imgs_v2()
        self.assertEqual(3, count, 'Missing Linkedin Media img')
예제 #11
0
class Test02(BaseTestClass):
    def setUp(self):
        self.init_driver()
        self.driver.get('https://demo.applitools.com/hackathonV2.html')
        self.login_page = LoginPage(self.driver)

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

    #Updated: Please enter both username and password
    def test_no_pass_no_username(self):
        self.login_page.click_login_button()
        warning_msg = self.login_page.get_warning_msg()
        self.assertIsNotNone(warning_msg)
        self.assertEqual('Please enter both username and password',
                         warning_msg)

    #Issue: No warning message showed
    def test_no_pass_yes_username(self):
        self.login_page.set_username('seba arbildi')
        self.login_page.click_login_button()
        warning_msg = self.login_page.get_warning_msg()
        self.assertIsNotNone(warning_msg)
        self.assertEqual('Password must be present', warning_msg,
                         'Issue: No warning message showed')

    def test_yes_pass_no_username(self):
        self.login_page.set_password('seba arbildi')
        self.login_page.click_login_button()
        warning_msg = self.login_page.get_warning_msg()
        self.assertEqual('Username must be present', warning_msg)

    def test_valid_pass_valid_username(self):
        self.login_page.set_username('seba arbildi')
        self.login_page.set_password('seba arbildi')
        self.login_page.click_login_button()
        home_page = HomePage(self.driver)
        self.assertTrue(home_page.user_is_logged_in())
 def setUp(self):
     self.driver = webdriver.Chrome('./chromedriver')
     self.driver.get('https://demo.applitools.com/hackathonV2.html?showAd=true')
     self.login_page = LoginPage(self.driver)
     self.login_page.login('seba', 'seba')
 def setUp(self):
     self.init_driver()
     self.driver.get('https://demo.applitools.com/hackathon.html')
     self.login_page = LoginPage(self.driver)
class Test01(BaseTestClass):

    def setUp(self):
        self.init_driver()
        self.driver.get('https://demo.applitools.com/hackathon.html')
        self.login_page = LoginPage(self.driver)

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

    def test_logo_big_img_is_present(self):
        element = self.login_page.logo_big_img_is_present()
        self.assertIsNotNone(element)

    def test_title_is_login_form(self):
        title = self.login_page.get_title('Login Form')
        self.assertIsNotNone(title)
        self.assertEqual('Login Form', title)

    def test_username_label_is_present(self):
        username = self.login_page.username_label_is_present()
        self.assertIsNotNone(username)
        self.assertEqual('Username', username)

    def test_username_box_is_present(self):
        element = self.login_page.get_username_box()
        self.assertIsNotNone(element)

    def test_username_img_is_present(self):
        element = self.login_page.username_img_is_present()
        self.assertIsNotNone(element)

    def test_password_label_is_present(self):
        password = self.login_page.password_label_is_present()
        self.assertIsNotNone(password)
        self.assertEqual('Password', password)

    def test_password_box_is_present(self):
        element = self.login_page.get_password_box()
        self.assertIsNotNone(element)

    def test_password_img_is_present(self):
        element = self.login_page.password_img_is_present()
        self.assertIsNotNone(element)

    def test_get_login_button(self):
        element = self.login_page.get_login_button()
        self.assertIsNotNone(element)

    def test_remember_me_button_is_clickable(self):
        element = self.login_page.remember_me_button_is_clickable()
        self.assertIsNotNone(element)

    def test_get_remember_me_label_text(self):
        remember_me = self.login_page.get_remember_me_label_text()
        self.assertEqual('Remember Me', remember_me.text)

    def test_count_social_media_imgs(self):
        count = self.login_page.count_social_media_imgs_v1()
        self.assertEqual(3, count)
예제 #15
0
 def setUp(self):
     self.init_driver()
     self.driver.get(
         'https://demo.applitools.com/hackathon.html?showAd=true')
     self.login_page = LoginPage(self.driver)
     self.login_page.login('seba', 'seba')
예제 #16
0
 def setUp(self):
     self.init_driver()
     self.driver.get('https://demo.applitools.com/hackathonV2.html')
     self.login_page = LoginPage(self.driver)
     self.login_page.login('seba', 'seba')
     self.home_page = HomePage(self.driver)
class Test02(BaseTestClass):
    def setUp(self):
        self.init_driver()
        self.driver.get('https://demo.applitools.com/hackathon.html')
        self.login_page = LoginPage(self.driver)

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

    user_password_data = lambda: (
        ('', 'p', 'Username must be present'),
        ('u', '', 'Password must be present'),
        ('', '', 'Both Username and Password must be present'))

    def test_no_pass_no_username(self):
        self.login_page.click_login_button()
        warning_msg = self.login_page.get_warning_msg()
        self.assertEqual('Both Username and Password must be present',
                         warning_msg)

    def test_no_pass_yes_username(self):
        self.login_page.set_username('seba arbildi')
        self.login_page.click_login_button()
        warning_msg = self.login_page.get_warning_msg()
        self.assertEqual('Password must be present', warning_msg)

    def test_yes_pass_no_username(self):
        self.login_page.set_password('seba arbildi')
        self.login_page.click_login_button()
        warning_msg = self.login_page.get_warning_msg()
        self.assertEqual('Username must be present', warning_msg)

    def test_valid_pass_valid_username(self):
        self.login_page.set_username('seba arbildi')
        self.login_page.set_password('seba arbildi')
        self.login_page.click_login_button()
        home_page = HomePage(self.driver)
        self.assertIsNotNone(home_page.user_is_logged_in())