本文整理汇总了Python中gaiatest.apps.browser.app.Browser.tap_tab_badge_button方法的典型用法代码示例。如果您正苦于以下问题:Python Browser.tap_tab_badge_button方法的具体用法?Python Browser.tap_tab_badge_button怎么用?Python Browser.tap_tab_badge_button使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gaiatest.apps.browser.app.Browser
的用法示例。
在下文中一共展示了Browser.tap_tab_badge_button方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_browser_tabs
# 需要导入模块: from gaiatest.apps.browser.app import Browser [as 别名]
# 或者: from gaiatest.apps.browser.app.Browser import tap_tab_badge_button [as 别名]
def test_browser_tabs(self):
""" Open a new tab.
Open Browser.
Open tab menu.
Add a new tab.
Assert that the new tab has opened.
Load a website.
Switch back to the first tab.
"""
browser = Browser(self.marionette)
browser.launch()
# Open tab menu.
browser.tap_tab_badge_button()
# Add a new tab and load a website.
browser.tap_add_new_tab_button()
browser.go_to_url(self.test_url)
browser.switch_to_content()
Wait(self.marionette).until(lambda m: m.title == 'Mozilla')
# Assert that the new tab has opened.
browser.switch_to_chrome()
self.assertEqual(browser.displayed_tabs_number, 2)
# Assert that the displayed tabs number is equal with the actual number of opened tabs.
self.assertEqual(browser.displayed_tabs_number, browser.tabs_count)
# Switch back to the first tab.
browser.tap_tab_badge_button()
browser.tabs[0].tap_tab()
self.assertTrue(browser.is_awesome_bar_visible)
示例2: test_browser_tabs
# 需要导入模块: from gaiatest.apps.browser.app import Browser [as 别名]
# 或者: from gaiatest.apps.browser.app.Browser import tap_tab_badge_button [as 别名]
def test_browser_tabs(self):
""" Open a new tab.
Using Wifi/LAN
Open Browser.
Open tab menu.
Add a new tab.
Assert that the new tab has opened.
Load a website ( http://mozqa.com/data/firefox/layout/mozilla.html)
Switch back to the first tab.
"""
browser = Browser(self.marionette)
browser.launch()
# Open tab menu.
browser.tap_tab_badge_button()
# Add a new tab and load a website.
browser.tap_add_new_tab_button()
browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html')
browser.switch_to_content()
self.wait_for_element_present(*self._page_title_locator)
heading = self.marionette.find_element(*self._page_title_locator)
self.assertEqual(heading.text, 'We believe that the internet should be public, open and accessible.')
# Assert that the new tab has opened.
browser.switch_to_chrome()
self.assertEqual(browser.displayed_tabs_number, 2)
# Assert that the displayed tabs number is equal with the actual number of opened tabs.
self.assertEqual(browser.displayed_tabs_number, browser.tabs_count)
# Switch back to the first tab.
browser.tap_tab_badge_button()
browser.tabs[0].tap_tab()
self.assertTrue(browser.is_awesome_bar_visible)
示例3: TestBrowserTabs
# 需要导入模块: from gaiatest.apps.browser.app import Browser [as 别名]
# 或者: from gaiatest.apps.browser.app.Browser import tap_tab_badge_button [as 别名]
class TestBrowserTabs(GaiaMtbfTestCase):
_page_title_locator = (By.ID, 'page-title')
def setUp(self):
GaiaMtbfTestCase.setUp(self)
self.connect_to_network()
self.browser = Browser(self.marionette)
self.browser.launch()
def test_browser_tabs(self):
# Remember the tabs number
self.ori_tab_num = self.browser.displayed_tabs_number
# Open tab menu.
self.browser.tap_tab_badge_button()
# Add a new tab and load a website.
self.browser.tap_add_new_tab_button()
self.browser.go_to_url('http://mozqa.com/data/firefox/layout/mozilla.html')
self.browser.switch_to_content()
self.wait_for_element_present(*self._page_title_locator)
heading = self.marionette.find_element(*self._page_title_locator)
self.assertEqual(heading.text, 'We believe that the internet should be public, open and accessible.')
# Assert that the new tab has opened.
self.browser.switch_to_chrome()
self.assertEqual(self.browser.displayed_tabs_number, self.ori_tab_num + 1)
# Assert that the displayed tabs number is equal with the actual number of opened tabs.
self.assertEqual(self.browser.displayed_tabs_number, self.browser.tabs_count)
# Switch back to the first tab.
self.browser.tap_tab_badge_button()
self.browser.tabs[0].tap_tab()
self.assertTrue(self.browser.is_awesome_bar_visible)
def tearDown(self):
self.data_layer.disable_wifi()
GaiaMtbfTestCase.tearDown(self)