コード例 #1
0
    def verify_footer_contact_us_item(self):
        allure.dynamic.severity(allure.severity_level.MINOR)

        # Contact Us
        step_definition(
            self,
            expected=self.config.base_url +
            BasePageContent.FOOTER['footer menu']['contact us']['href'],
            actual=self.page.footer_contact_us_formated_href,
            act=None,
            step_description="Test 'Footer' items > 'Contact Us' > href")
        '''
		with allure.step("Test 'Footer' items > 'Contact Us' > href"):
			self.assertEqual(BasePageContent.FOOTER['footer menu']['contact us']['href'],
			                 self.page.footer_contact_us_formated_href)
		'''

        step_definition(
            self,
            expected=BasePageContent.FOOTER['footer menu']['contact us']
            ['text'],
            actual=self.page.footer_contact_us_text,
            act=None,
            step_description="Test 'Footer' items > 'Contact Us' > text")
        '''
コード例 #2
0
    def verify_ssn_error(self,
                         expected=RegisterPageContent.FORM['ssn']['error']):

        step_definition(self,
                        expected=expected,
                        actual=self.page.ssn_error,
                        step_description='Verify SSN Error')
コード例 #3
0
    def verify_footer_home_item(self):

        allure.dynamic.severity(allure.severity_level.MINOR)

        # 'Home' > href
        step_definition(self,
                        expected=self.config.base_url +
                        BasePageContent.FOOTER['footer menu']['home']['href'],
                        actual=self.page.footer_home_formated_href,
                        act=None,
                        step_description="Test 'Footer' items > 'Home' > href")
        '''
		with allure.step("Test 'Footer' items > 'Home' > href"):
			expected = BasePageContent.FOOTER['footer menu']['home']['href']
			actual = self.page.footer_home_formated_href
			print('\nStep: {}\nExpected: {}\nActual: {}'.format('\'Home\' > href', expected, actual))
			self.assertEqual(expected, actual)
		'''

        # 'Home' > text
        step_definition(
            self,
            expected=BasePageContent.FOOTER['footer menu']['home']['text'],
            actual=self.page.footer_home_text,
            act=None,
            step_description="Test 'Footer' items > 'Home' > text")
        '''
コード例 #4
0
    def test_read_more_news_button(self):
        allure.dynamic.description("""
		Home page Content elements validation > 'Read More' (news) button:
			1. Open Home web page
			2. Do 'Read More' button verification
		""")
        allure.dynamic.title("'Read More' (news) button test")
        allure.dynamic.severity(allure.severity_level.MINOR)

        # Verify Read More News button
        with allure.step("Verify Read More News button attributes:"):

            step_definition(self,
                            step_description="Verify Read More News text",
                            expected=HomePageContent.READ_MORE_NEWS['text'],
                            actual=self.page.read_more_news_title,
                            act=None,
                            click=False)
            '''
			allure.dynamic.severity(allure.severity_level.MINOR)
			with allure.step("Verify Read More News text. Expected result: {}".format(
					HomePageContent.READ_MORE_NEWS['text'])):
				self.assertEqual(HomePageContent.READ_MORE_NEWS['text'],
				                 self.page.read_more_news_title)
			'''

            step_definition(self,
                            step_description="Verify Read More News href",
                            expected=self.config.base_url +
                            HomePageContent.READ_MORE_NEWS['href'],
                            actual=self.page.read_more_news_formated_href,
                            act=None,
                            click=False)
            '''
    def test_user_registration_no_such_user(self):
        allure.dynamic.description("""
		Forgot Login Info test case:
			1. Open 'Forgot Login Info' web page
			2. Fill out user personal data > Set all fields empty
			3. Verify that each data item (No such user) appears in relevant field
			4. Hit 'FIND MY LOGIN' button
			5. Verify 'Error' message
			6. Verify Error title
			7. Close web browser
		""")
        allure.dynamic.title(
            "User registration > Negative test > No such user")
        allure.dynamic.severity(allure.severity_level.CRITICAL)

        # Register a new user:
        self.fill_out_user_data()

        with allure.step('Hit "FIND MY LOGIN INFO" button'):
            print('Hit "FIND MY LOGIN INFO" button')
            self.page = self.page.hit_find_info_btn()

        step_definition(self,
                        step_description="Verify Error title",
                        expected=ForgotLoginInfoPageContent.ERROR_TITLE,
                        actual=self.page.error_title,
                        act=None,
                        click=False)

        step_definition(self,
                        step_description="Verify Error message",
                        expected=ForgotLoginInfoPageContent.ERROR_MESSAGE,
                        actual=self.page.error_message,
                        act=None,
                        click=False)
コード例 #6
0
    def verify_right_menu_contact_button(self):
        allure.dynamic.severity(allure.severity_level.MINOR)

        step_definition(
            self,
            expected=self.config.base_url +
            BasePageContent.MENU_BUTTONS['contact']['href'],
            actual=self.page.contact_button_formated_href,
            act=None,
            step_description=
            'Do "Contact" button verification > verify button href')
        '''
		with allure.step('Do "Contact" button verification > verify button href. Expected: {}.'.format(
				BasePageContent.MENU_BUTTONS['contact']['href'])):
			self.assertEqual(BasePageContent.MENU_BUTTONS['contact']['href'],
			                 self.page.contact_button_formated_href)
		'''

        step_definition(
            self,
            expected=BasePageContent.MENU_BUTTONS['contact']['text'],
            actual=self.page.contact_button_text,
            act=None,
            step_description=
            'Do "Contact" button verification > verify button label')
        '''
