Ejemplo n.º 1
0
 def teardown_class(self):
     for issue in self.created_issues:
         self.driver.fullscreen_window()
         self.browse_issue_page = BrowseIssuePageObject(self.driver, issue)
         self.browse_issue_page.open_page_by_url()
         self.browse_issue_page.issue_details.delete_issue()
     try:
         self.driver.close()
     except Exception as e:
         print(e)
         pass
Ejemplo n.º 2
0
 def driver(self, login_and_get_driver):
     driver = login_and_get_driver
     yield driver
     for issue in self.created_issues:
         driver.fullscreen_window()
         browse_issue_page = BrowseIssuePageObject(driver, issue)
         browse_issue_page.open_page_by_url()
         browse_issue_page.issue_details.delete_issue()
     try:
         driver.close()
     except Exception as e:
         print(e)
         pass
Ejemplo n.º 3
0
 def create_original_issue(self, original_summary):
     with allure.step("Open the dashboard page"):
         self.dashboard.open_page()
     with allure.step("Open the Create issue modal"):
         self.modal = CreateIssueModal(self.driver)
         i = 0
         while i < 3 and self.modal.is_modal_existing() is False:
             self.dashboard.header_toolbar.click_create_button()
             self.modal.wait_until_modal_is_opened(5)
             i += 1
     with allure.step("Create the new original issue"):
         self.modal.populate_fields_and_click_create(
             self.ISSUE_PROJECT, self.ISSUE_TYPE, original_summary,
             self.ISSUE_DESCRIPTION, self.ISSUE_PRIORITY)
         self.dashboard.flag.wait_until_flag_is_shown()
         new_issue_link = self.dashboard.flag.get_new_issue_data()["link"]
         self.created_issues.append(new_issue_link)
         self.modal.wait_until_modal_is_not_opened(10)
     with allure.step("Open the issue page and update it by valid values"):
         self.browse_issue_page = BrowseIssuePageObject(
             self.driver, new_issue_link)
         self.browse_issue_page.open_page_by_url()
