def test_login_correct_creds(self, browser): login_page = LoginPage(browser) main_page = MainPage(browser) with allure.step("Open login page"): login_page.open() with allure.step("Check that login page opened"): assert login_page.at_page() with allure.step("Login to JIRA with correct credentials"): login_page.login(login, password) allure.attach(browser.get_screenshot_as_png(), name="login_correct_creds1", attachment_type=allure.attachment_type.PNG) with allure.step("Check that main page opened"): assert main_page.at_page() allure.attach(browser.get_screenshot_as_png(), name="test_login_correct_creds2", attachment_type=allure.attachment_type.PNG) with allure.step("Logout from JIRA"): logout_page = main_page.logout() with allure.step("Cheсk that logout page appears"): assert logout_page.at_page() with allure.step("Open login page"): login_page.open() with allure.step("Check that login page opened"): assert login_page.at_page() allure.attach(browser.get_screenshot_as_png(), name="test_logout", attachment_type=allure.attachment_type.PNG)
def test_create_issue_empty_summary(self, browser): summary = "" issue_type = "Bug" main_page = MainPage(browser) with allure.step("Open new issue dialog"): new_issue_page = main_page.open_create_issue_page() with allure.step("Check that new issue dialog is opened"): assert new_issue_page.at_page() with allure.step("Call create issue method"): new_issue_page.create_issue(self.project_name, issue_type, summary) with allure.step("Check that correct error message is displayed"): assert new_issue_page.error_text( "You must specify a summary of the issue") allure.attach(browser.get_screenshot_as_png(), name="empty_summary_test", attachment_type=allure.attachment_type.PNG) with allure.step("Cancel new issue dialog"): new_issue_page.cancel_issue() with allure.step("Check that user is returned to main page"): assert main_page.at_page()
def test_create_issue_unsupported_summary(self, browser): summary = "Maxim " * 50 main_page = MainPage(browser) with allure.step("Open new issue dialog"): new_issue_page = main_page.open_create_issue_page() with allure.step("Check that new issue dialog is opened"): assert new_issue_page.at_page() with allure.step("Call type summary method"): new_issue_page.type_summary(summary) with allure.step("Call submit issue method"): new_issue_page.submit_issue() with allure.step("Check that correct error message is displayed"): assert new_issue_page.error_text( "Summary must be less than 255 characters") allure.attach(browser.get_screenshot_as_png(), name="summary_longer_than_supported", attachment_type=allure.attachment_type.PNG) with allure.step("Cancel new issue dialog"): new_issue_page.cancel_issue() with allure.step("Check that user is returned to main page"): assert main_page.at_page()