コード例 #7
0
    def verify_city_error(self,
                          expected=RegisterPageContent.FORM['city']['error']):

        # actual = self.page.city_error
        step_definition(self,
                        expected=expected,
                        actual=self.page.city_error,
                        step_description='Verify City Error')
コード例 #8
0
    def test_user_registration(self):
        allure.dynamic.description("""
		User registration test case:
			1. Open 'Register' web page
			2. Fill out user personal data > Set all fields empty
			3. Verify that each data item (empty string) appears in relevant field
			4. Hit 'Register' button
			5. Verify 'Error' messages
			6. Verify that "Account Services" menu is not present
			7. Close web browser
		""")
        allure.dynamic.title(
            "User registration > Negative test > Empty fields")
        allure.dynamic.severity(allure.severity_level.CRITICAL)

        # Register a new user:
        self.fill_out_user_data()
        '''
		step_definition(self,
		                step_description='Hit "Register" button',
		                expected=True,
		                actual=True,
		                act=self.page.hit_register_btn,
		                click=True)
		'''
        with allure.step('Hit "Register" button'):
            print('Hit "Register" button')
            self.page = self.page.hit_register_btn()

        step_definition(self,
                        step_description=
                        'Verify that "Account Services" menu is not present',
                        expected=False,
                        actual=self.page.account_services_menu_is_visible,
                        act=None,
                        click=False)
        '''
		with allure.step('Verify that "Account Services" menu is not present'):
			expected = False
			actual = self.page.account_services_menu_is_visible
			print('\nStep: {}\nExpected: {}\nActual: {}'.format('"Account Services" menu is not present',
			                                                    expected,
			                                                    actual))
		'''

        self.verify_first_name_error()

        self.verify_last_name_error()

        self.verify_address_error()

        self.verify_city_error()

        self.verify_state_error()

        self.verify_zip_code_error()

        self.verify_ssn_error()
コード例 #9
0
    def verify_zip_code_error(self,
                              expected=RegisterPageContent.FORM['zip code']
                              ['error']):

        # actual = self.page.zip_code_error
        step_definition(self,
                        expected=expected,
                        actual=self.page.zip_code_error,
                        step_description='Verify Zip Code Error')
