Пример #1
0
def test_statistics_table_scenario2(browser, login, logout):
    """Check that Statistics table contains correct information"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.run_test_btn_click()
    run_test_page = RunTestPage(browser)
    run_test_page.wait_new_page_load()
    run_test_page.set_case_status('passed')
    run_test_page.save_btn_click()
    run_test_page.back_to_suite_btn_click()
    run_test_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.click_statistics_option()
    assert cases_page.visible_element_get_text(
        locators.CasesPageLocators.STATTABLE_SUITE) == "Nadiia - Linux - 20.6.4" and \
           cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_RUN_BY) == "KYahorlytska" and \
           cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_RESULT) == "✅  Passed" and \
           cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_DURATION) <= "00:00:05" and \
           cases_page.visible_element_get_text(
               locators.CasesPageLocators.STATTABLE_DATE) == "Dec 28 2020 09:37:52"  # defect,should be changed to current date
Пример #2
0
def test_cases_background_color_scenario2(browser, login, logout):
    """"Verify that if cases row has not been clicked its background color should be whited out"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    background_color = cases_page.get_css_property(locators.CasesPageLocators.ACTIVE_N_ROW, 'background-color')
    assert background_color == "rgba(0, 0, 0, 0)"
Пример #3
0
def test_statistics_option_is_seen(browser, login, logout):
    """Check that Statistics option is visible after clicking on case"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    assert cases_page.is_element_seen(locators.CasesPageLocators.STATISTICS_BTN)
Пример #4
0
def test_run_test_option_is_seen(browser, login, logout):
    """Check that Run Test option is visible after clicking on case"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    assert cases_page.is_element_seen(locators.CasesPageLocators.RUN_TEST_BTN)
Пример #5
0
def test_cases_background_color_scenario1(browser, login, logout):
    """"Verify that if cases row is clicked its background color should be grayed out"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    background_color = cases_page.get_css_property(locators.CasesPageLocators.ACTIVE_N_ROW, 'background-color')
    assert background_color == "rgba(221, 221, 221, 1)"
Пример #6
0
def test_cases_click_on_id(browser, login, logout):
    """"Verify that if click on the ID user is redirecting to the login link in Azure"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.visible_element_click(locators.CasesPageLocators.CASE_ID_N_LNK)
    url = browser.current_url
    assert cases_page.extract_domain_from_url(url) == "login.microsoftonline.com"
Пример #7
0
def test_run_test_btn(browser, login, logout):
    """Check that Run Test option is redirecting user to the Run Page"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.run_test_btn_click()
    assert browser.current_url == "https://trunner.herokuapp.com/run/26/754"
Пример #8
0
def test_current_suite_name(browser, login, logout):
    """Check that Current suite name is visible and contains correct information.
    Expected result: Current Suite - Nadiia - Linux - 20.6.4"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    current_suite_name = cases_page.visible_element_get_text(locators.CasesPageLocators.CURRENT_SUITE_NAME)
    assert current_suite_name == "Current Suite - Nadiia - Linux - 20.6.4\n(current)"
Пример #9
0
 def open_run_test_page_for_1st_test(self, browser):
     """Function to load 'Run' page for 1st test case"""
     suites_page = SuitesPage(browser)
     suites_page.wait_new_page_load()
     suites_page.suite_1st_link_click()
     suites_page.wait_new_page_load()
     cases_page = CasesPage(browser)
     cases_page.click_first_case()
     cases_page.run_test_btn_click()
     cases_page.wait_new_page_load()
Пример #10
0
def test_stat_table_comment_scenario2(browser, login, logout):
    """Check that Statistics table contains comments with appropriate text"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_nth_case(4)
    cases_page.click_statistics_option()
    cases_page.move_mouse_on_element(locators.CasesPageLocators.STATTABLE_RESULT)
    assert cases_page.visible_element_get_text(locators.CasesPageLocators.COMMENT)
Пример #11
0
def test_statistics_table_location_and_size(browser, login, logout):
    """Check that Statistics table is opening  in the correct size and position"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.click_statistics_option()
    assert cases_page.get_element_size(locators.CasesPageLocators.STATTABLE) == {'height': 47, 'width': 339} and \
           cases_page.get_element_location(locators.CasesPageLocators.STATTABLE) == {'x': 845, 'y': 70}
