本文整理匯總了Python中marketplacetests.marketplace.app.Marketplace.search方法的典型用法代碼示例。如果您正苦於以下問題:Python Marketplace.search方法的具體用法?Python Marketplace.search怎麽用?Python Marketplace.search使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類marketplacetests.marketplace.app.Marketplace
的用法示例。
在下文中一共展示了Marketplace.search方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_add_review
# 需要導入模塊: from marketplacetests.marketplace.app import Marketplace [as 別名]
# 或者: from marketplacetests.marketplace.app.Marketplace import search [as 別名]
def test_add_review(self):
marketplace = Marketplace(self.marionette, 'Marketplace dev')
marketplace.launch()
# Sign in
settings = marketplace.tap_settings()
persona = settings.tap_sign_in()
persona.login(self.user.email, self.user.password)
self.marionette.switch_to_frame()
marketplace.launch()
settings.wait_for_sign_out_button()
# Search and select app
results = marketplace.search('SoundCloud')
self.assertGreater(len(results.search_results), 0, 'No results found.')
details_page = results.search_results[0].tap_app()
# Setting your default values for review
current_time = str(time.time()).split('.')[0]
rating = random.randint(1, 5)
body = 'This is a test %s' % current_time
# Adding the review
review_box = details_page.tap_write_review()
review_box.write_a_review(rating, body)
marketplace.wait_for_notification_message_displayed()
# Check if review was added correctly
self.assertEqual(marketplace.notification_message, "Your review was posted")
self.assertEqual(details_page.first_review_rating, rating)
self.assertEqual(details_page.first_review_body, body)
示例2: test_search_and_install_app
# 需要導入模塊: from marketplacetests.marketplace.app import Marketplace [as 別名]
# 或者: from marketplacetests.marketplace.app.Marketplace import search [as 別名]
def test_search_and_install_app(self):
marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME)
marketplace.launch()
self.app_name = marketplace.popular_apps[0].name
app_author = marketplace.popular_apps[0].author
results = marketplace.search(self.app_name)
self.assertGreater(len(results.search_results), 0, 'No results found.')
first_result = results.search_results[0]
self.assertEquals(first_result.name, self.app_name, 'First app has the wrong name.')
self.assertEquals(first_result.author, app_author, 'First app has the wrong author.')
# Find and click the install button to the install the web app
self.assertEquals(first_result.install_button_text, 'Free', 'Incorrect button label.')
first_result.tap_install_button()
self.confirm_installation()
marketplace.wait_for_notification_message_not_displayed()
self.APP_INSTALLED = True
# Check that the icon of the app is on the homescreen
homescreen = Homescreen(self.marionette)
homescreen.switch_to_homescreen_frame()
self.assertTrue(homescreen.is_app_installed(self.app_name))
示例3: test_search_and_install_app
# 需要導入模塊: from marketplacetests.marketplace.app import Marketplace [as 別名]
# 或者: from marketplacetests.marketplace.app.Marketplace import search [as 別名]
def test_search_and_install_app(self):
marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME)
marketplace.launch()
self.app_name = marketplace.popular_apps[0].name
app_author = marketplace.popular_apps[0].author
results = marketplace.search(self.app_name)
self.assertGreater(len(results.search_results), 0, 'No results found.')
first_result = results.search_results[0]
self.assertEquals(first_result.name, self.app_name, 'First app has the wrong name.')
self.assertEquals(first_result.author, app_author, 'First app has the wrong author.')
# Find and click the install button to the install the web app
self.assertEquals(first_result.install_button_text, 'Free', 'Incorrect button label.')
first_result.tap_install_button()
self.confirm_installation()
self.APP_INSTALLED = True
# Press Home button
self.marionette.execute_script("window.wrappedJSObject.dispatchEvent(new Event('home'));")
# Check that the icon of the app is on the homescreen
homescreen = Homescreen(self.marionette)
self.apps.switch_to_displayed_app()
self.assertTrue(homescreen.is_app_installed(self.app_name))
開發者ID:chirarobert,項目名稱:marketplace-tests-gaia,代碼行數:32,代碼來源:test_marketplace_search_and_install_app.py
示例4: test_search_paid_app
# 需要導入模塊: from marketplacetests.marketplace.app import Marketplace [as 別名]
# 或者: from marketplacetests.marketplace.app.Marketplace import search [as 別名]
def test_search_paid_app(self):
APP_NAME = 'Test Zippy With Me'
if self.apps.is_app_installed(APP_NAME):
self.apps.uninstall(APP_NAME)
marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME)
marketplace.launch()
marketplace.set_region('United States')
search_results = marketplace.search(APP_NAME).search_results
self.assertGreater(len(search_results), 0, 'No results found.')
for result in search_results:
if result.name == APP_NAME:
saved_price = result.install_button_text
details_page = result.tap_app()
self.assertEqual(saved_price, details_page.install_button_text)
return True
# app not found
self.fail('The app: %s was not found.' % APP_NAME)
開發者ID:bobsilverberg,項目名稱:marketplace-tests-gaia,代碼行數:27,代碼來源:test_marketplace_search_for_paid_app.py
示例5: test_marketplace_purchase_app_wifi
# 需要導入模塊: from marketplacetests.marketplace.app import Marketplace [as 別名]
# 或者: from marketplacetests.marketplace.app.Marketplace import search [as 別名]
def test_marketplace_purchase_app_wifi(self):
marketplace = Marketplace(self.marionette, 'Marketplace Dev')
marketplace.launch()
# Tap settings and sign in in Marketplace
settings = marketplace.tap_settings()
persona = settings.tap_sign_in()
# login with PersonaTestUser account
persona.login(self.user.email, self.user.password)
# switch back to Marketplace
self.marionette.switch_to_frame()
marketplace.launch()
# wait for the page to refresh and the sign out button to be visible
settings.wait_for_sign_out_button()
# Well I dunno, it just needs this
time.sleep(3)
settings.select_region("Spain")
time.sleep(3)
settings.tap_save_changes()
# search for a paid app and tap on the price
search = marketplace.search(self._APP_NAME)
bango = search.search_results[0].tap_purchase_button()
# pay app
bango.create_pin('1234')
# verify phone number
bango.verify_phone_number(mobile_phone_number=self.testvars['carrier']['phone_number'],
country=self.testvars['carrier']['country'],
network=self.testvars['carrier']['network'])
# but the app
bango.wait_for_buy_app_section_displayed()
bango.tap_buy_button()
# At gaia System level, complete the installation prompt
self._confirm_installation()
# Switch into homescreen frame
homescreen_frame = self.marionette.find_element(*self._homescreen_iframe_locator)
self.marionette.switch_to_frame(homescreen_frame)
# Not overly concerned about it being visible, only present
self.assertTrue(self.is_element_present(*self._app_icon_locator))
示例6: test_marketplace_purchase_app_on_dev_with_mocked_bango
# 需要導入模塊: from marketplacetests.marketplace.app import Marketplace [as 別名]
# 或者: from marketplacetests.marketplace.app.Marketplace import search [as 別名]
def test_marketplace_purchase_app_on_dev_with_mocked_bango(self):
marketplace = Marketplace(self.marionette, 'Marketplace Dev')
marketplace.launch()
# Tap settings and sign in in Marketplace
settings = marketplace.tap_settings()
persona = settings.tap_sign_in()
# login with PersonaTestUser account
persona.login(self.user.email, self.user.password)
# switch back to Marketplace
self.marionette.switch_to_frame()
marketplace.launch()
# wait for the page to refresh and the sign out button to be visible
settings.wait_for_sign_out_button()
# Well I dunno, it just needs this
time.sleep(3)
settings.select_region("Spain")
time.sleep(3)
settings.tap_save_changes()
marketplace.wait_for_notification_message_not_displayed()
# search for a paid app and tap on the price
search = marketplace.search('Bag of Dice')
bango = search.search_results[0].tap_purchase_button()
# pay app
bango.create_pin('1234')
# make fake payment
bango.make_fake_payment()
self.marionette.switch_to_frame()
# At gaia System level, complete the installation prompt
self._confirm_installation()
# Switch into homescreen frame
homescreen_frame = self.marionette.find_element(*self._homescreen_iframe_locator)
self.marionette.switch_to_frame(homescreen_frame)
# Not overly concerned about it being visible, only present
self.assertTrue(self.is_element_present(*self._app_icon_locator))
開發者ID:bebef1987,項目名稱:marketplace-tests-gaia,代碼行數:51,代碼來源:test_marketplace_purchase_app_on_dev_with_mocked_bango.py
示例7: test_marketplace_purchase_app_credit_card
# 需要導入模塊: from marketplacetests.marketplace.app import Marketplace [as 別名]
# 或者: from marketplacetests.marketplace.app.Marketplace import search [as 別名]
def test_marketplace_purchase_app_credit_card(self):
marketplace = Marketplace(self.marionette, 'Marketplace Dev')
marketplace.launch()
# Tap settings and sign in in Marketplace
settings = marketplace.tap_settings()
persona = settings.tap_sign_in()
# login with PersonaTestUser account
persona.login(self.user.email, self.user.password)
# switch back to Marketplace
self.marionette.switch_to_frame()
marketplace.launch()
# wait for the page to refresh and the sign out button to be visible
settings.wait_for_sign_out_button()
# Well I dunno, it just needs this
time.sleep(3)
settings.select_region("Spain")
time.sleep(3)
settings.tap_save_changes()
# search for a paid app and tap on the price
search = marketplace.search(self._APP_NAME)
bango = search.search_results[0].tap_purchase_button()
# pay app
bango.create_pin('1234')
# enter credit card details
bango.pay_using_credit_card('5149934112455150', '0718', '123')
self.marionette.switch_to_frame()
# At gaia System level, complete the installation prompt
self._confirm_installation()
# Switch into homescreen frame
homescreen_frame = self.marionette.find_element(*self._homescreen_iframe_locator)
self.marionette.switch_to_frame(homescreen_frame)
# Not overly concerned about it being visible, only present
self.assertTrue(self.is_element_present(*self._app_icon_locator))
示例8: test_search_paid_app
# 需要導入模塊: from marketplacetests.marketplace.app import Marketplace [as 別名]
# 或者: from marketplacetests.marketplace.app.Marketplace import search [as 別名]
def test_search_paid_app(self):
marketplace = Marketplace(self.marionette, "Marketplace Dev")
marketplace.launch()
results = marketplace.search("")
self.assertGreater(len(results.search_results), 0, "No results found.")
filter = results.tap_filter()
filter.by_price("paid")
results = filter.tap_apply()
self.assertGreater(len(results.search_results), 0, "No results found.")
for result in results.search_results:
self.assertTrue(re.match("^\$\d+\.\d{2}", result.price), "App %s it's not a paid app." % result.name)