コード例 #10
0
    def verify_last_name_error(self,
                               expected=RegisterPageContent.FORM['last name']
                               ['error']):

        # actual = self.page.last_name_error
        step_definition(self,
                        expected=expected,
                        actual=self.page.last_name_error,
                        step_description='Verify Last Name Error')
コード例 #11
0
    def verify_confirm_error(self):

        step_definition(self,
                        expected=RegisterPageContent.FORM['confirm']['error'],
                        actual=self.page.confirm_error,
                        act=None,
                        step_description='Verify Confirm Error',
                        click=False)
        '''
コード例 #12
0
    def verify_password_error(self):

        step_definition(self,
                        expected=RegisterPageContent.FORM['password']['error'],
                        actual=self.page.password_error,
                        act=None,
                        step_description='Verify Password Error',
                        click=False)
        '''
コード例 #13
0
    def verify_username_error(self):

        step_definition(self,
                        expected=RegisterPageContent.FORM['username']['error'],
                        actual=self.page.username_error,
                        act=None,
                        step_description='Verify Username Error',
                        click=False)
        '''
コード例 #14
0
    def verify_state_error(self,
                           expected=RegisterPageContent.FORM['state']['error']
                           ):

        # actual = self.page.state_error
        step_definition(self,
                        expected=expected,
                        actual=self.page.state_error,
                        step_description='Verify State Error')
コード例 #15
0
    def verify_address_error(self,
                             expected=RegisterPageContent.FORM['address']
                             ['error']):

        # actual = self.page.address_error
        step_definition(self,
                        expected=expected,
                        actual=self.page.address_error,
                        step_description='Verify Address Error')
コード例 #16
0
    def test_page_url(self):
        allure.dynamic.description("""
		Content base elements validation > Services page URL:
			1. Open Services web page
			2. Do URL verification
		""")
        allure.dynamic.title("Web page URL test")
        allure.dynamic.severity(allure.severity_level.BLOCKER)

        # Verify web page url
        step_definition(self,
                        expected=self.config.base_url +
                        ServicesPageContent.URL,
                        actual=self.page.url,
                        step_description='Verify "Services" web page URL')
コード例 #17
0
	def test_page_url(self):
		allure.dynamic.description("""
		Content base elements validation > Admin page URL:
			1. Open Admin web page
			2. Do URL verification
		""")
		allure.dynamic.title("Web page URL test")
		allure.dynamic.severity(allure.severity_level.CRITICAL)

		# verify web page url
		step_definition(self,
		                expected=self.config.base_url + AdminPageContent.URL,
		                actual=self.page.url,
		                act=None,
		                step_description='Admin page URL test')
		'''
コード例 #18
0
	def test_description_title_text(self):
		allure.dynamic.description("""
		Content base elements validation > About page > description title:
			1. Open About web page
			2. Do Description Title verification
		""")
		allure.dynamic.title("Web page description title test")
		allure.dynamic.severity(allure.severity_level.MINOR)

		# verify description title text
		step_definition(self,
		                step_description="Description header test",
		                expected=AboutPageContent.DESCRIPTION['title'],
		                actual=self.page.description_title,
		                act=None,
		                click=False)
コード例 #19
0
	def test_page_title(self):
		allure.dynamic.description("""
		Content base elements validation > About page title:
			1. Open About web page
			2. Do Title verification
		""")
		allure.dynamic.title("Web page title test")
		allure.dynamic.severity(allure.severity_level.MINOR)

		# Verify Web Page Title
		step_definition(self,
		                step_description="About Web Page Title test",
		                expected=AboutPageContent.TITLE,
		                actual=self.page.title,
		                act=None,
		                click=False)