Пример #12
0
def test_cases_assign_option_scenario1(browser, login, logout):
    """"Verify that if move mouse to the Assign option, list of testers is seen"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.click_mb3_first_case()
    cases_page.move_mouse_on_element(locators.CasesPageLocators.ASSIGN_OPT_LNK)
    assert cases_page.is_element_seen(locators.CasesPageLocators.ASSIGN_SUB_MENU)
Пример #13
0
def test_cases_dropdown(browser, login, logout):
    """Check that the font sizes are the same in the dropdown custom options menu"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.click_mb3_first_case()
    font_sizes = [cases_page.get_css_property(locators.CasesPageLocators.RUN_TEST_OPT_LNK, "font-size"), \
                  cases_page.get_css_property(locators.CasesPageLocators.STATISTICS_OPT_LNK, "font-size"), \
                  cases_page.get_css_property(locators.CasesPageLocators.ASSIGN_OPT_LNK, "font-size")]
    assert font_sizes == ['14px', '14px', '14px']
Пример #14
0
def test_cases_assign_option_scenario2(browser, login, logout):
    """"Verify that if move mouse to the Assign option and then re-clicking in another position relatively, the list of tester should not be seen"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.click_mb3_first_case()
    cases_page.move_mouse_on_element(locators.CasesPageLocators.ASSIGN_OPT_LNK)
    cases_page.click_first_case()
    assert not cases_page.is_element_seen(
        locators.CasesPageLocators.ASSIGN_SUB_MENU)  # defect: the list of testers is still seen
Пример #15
0
def test_run_1st_case(browser, login, logout):
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.run_test_btn_click()
    run_test_page = RunTestPage(browser)
    run_test_page.wait_new_page_load()
    run_title = run_test_page.get_title()
    run_case_name = run_test_page.get_test_case_name()
    assert run_title == run_case_name, "Should be 'Run' page"
    run_test_page.back_to_suite_btn_click()
Пример #16
0
def test_cases_assign_option_scenario3(browser, login, logout):
    """"Verify re-assignment tester for test case"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.click_mb3_first_case()
    cases_page.move_mouse_on_element(locators.CasesPageLocators.ASSIGN_OPT_LNK)
    assignment_tester = cases_page.visible_element_get_text(locators.CasesPageLocators.ASSIGN_TO_1ST_USER)
    cases_page.visible_element_click(locators.CasesPageLocators.ASSIGN_TO_1ST_USER)
    first_case_tester = cases_page.get_nth_case_tester_name(1)
    assert assignment_tester == first_case_tester  # defect: unable to change tester
Пример #17
0
def test_statistics_table_scenario1(browser, login, logout):
    """Check that Statistics table contains required fields"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.click_statistics_option()
    assert cases_page.is_element_seen(locators.CasesPageLocators.STATTABLE) and \
           cases_page.is_element_seen(locators.CasesPageLocators.STATTABLE_SUITE) and \
           cases_page.is_element_seen(locators.CasesPageLocators.STATTABLE_RUN_BY) and \
           cases_page.is_element_seen(locators.CasesPageLocators.STATTABLE_RESULT) and \
           cases_page.is_element_seen(locators.CasesPageLocators.STATTABLE_DURATION) and \
           cases_page.is_element_seen(locators.CasesPageLocators.STATTABLE_DATE)
Пример #18
0
def test_statistics_table_scenario3(browser, login, logout):
    """Check that Statistics table is updated if switch between several cases"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.click_statistics_option()
    cases_page.click_nth_case(7)
    cases_page.click_statistics_option()
    #time.sleep(2)
    assert cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_SUITE) == "Nadiia - Linux - 20.6.4" and \
           cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_RUN_BY) == "Nadiia" and \
           cases_page.visible_element_get_text(locators.CasesPageLocators.STATTABLE_RESULT) == "❌  Failed"
Пример #19
0
 def test_back_to_suite_click(self, browser, login, logout):
     """Test that 'Cases' page opened after 'Back to Suite' icon in 'Run' page"""
     suites_page = SuitesPage(browser)
     suites_page.wait_new_page_load()
     suites_page.suite_1st_link_click()
     suites_page.wait_new_page_load()
     cases_page = CasesPage(browser)
     case_title = cases_page.get_title()
     cases_page.click_first_case()
     cases_page.run_test_btn_click()
     cases_page.wait_new_page_load()
     run_test_page = RunTestPage(browser)
     run_test_page.back_to_suite_btn_click()
     run_test_page.wait_new_page_load()
     non_run_page_title = run_test_page.get_title()
     assert non_run_page_title == case_title, "Should be 'Cases' page"
