Ejemplo n.º 1
0
 def test_create_issue_ui(self, summary, expected):
     self.login_page = LoginPage(self.driver)
     self.login_page.login_procedure(user, password)
     self.issues_page = IssuesPage(self.driver)
     self.issues_page.start_create_issue()
     self.issues_page.fill_and_submit_issue(summary)
     assert self.issues_page.issue_created() == expected
Ejemplo n.º 2
0
 def test_login_success(self):
     try:
         page = LoginPage(self.driver)
         status = page.login()
         self.assertTrue(status)
         page = DashboardPage(self.driver)
         status = page.logout()
         self.assertTrue(status)
     except AssertionError as e:
         self.fail(e.with_traceback(e.__traceback__))
def log_to_main_page(driver, correct_auth_data):
    lg_page = LoginPage(driver)
    lg_page.click(lg_page.locators.ENTER_BUTTON)
    lg_page.fill_field(lg_page.locators.INPUT_LOGIN, correct_auth_data['login'])
    lg_page.fill_field(lg_page.locators.INPUT_PASSWORD, correct_auth_data['password'])
    lg_page.find(lg_page.locators.GO_TO_MAIN_PAGE_BUTTON).click()
    mn_page = MainPage(driver)
    yield mn_page
    mn_page.click(mn_page.locators.USER_BUTTON)
    time.sleep(0.5)
    mn_page.click(mn_page.locators.LOG_OUT)
Ejemplo n.º 4
0
    def test_update_issue_ui(self):
        self.login_page = LoginPage(self.driver)
        self.login_page.login_procedure(user, password)
        self.issues_page = IssuesPage(self.driver)
        self.issues_page.search_issue("Alisa UI issue-4")
        self.issues_page.click_edit_button()
        self.issues_page.update_summary("Updated by Alisa")
        self.issues_page.update_priority("Blocker")
        self.issues_page.update_assignee(user)
        self.issues_page.click_update_button()

        allure.attach(self.driver.get_screenshot_as_png(),
                      name="Updated issue",
                      attachment_type=AttachmentType.PNG)
        assert self.issues_page.search_issue("Updated by Alisa") == 1
Ejemplo n.º 5
0
    def setup(self, driver, db_connection):
        self.driver: webdriver = driver

        self.login_page: LoginPage = LoginPage(driver)
        self.registration_page: RegistrationPage = RegistrationPage(driver)
        self.welcome_page: WelcomePage = WelcomePage(driver)

        self.mysql_client = db_connection
Ejemplo n.º 6
0
class TestIssuesUi:
    @allure.title('Create issue UI test')
    @pytest.mark.parametrize("summary, expected", [
        ("create issue UI", True),
        ("", False),
        ("a" * 256, False),
    ])
    def test_create_issue_ui(self, summary, expected):
        self.login_page = LoginPage(self.driver)
        self.login_page.login_procedure(user, password)
        self.issues_page = IssuesPage(self.driver)
        self.issues_page.start_create_issue()
        self.issues_page.fill_and_submit_issue(summary)
        assert self.issues_page.issue_created() == expected

    @allure.title('Search issue UI test')
    @pytest.mark.parametrize("query, expected", [
        ("Alisa UI", 5),
        ("Alisa UI issue-1", 1),
        ("no_such_issue?", 0),
    ])
    def test_search_issues_ui(self, query, expected):
        self.login_page = LoginPage(self.driver)
        self.login_page.login_procedure(user, password)
        self.issues_page = IssuesPage(self.driver)
        assert self.issues_page.search_issue(query) == expected

    @allure.title('Update issue UI test')
    def test_update_issue_ui(self):
        self.login_page = LoginPage(self.driver)
        self.login_page.login_procedure(user, password)
        self.issues_page = IssuesPage(self.driver)
        self.issues_page.search_issue("Alisa UI issue-4")
        self.issues_page.click_edit_button()
        self.issues_page.update_summary("Updated by Alisa")
        self.issues_page.update_priority("Blocker")
        self.issues_page.update_assignee(user)
        self.issues_page.click_update_button()

        allure.attach(self.driver.get_screenshot_as_png(),
                      name="Updated issue",
                      attachment_type=AttachmentType.PNG)
        assert self.issues_page.search_issue("Updated by Alisa") == 1
Ejemplo n.º 7
0
def login_page(driver):
    return LoginPage(driver=driver)
Ejemplo n.º 8
0
 def test_search_issues_ui(self, query, expected):
     self.login_page = LoginPage(self.driver)
     self.login_page.login_procedure(user, password)
     self.issues_page = IssuesPage(self.driver)
     assert self.issues_page.search_issue(query) == expected
Ejemplo n.º 9
0
def get_login_page(request):
    request.cls.login_page = LoginPage(request.cls.driver)
def login_page_object(driver):
    return LoginPage(driver)
Ejemplo n.º 11
0
 def click_to_logout(self):
     self.click(self.locators.LOGOUT_BUTTON)
     return LoginPage(self.driver)