コード例 #20
0
	def test_page_title(self):
		allure.dynamic.description("""
		Content base elements validation > Admin page URL:
			1. Open Admin web page
			2. Do Title verification
		""")
		allure.dynamic.title("Web page Title test")
		allure.dynamic.severity(allure.severity_level.MINOR)

		# verify web page url
		step_definition(self,
		                expected=AdminPageContent.TITLE,
		                actual=self.page.title,
		                act=None,
		                step_description="Admin page title test")
		'''
コード例 #21
0
	def test_page_url(self):
		allure.dynamic.description("""
		Content base elements validation > About page URL:
			1. Open About web page
			2. Do URL verification
		""")
		allure.dynamic.title("Web page URL test")
		allure.dynamic.severity(allure.severity_level.CRITICAL)

		# Verify Web Page URL
		step_definition(self,
		                step_description="About Web Page URL test",
		                expected=self.config.base_url + AboutPageContent.URL,
		                actual=self.page.url,
		                act=None,
		                click=False)
コード例 #22
0
    def test_latest_news_title(self):
        allure.dynamic.description("""
		Home page Content elements validation > 'Latest News' title:
			1. Open Home web page
			2. Do 'Latest News' title verification
		""")
        allure.dynamic.title("'Latest News' title test")
        allure.dynamic.severity(allure.severity_level.MINOR)

        # Verify Last News title
        step_definition(self,
                        step_description="Verify Latest News title",
                        expected=HomePageContent.LATEST_NEWS,
                        actual=self.page.latest_news_title,
                        act=None,
                        click=False)
        '''
コード例 #23
0
    def test_page_title(self):
        allure.dynamic.description("""
		Content base elements validation > Register page title:
			1. Open Register page web page
			2. Do Register page title verification
		""")
        allure.dynamic.title("Register page title test")
        allure.dynamic.severity(allure.severity_level.MINOR)

        # Verify web page title
        step_definition(self,
                        step_description='Verify "Register" web page title',
                        expected=RegisterPageContent.TITLE,
                        actual=self.page.title,
                        act=None,
                        click=False)
        '''
コード例 #24
0
    def test_confirm_title(self):
        allure.dynamic.description("""
		Content base elements validation > Register Form:
			1. Open Register web page
			2. Do Confirm title verification
		""")
        allure.dynamic.title("Confirm title test")
        allure.dynamic.severity(allure.severity_level.NORMAL)

        # Register web page elements validation:
        step_definition(self,
                        step_description='Verify "Confirm" title',
                        expected=RegisterPageContent.FORM['confirm']['title'],
                        actual=self.page.confirm_title,
                        act=None,
                        click=False)
        '''
コード例 #25
0
    def test_page_url(self):

        allure.dynamic.description("""
		Content base elements validation > Home page URL:
			1. Open Home web page
			2. Do URL verification
		""")
        allure.dynamic.title("Web page URL test")
        allure.dynamic.severity(allure.severity_level.BLOCKER)

        # test url
        step_definition(self,
                        step_description="Verify web page URL",
                        expected=self.config.base_url + HomePageContent.URL,
                        actual=self.page.url,
                        act=None,
                        click=False)
        '''
コード例 #26
0
    def test_page_url(self):
        allure.dynamic.description("""
		ontext base elements validation > Register page URL:
			1. Open Register page web page
			2. Do URL verification
		""")
        allure.dynamic.title("Web page URL test")
        allure.dynamic.severity(allure.severity_level.CRITICAL)

        # Verify web page url
        step_definition(self,
                        step_description='Verify "Register" web page URL',
                        expected=self.config.base_url +
                        RegisterPageContent.URL,
                        actual=self.page.url,
                        act=None,
                        click=False)
        '''