Пример #20
0
def test_cases_info_scenario4(browser, login, logout):
    """Check that cases info is visible and contains correct information.
    Expected result: 7th test case is checking. Id=49145, Naming is
     Memory Threshold Warning Dialogue in DSG
     Tester is Nadiia, State is Failed"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    second_case_id = cases_page.get_nth_case_id(7)
    second_case_name = cases_page.get_nth_case_name(7)
    second_case_tester_name = cases_page.get_nth_case_tester_name(7)
    second_case_status = cases_page.get_nth_case_status(7)
    assert second_case_id == "49145" and \
           second_case_name == "Memory Threshold Warning Dialogue in DSG" and \
           second_case_tester_name == "Nadiia" and second_case_status == "❌  Failed"
Пример #21
0
def test_cases_info_scenario2(browser, login, logout):
    """Check that cases info is visible and contains correct information.
    Expected result: Second test case is checking. Id=48697, Naming is
     Validate that user A gets notification with changes in 'Sessions' view, when user B renames an editor
     Tester is Nadiia, State is Passed"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    second_case_id = cases_page.get_nth_case_id(2)
    second_case_name = cases_page.get_nth_case_name(2)
    second_case_tester_name = cases_page.get_nth_case_tester_name(2)
    second_case_status = cases_page.get_nth_case_status(2)
    assert second_case_id == "48697" and \
           second_case_name == "Validate that user A gets notification with changes in 'Sessions' view, when user B renames an editor." and \
           second_case_tester_name == "Nadiia" and second_case_status == "✅  Passed"
Пример #22
0
def test_cases_info_scenario3(browser, login, logout):
    """Check that cases info is visible and contains correct information.
    Expected result: Third test case is checking. Id=48698, Naming is
    Validate that user B's session task pane is updated to show the session name in italics when user A delete the same active session
    Tester is Nadiia, State is Passed"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    second_case_id = cases_page.get_nth_case_id(3)
    second_case_name = cases_page.get_nth_case_name(3)
    second_case_tester_name = cases_page.get_nth_case_tester_name(3)
    second_case_status = cases_page.get_nth_case_status(3)
    assert second_case_id == "48698" and \
           second_case_name == "Validate that user B's session task pane is updated to show the session name in italics when user A delete the same active session" and \
           second_case_tester_name == "Nadiia" and second_case_status == "✅  Passed"
Пример #23
0
 def test_save_and_close_icon_click(self, browser, login, logout):
     """Test that 'Cases' page opened after 'Save and Close' icon in 'Run' page"""
     suites_page = SuitesPage(browser)
     suites_page.wait_new_page_load()
     suites_page.suite_1st_link_click()
     suites_page.wait_new_page_load()
     cases_page = CasesPage(browser)
     cases_page.click_first_case()
     case_title = cases_page.get_title()
     cases_page.run_test_btn_click()
     cases_page.wait_new_page_load()
     run_test_page = RunTestPage(browser)
     run_test_page.failed_btn_1_step_click()
     run_test_page.passed_btn_1_step_click()
     run_test_page.save_and_close_btn_click()
     run_test_page.wait_new_page_load()
     test_page_title = run_test_page.get_title()
     assert test_page_title == case_title, "Should be 'Cases' page"
Пример #24
0
def test_statistics_table_styles(browser, login, logout):
    """Check that Statistics table is opening  with correct styles"""
    suites_page = SuitesPage(browser)
    suites_page.wait_new_page_load()
    suites_page.suite_1st_link_click()
    suites_page.wait_new_page_load()
    cases_page = CasesPage(browser)
    cases_page.click_first_case()
    cases_page.click_statistics_option()
    font_size = cases_page.get_css_property(locators.CasesPageLocators.STATTABLE, 'font-size')
    font_weight = cases_page.get_css_property(locators.CasesPageLocators.STATTABLE, 'font-weight')
    line_height = cases_page.get_css_property(locators.CasesPageLocators.STATTABLE, 'line-height')
    font_family = cases_page.get_css_property(locators.CasesPageLocators.STATTABLE, 'font-family')
    webkit_text_size_adjust = cases_page.get_css_property(locators.CasesPageLocators.STATTABLE,
                                                          'webkit-text-size-adjust')
    assert [font_size, font_weight, line_height, font_family, webkit_text_size_adjust] == ['14px', '400', '21px',
                                                                                           'Poppins, Arial, "Helvetica Neue", sans-serif',
                                                                                           '100%']
Пример #25
0
 def test_case_name(self, browser, login, logout):
     """Test that test case name the same as opened in 'Cases' page"""
     suites_page = SuitesPage(browser)
     suites_page.wait_new_page_load()
     suites_page.suite_1st_link_click()
     suites_page.wait_new_page_load()
     cases_page = CasesPage(browser)
     case_title = cases_page.get_first_case_name()
     cases_page.click_first_case()
     cases_page.click_mb3_first_case()
     cases_page.click_run_test_option()
     cases_page.wait_new_page_load()
     run_test_page = RunTestPage(browser)
     case_name = run_test_page.get_test_case_name()
     assert case_name == case_title, "Should be test case name"
     run_test_page.back_to_suite_btn_click()
     cases_page = CasesPage(browser)
     cases_page.wait_new_page_load()