示例#1
0
    def test_custom_timeout_is_passed_through(self):
        element = mock.create_autospec(Element, spec_set=True)
        element.is_visible.return_value = True

        assert_that(element, is_(eventually_visible(within_seconds=66)))

        element.is_visible.assert_called_with(timeout_seconds=66)
示例#2
0
    def test_sidebar_can_be_opened_from_the_popup(self):
        sidebar.close_button.click()
        browser.updatescanner_button.click()

        popup.open_sidebar_button.click()

        assert_that(sidebar.title, is_(eventually_visible()))
示例#3
0
    def test_negative_assertion_passes_when_element_is_not_visible(self):
        element = mock.create_autospec(Element, spec_set=True)
        element.is_visible.return_value = False

        assert_that(element, is_not(eventually_visible()))

        element.is_visible.assert_called_with(timeout_seconds=30)
示例#4
0
    def test_item_can_be_added_from_the_popup(self, firefox):
        firefox.navigate_to("http://example.com")
        browser.updatescanner_button.click()

        popup.add_button.click()
        page_settings.ok_button.click()

        assert_that(sidebar.example_website_item, is_(eventually_visible()))
示例#5
0
    def test_assertion_fails_when_element_is_not_visible(self):
        element = mock.create_autospec(Element, spec_set=True)
        element.is_visible.return_value = False

        assert_that(
            calling(assert_that).with_args(element, is_(eventually_visible())),
            raises(AssertionError,
                   r"\s+Expected: to be visible\s+but: it was not found\s+"),
        )

        element.is_visible.assert_called_with(timeout_seconds=30)
示例#6
0
    def test_negative_assertion_fails_when_element_is_visible(self):
        element = mock.create_autospec(Element, spec_set=True)
        element.is_visible.return_value = True

        assert_that(
            calling(assert_that).with_args(element,
                                           is_not(eventually_visible())),
            raises(
                AssertionError,
                r"\s+Expected: not to be visible\s+but: was <.*Element.*>\s+",
            ),
        )

        element.is_visible.assert_called_with(timeout_seconds=0)
    def test_page_settings_can_adjust_parameters(self):
        sidebar.updatescanner_website_item.click()
        page_view.settings_button.click()
        page_view.page_settings_menu_item.click()

        page_settings.autoscan_often.click()
        left_ten_times()
        page_settings.change_threshold_low.click()
        left_ten_times()

        page_settings.ok_button.click()

        page_view.settings_button.click()
        page_view.debug_info_menu_item.click()

        assert_that(debug_info.title, is_(eventually_visible()))
        assert_that(debug_info.scan_rate_minutes_5, is_(visible()))
        assert_that(debug_info.change_threshold_0, is_(visible()))
    def test_links_work_in_pages(self):
        sidebar.updatescanner_website_item.click()
        content.updatescanner_website_install_link.click()

        assert_that(content.amo_website_page, is_(eventually_visible()))
    def test_debug_info_can_be_opened(self):
        sidebar.updatescanner_website_item.click()
        page_view.settings_button.click()
        page_view.debug_info_menu_item.click()

        assert_that(debug_info.title, is_(eventually_visible()))
    def test_page_settings_can_be_opened(self):
        sidebar.updatescanner_website_item.click()
        page_view.settings_button.click()
        page_view.page_settings_menu_item.click()

        assert_that(page_settings.updatescanner_website, is_(eventually_visible()))
示例#11
0
    def test_clicking_an_item_opens_it(self):
        sidebar.updatescanner_website_item.click()

        assert_that(
            content.updatescanner_website_page, is_(eventually_visible()))
示例#12
0
 def test_sidebar_is_open_after_addon_install(self):
     assert_that(sidebar.title, is_(eventually_visible()))
示例#13
0
def add_test_website(firefox):
    sidebar.updatescanner_website_item.click()
    assert_that(content.updatescanner_website_page, is_(eventually_visible()))
    debug.navigate_from_current(firefox)
    debug.add_page.click()
示例#14
0
    def test_changed_page_is_not_bold_once_clicked(self, firefox):
        add_test_website(firefox)
        sidebar.bold_test_website_item.click()

        assert_that(sidebar.selected_test_website_item,
                    is_(eventually_visible()))
示例#15
0
    def test_changed_page_is_bold(self, firefox):
        add_test_website(firefox)

        assert_that(sidebar.bold_test_website_item, is_(eventually_visible()))
示例#16
0
    def test_popup_is_shown_when_the_toolbar_button_is_clicked(self):
        browser.updatescanner_button.click()

        assert_that(popup.empty_popup, is_(eventually_visible()))