コード例 #27
0
    def verify_parabank_admin_logo(self):
        allure.dynamic.severity(allure.severity_level.MINOR)

        step_definition(self,
                        expected=self.config.base_url +
                        BasePageContent.ADMIN_LOGO['href'],
                        actual=self.page.admin_logo_formated_href,
                        act=None,
                        step_description="Test 'Admin' logo > href")
        '''
		with allure.step("Test 'Admin' logo > href"):
			self.assertEqual(BasePageContent.ADMIN_LOGO['href'],
			                 self.page.admin_logo_formated_href)
		'''

        step_definition(self,
                        expected=BasePageContent.ADMIN_LOGO['class'],
                        actual=self.page.admin_logo_img_class,
                        act=None,
                        step_description="Test 'Admin' logo > class")
        '''
		with allure.step("Test 'Admin' logo > class"):
			self.assertEqual(BasePageContent.ADMIN_LOGO['class'],
			                 self.page.admin_logo_img_class)
		'''

        step_definition(self,
                        expected=self.config.base_url +
                        BasePageContent.ADMIN_LOGO['src'],
                        actual=self.page.admin_logo_formated_img_src,
                        act=None,
                        step_description="Test 'Admin' logo > src")
        '''
コード例 #28
0
    def verify_footer_copyright_item(self):
        allure.dynamic.severity(allure.severity_level.MINOR)

        # Copyright
        step_definition(
            self,
            expected=BasePageContent.FOOTER['copyright']['class'],
            actual=self.page.footer_copyright_class,
            act=None,
            step_description="Test 'Footer' items > 'Copyright' > class")
        '''
		with allure.step("Test 'Footer' items > 'Copyright' > class"):
			self.assertEqual(BasePageContent.FOOTER['copyright']['class'],
			                 self.page.footer_copyright_class)
		'''

        step_definition(
            self,
            expected=BasePageContent.FOOTER['copyright']['text'],
            actual=self.page.footer_copyright_text,
            act=None,
            step_description="Test 'Footer' items > 'Copyright' > text")
        '''
コード例 #29
0
    def verify_footer_forum_item(self):
        allure.dynamic.severity(allure.severity_level.MINOR)

        # Forum
        step_definition(
            self,
            expected=BasePageContent.FOOTER['footer menu']['forum']['href'],
            actual=self.page.footer_forum_formated_href,
            act=None,
            step_description="Test 'Footer' items > 'Forum' > href")
        '''
		with allure.step("Test 'Footer' items > 'Forum' > href"):
			self.assertEqual(BasePageContent.FOOTER['footer menu']['forum']['href'],
			                 self.page.footer_forum_formated_href)
		'''

        step_definition(
            self,
            expected=BasePageContent.FOOTER['footer menu']['forum']['text'],
            actual=self.page.footer_forum_text,
            act=None,
            step_description="Test 'Footer' items > 'Forum' > text")
        '''
コード例 #30
0
    def verify_footer_visit_item(self):
        allure.dynamic.severity(allure.severity_level.MINOR)

        # Visit
        step_definition(
            self,
            expected=BasePageContent.FOOTER['visit']['link']['href'],
            actual=self.page.footer_visit_link_formated_href,
            act=None,
            step_description="Test 'Footer' items > 'Visit' > link > href")
        '''
		with allure.step("Test 'Footer' items > 'Visit' > link > href"):
			self.assertEqual(BasePageContent.FOOTER['visit']['link']['href'],
			                 self.page.footer_visit_link_formated_href)
		'''

        step_definition(
            self,
            expected=BasePageContent.FOOTER['visit']['link']['text'],
            actual=self.page.footer_visit_link_text,
            act=None,
            step_description="Test 'Footer' items > 'Visit' > link > text")
        '''
		with allure.step("Test 'Footer' items > 'Visit' > link > text"):
			self.assertEqual(BasePageContent.FOOTER['visit']['link']['text'],
			                 self.page.footer_visit_link_text)
		'''

        step_definition(
            self,
            expected=BasePageContent.FOOTER['visit']['link']['target'],
            actual=self.page.footer_visit_link_target,
            act=None,
            step_description="Test 'Footer' items > 'Visit' > link > target")
        '''
		with allure.step("Test 'Footer' items > 'Visit' > link > target"):
			self.assertEqual(BasePageContent.FOOTER['visit']['link']['target'],
			                 self.page.footer_visit_link_target)
		'''

        step_definition(
            self,
            expected=BasePageContent.FOOTER['visit']['text'],
            actual=self.page.footer_visit_us_text,
            act=None,
            step_description="Test 'Footer' items > 'Visit' > text")
        '''