Ejemplo n.º 4
0
class TestCreateIssue:
    created_issues = []

    def setup_class(self):
        self.driver = webdriver.Chrome(
            executable_path=ChromeDriverManager().install())
        self.login = LoginPageObject(self.driver)
        self.login.enter_site_as_test_user()
        self.dashboard = DashboardPageObject(self.driver)

    def teardown_class(self):
        for issue in self.created_issues:
            self.driver.fullscreen_window()
            self.browse_issue_page = BrowseIssuePageObject(self.driver, issue)
            self.browse_issue_page.open_page_by_url()
            self.browse_issue_page.issue_details.delete_issue()
        try:
            self.driver.close()
        except Exception as e:
            print(e)
            pass

    def setup_method(self):
        self.dashboard.open_page()
        self.modal = CreateIssueModal(self.driver)
        i = 0
        while i < 3 and self.modal.is_modal_existing() is False:
            self.dashboard.header_toolbar.click_create_button()
            self.modal.wait_until_modal_is_opened(5)
            i += 1

    def teardown_method(self):
        if self.modal.is_modal_existing():
            self.modal.cancel_creation()

    @pytest.mark.flaky(reruns=2, reruns_delay=3)
    @allure.title("JIRA. Create issue - positive (no fixtures)")
    @pytest.mark.parametrize(
        "project, issue_type, summary, description, priority, error_message_expect, is_modal_closed_expect",
        [
            ("Webinar (WEBINAR)", "Bug",
             "Test summary (QA) Without Description (no fixtures)", None,
             "Medium", None, True),
            ("Webinar (WEBINAR)", "Bug",
             "Test summary (QA) With Description (no fixtures)",
             "*Test description*", "Medium", None, True),
            ("Webinar (WEBINAR)", "Bug",
             "fixtures_no_3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 12345",
             None, "Medium", None, True),
        ])
    def test_create_issue_positive(self, project, issue_type, summary,
                                   description, priority, error_message_expect,
                                   is_modal_closed_expect):
        with allure.step("Populate the issue form and submit"):
            self.modal.populate_fields_and_click_create(
                project, issue_type, summary, description, priority)
        with allure.step("Wait for successful flag and get issue data"):
            self.dashboard.flag.wait_until_flag_is_shown()
            self.created_issues.append(
                self.dashboard.flag.get_new_issue_data()["link"])
        with allure.step("Check the correct issue summary in the flag"):
            assert self.dashboard.flag.get_new_issue_data(
            )["summary"] == summary
        with allure.step("Check the issue form is closed"):
            assert self.modal.wait_until_modal_is_not_opened(
                5) == is_modal_closed_expect
        with allure.step("Check the error message existing"):
            assert self.modal.get_issue_summary_error_message(
            ) is error_message_expect

    @pytest.mark.flaky(reruns=2, reruns_delay=3)
    @allure.title("JIRA. Create issue - negative (no fixtures)")
    @pytest.mark.parametrize(
        "project, issue_type, summary, description, priority, error_message_expect, is_modal_closed_expect",
        [
            ("Webinar (WEBINAR)", "Bug", None, None, "Medium",
             "You must specify a summary of the issue.", False),
            ("Webinar (WEBINAR)", "Bug",
             "fixtures_no_3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456",
             None, "Medium", "Summary must be less than 255 characters.",
             False),
        ])
    def test_create_issue_negative(self, project, issue_type, summary,
                                   description, priority, error_message_expect,
                                   is_modal_closed_expect):
        with allure.step("Populate the issue form and submit"):
            self.modal.populate_fields_and_click_create(
                project, issue_type, summary, description, priority)
            self.modal.wait_until_modal_is_not_opened(3)
        with allure.step("Check the correct error message is shown"):
            assert self.modal.get_issue_summary_error_message(
            ) == error_message_expect
        with allure.step("Check the issue form wasn't closed"):
            assert self.modal.is_modal_existing() is not is_modal_closed_expect
Ejemplo n.º 5
0
class TestSearchIssue:
    created_issues = []
    ISSUE_PROJECT = "Webinar (WEBINAR)"
    ISSUE_TYPE = "Bug"
    ISSUE_SUMMARY = "Checking The Searching Feature With The Selenium Python"
    ISSUE_DESCRIPTION = "Description of the <Checking Searching Feature With Selenium Python AQA>"
    ISSUE_PRIORITY = "Medium"

    def setup_class(self):
        self.driver = webdriver.Chrome(
            executable_path=ChromeDriverManager().install())
        self.login = LoginPageObject(self.driver)
        self.login.enter_site_as_test_user()
        self.dashboard = DashboardPageObject(self.driver)
        self.dashboard.open_page()
        self.modal = CreateIssueModal(self.driver)
        i = 0
        while i < 3 and self.modal.is_modal_existing() is False:
            self.dashboard.header_toolbar.click_create_button()
            self.modal.wait_until_modal_is_opened(5)
            i += 1
        self.modal.populate_fields_and_click_create(self.ISSUE_PROJECT,
                                                    self.ISSUE_TYPE,
                                                    self.ISSUE_SUMMARY,
                                                    self.ISSUE_DESCRIPTION,
                                                    self.ISSUE_PRIORITY)
        self.dashboard.flag.wait_until_flag_is_shown()
        self.created_issues.append(
            self.dashboard.flag.get_new_issue_data()["link"])
        self.modal.wait_until_modal_is_not_opened(2)

    def teardown_class(self):
        for issue in self.created_issues:
            self.driver.fullscreen_window()
            self.browse_issue_page = BrowseIssuePageObject(self.driver, issue)
            self.browse_issue_page.open_page_by_url()
            self.browse_issue_page.issue_details.delete_issue()
        try:
            self.driver.close()
        except Exception as e:
            print(e)
            pass

    def setup_method(self):
        self.dashboard.open_page()

    @pytest.mark.flaky(reruns=2, reruns_delay=3)
    @allure.title("JIRA. Issue is found")
    @pytest.mark.parametrize("case_method", [None, "lower", "upper"])
    def test_search_issue(self, case_method):
        if case_method is None:
            search_string = self.ISSUE_SUMMARY
        elif case_method == "lower":
            search_string = self.ISSUE_SUMMARY.lower()
        elif case_method == "upper":
            search_string = self.ISSUE_SUMMARY.upper()
        with allure.step("Populate search field and submit"):
            self.dashboard.header_toolbar.populate_search_and_submit(
                search_string)
            self.search_page = SearchPageObject(self.driver)
            self.search_page.wait_until_page_is_opened()
        with allure.step("Check the searching item is existing in the list"):
            assert self.search_page.is_result_item_existing_by_name(
                self.ISSUE_SUMMARY) is True
        with allure.step("Check the found issue has correct summary"):
            assert self.search_page.issue.get_issue_summary(
            ) == self.ISSUE_SUMMARY

    @pytest.mark.flaky(reruns=2, reruns_delay=3)
    @allure.title("JIRA. Issue is not found (no result message is got)")
    def test_search_issue_not_found(self):
        with allure.step("Populate search field and submit"):
            self.dashboard.header_toolbar.populate_search_and_submit(
                "incorrect_search_request_should_not_be_found")
            self.search_page = SearchPageObject(self.driver)
            self.search_page.wait_until_page_is_opened()
        with allure.step("Check the no result message is shown"):
            assert self.search_page.wait_until_no_result_message_is_opened(
                3) is True
        with allure.step("Check the result list isn't opened"):
            assert self.search_page.wait_until_result_list_is_opened(
                1) is False
        with allure.step("Check the issue panel isn't opened"):
            assert self.search_page.issue.wait_until_panel_is_opened(
                1) is False
Ejemplo n.º 6
0
class TestUpdateIssue:
    created_issues = []
    ISSUE_PROJECT = "Webinar (WEBINAR)"
    ISSUE_TYPE = "Bug"
    ISSUE_SUMMARY_BASE = "Issue Should Be Updated #WDN1"
    ISSUE_DESCRIPTION = "Description of the <Issue Should Be Updated #WDN1>"
    ISSUE_PRIORITY = "Medium"

    def setup_class(self):
        with allure.step("Login, get driver and create an issue"):
            self.driver = webdriver.Chrome(
                executable_path=ChromeDriverManager().install())
            self.login = LoginPageObject(self.driver)
            self.login.enter_site_as_test_user()
            self.dashboard = DashboardPageObject(self.driver)

    def teardown_class(self):
        for issue in self.created_issues:
            self.driver.fullscreen_window()
            self.browse_issue_page = BrowseIssuePageObject(self.driver, issue)
            self.browse_issue_page.open_page_by_url()
            self.browse_issue_page.issue_details.delete_issue()
        try:
            self.driver.close()
        except Exception as e:
            print(e)
            pass

    def create_original_issue(self, original_summary):
        with allure.step("Open the dashboard page"):
            self.dashboard.open_page()
        with allure.step("Open the Create issue modal"):
            self.modal = CreateIssueModal(self.driver)
            i = 0
            while i < 3 and self.modal.is_modal_existing() is False:
                self.dashboard.header_toolbar.click_create_button()
                self.modal.wait_until_modal_is_opened(5)
                i += 1
        with allure.step("Create the new original issue"):
            self.modal.populate_fields_and_click_create(
                self.ISSUE_PROJECT, self.ISSUE_TYPE, original_summary,
                self.ISSUE_DESCRIPTION, self.ISSUE_PRIORITY)
            self.dashboard.flag.wait_until_flag_is_shown()
            new_issue_link = self.dashboard.flag.get_new_issue_data()["link"]
            self.created_issues.append(new_issue_link)
            self.modal.wait_until_modal_is_not_opened(10)
        with allure.step("Open the issue page and update it by valid values"):
            self.browse_issue_page = BrowseIssuePageObject(
                self.driver, new_issue_link)
            self.browse_issue_page.open_page_by_url()

    @pytest.mark.flaky(reruns=2, reruns_delay=3)
    @allure.title("JIRA. Issue summary is updated")
    def test_update_issue_summary(self):
        with allure.step("Create original issue"):
            original_summary = self.ISSUE_SUMMARY_BASE + " (update summary)"
            self.create_original_issue(original_summary)
        with allure.step("Update issue"):
            issue_summary_new = "Issue That Has Been Updated #WDN1"
            self.browse_issue_page.issue_details.update_summary(
                issue_summary_new)
        with allure.step("Check update"):
            assert self.browse_issue_page.issue_details.get_issue_summary(
            ) == issue_summary_new

    @pytest.mark.flaky(reruns=2, reruns_delay=3)
    @allure.title("JIRA. Issue priority is updated")
    def test_update_issue_priority(self):
        with allure.step("Create original issue"):
            original_summary = self.ISSUE_SUMMARY_BASE + " (update priority)"
            self.create_original_issue(original_summary)
        with allure.step("Update issue"):
            issue_priority_new = "Highest"
            self.browse_issue_page.issue_details.select_priority(
                issue_priority_new)
        with allure.step("Check update"):
            assert self.browse_issue_page.issue_details.get_issue_priority(
            ) == issue_priority_new

    @pytest.mark.flaky(reruns=2, reruns_delay=3)
    @allure.title("JIRA. Issue assignee is updated")
    def test_update_issue_assignee(self):
        with allure.step("Create original issue"):
            original_summary = self.ISSUE_SUMMARY_BASE + " (update assignee)"
            self.create_original_issue(original_summary)
        with allure.step("Update issue"):
            issue_assignee_new = self.browse_issue_page.issue_details.USER_LOGIN
            self.browse_issue_page.issue_details.select_assignee(
                issue_assignee_new)
        with allure.step("Check update"):
            assert self.browse_issue_page.issue_details.get_issue_assignee(
            ) == issue_assignee_new

    @pytest.mark.flaky(reruns=2, reruns_delay=3)
    @allure.title(
        "JIRA. Issue summary is not updated if inputted string is longer than 256 char"
    )
    def test_update_issue_summary_256(self):
        with allure.step("Create original issue"):
            original_summary = self.ISSUE_SUMMARY_BASE + " (update summary by 256 chars name)"
            self.create_original_issue(original_summary)
        with allure.step("Replace name by empty value"):
            issue_summary_new = "123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789 123456"
            self.browse_issue_page.issue_details.update_summary(
                issue_summary_new)
        with allure.step("Get error message and cancel updates"):
            error_message = self.browse_issue_page.issue_details.get_issue_summary_error(
            )
            self.browse_issue_page.issue_details.click_summary_cancel()
        with allure.step("Check the original summary value wasn't changed"):
            assert self.browse_issue_page.issue_details.get_issue_summary(
            ) == original_summary
        with allure.step("Check the proper error message is shown"):
            assert error_message == "Summary must be less than 255 characters."

    @pytest.mark.flaky(reruns=2, reruns_delay=3)
    @allure.title(
        "JIRA. Issue summary is not updated if new value is empty string")
    def test_update_issue_summary_empty(self):
        with allure.step("Create original issue"):
            original_summary = self.ISSUE_SUMMARY_BASE + " (update summary by empty value)"
            self.create_original_issue(original_summary)
        with allure.step("Replace name by empty value"):
            self.browse_issue_page.issue_details.update_summary("", True)
        with allure.step("Get error message and cancel updates"):
            error_message = self.browse_issue_page.issue_details.get_issue_summary_error(
            )
            self.browse_issue_page.issue_details.click_summary_cancel()
        with allure.step("Check the original summary value wasn't changed"):
            assert self.browse_issue_page.issue_details.get_issue_summary(
            ) == original_summary
        with allure.step("Check the proper error message is shown"):
            assert error_message == "You must specify a summary of the issue."