From a71287df5c04eb84fc6f5a74ef672d599db604e2 Mon Sep 17 00:00:00 2001 From: Karan Date: Tue, 19 Nov 2013 12:34:19 -0500 Subject: [PATCH] Bug 933817 - Removed all marketplace tests (excluding smoketest) and its app folder --- .../gaiatest/apps/marketplace/__init__.py | 0 .../gaiatest/apps/marketplace/app.py | 136 ------------------ .../apps/marketplace/regions/__init__.py | 0 .../apps/marketplace/regions/app_details.py | 38 ----- .../apps/marketplace/regions/review_box.py | 32 ----- .../marketplace/regions/search_results.py | 82 ----------- .../apps/marketplace/regions/settings.py | 61 -------- .../gaia-ui-tests/gaiatest/gaia_test.py | 15 -- .../test_marketplace_add_review.py | 56 -------- ...est_marketplace_change_region_anonymous.py | 43 ------ .../test_marketplace_change_region_login.py | 50 ------- .../test_marketplace_feedback_anonymous.py | 38 ----- .../test_marketplace_feedback_login.py | 52 ------- .../marketplace/test_marketplace_login.py | 49 ------- ...test_marketplace_search_and_install_app.py | 64 --------- .../test_marketplace_search_for_paid_apps.py | 38 ----- .../test_marketplace_without_connectivity.py | 37 ----- 17 files changed, 791 deletions(-) delete mode 100644 tests/python/gaia-ui-tests/gaiatest/apps/marketplace/__init__.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/apps/marketplace/app.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/__init__.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/app_details.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/review_box.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/search_results.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/settings.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_add_review.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_change_region_anonymous.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_change_region_login.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_feedback_anonymous.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_feedback_login.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_login.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_search_and_install_app.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_search_for_paid_apps.py delete mode 100644 tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_without_connectivity.py diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/__init__.py b/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/app.py b/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/app.py deleted file mode 100644 index 4646dccff0c8..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/app.py +++ /dev/null @@ -1,136 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from marionette.by import By -from marionette.keys import Keys -from gaiatest.apps.base import Base - - -class Marketplace(Base): - - # Default to the Dev app - name = 'Marketplace Dev' - - _marketplace_iframe_locator = (By.CSS_SELECTOR, 'iframe[src*="marketplace"]') - - _gallery_apps_locator = (By.CSS_SELECTOR, '#gallery .app') - _loading_fragment_locator = (By.CSS_SELECTOR, 'div.loading-fragment') - _error_title_locator = (By.CSS_SELECTOR, 'div.modal-dialog-message-container > h3.title') - _error_message_locator = (By.CSS_SELECTOR, 'div.modal-dialog-message-container .message') - _settings_button_locator = (By.CSS_SELECTOR, 'a.header-button.settings') - _home_button_locator = (By.CSS_SELECTOR, 'h1.site a') - _back_button_locator = (By.ID, 'nav-back') - _notification_locator = (By.ID, 'notification-content') - _popular_apps_tab_locator = (By.CSS_SELECTOR, '#gallery .tabs a:nth-child(1)') - - # Marketplace settings tabs - _account_tab_locator = (By.CSS_SELECTOR, 'a[href="/settings"]') - _my_apps_tab_locator = (By.CSS_SELECTOR, 'a[href="/purchases"]') - _feedback_tab_locator = (By.CSS_SELECTOR, 'a[href="/feedback"]') - _feedback_textarea_locator = (By.NAME, 'feedback') - _feedback_submit_button_locator = (By.CSS_SELECTOR, 'button[type="submit"]') - - # Marketplace search on home page - _search_locator = (By.ID, 'search-q') - _signed_in_notification_locator = (By.CSS_SELECTOR, '#notification.show') - - def __init__(self, marionette, app_name=False): - Base.__init__(self, marionette) - if app_name: - self.name = app_name - - def switch_to_marketplace_frame(self): - """Only Marketplace production has a frame for the app.""" - self.marionette.switch_to_frame(self.marionette.find_element(*self._marketplace_iframe_locator)) - - def launch(self): - Base.launch(self, launch_timeout=120000) - self.wait_for_element_not_displayed(*self._loading_fragment_locator) - - @property - def error_title_text(self): - return self.marionette.find_element(*self._error_title_locator).text - - @property - def error_message_text(self): - return self.marionette.find_element(*self._error_message_locator).text - - def wait_for_notification_message_displayed(self): - self.wait_for_element_displayed(*self._notification_locator) - - def wait_for_notification_message_not_displayed(self): - self.wait_for_element_not_displayed(*self._notification_locator) - - @property - def notification_message(self): - return self.marionette.find_element(*self._notification_locator).text - - @property - def popular_apps(self): - self.show_popular_apps() - from gaiatest.apps.marketplace.regions.search_results import Result - return [Result(self.marionette, app) for app in self.marionette.find_elements(*self._gallery_apps_locator)] - - def search(self, term): - search_box = self.marionette.find_element(*self._search_locator) - - # search for the app - search_box.send_keys(term) - search_box.send_keys(Keys.RETURN) - from gaiatest.apps.marketplace.regions.search_results import SearchResults - return SearchResults(self.marionette) - - def show_popular_apps(self): - self.marionette.find_element(*self._popular_apps_tab_locator).tap() - self.wait_for_condition(lambda m: 'active' in m.find_element(*self._popular_apps_tab_locator).get_attribute('class')) - - def tap_settings(self): - self.marionette.find_element(*self._settings_button_locator).tap() - from gaiatest.apps.marketplace.regions.settings import Settings - return Settings(self.marionette) - - def tap_home(self): - self.marionette.find_element(*self._home_button_locator).tap() - - def tap_back(self): - self.marionette.find_element(*self._back_button_locator).tap() - - def login(self, user): - # Tap settings and sign in in Marketplace - settings = self.tap_settings() - persona = settings.tap_sign_in() - - # login with PersonaTestUser account - persona.login(user.email, user.password) - - # switch back to Marketplace - self.marionette.switch_to_frame() - self.launch() - - # wait for the page to refresh and the sign out button to be visible - settings.wait_for_sign_out_button() - - return settings - - def wait_for_setting_displayed(self): - self.wait_for_element_displayed(*self._settings_button_locator) - - def select_setting_account(self): - self.marionette.find_element(*self._account_tab_locator).tap() - - def select_setting_my_apps(self): - self.marionette.find_element(*self._my_apps_tab_locator).tap() - - def select_setting_feedback(self): - self.marionette.find_element(*self._feedback_tab_locator).tap() - - def enter_feedback(self, feedback_text): - feedback = self.marionette.find_element(*self._feedback_textarea_locator) - feedback.clear() - feedback.send_keys(feedback_text) - self.keyboard.dismiss() - - def submit_feedback(self): - self.wait_for_element_displayed(*self._feedback_submit_button_locator) - self.marionette.find_element(*self._feedback_submit_button_locator).tap() diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/__init__.py b/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/__init__.py deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/app_details.py b/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/app_details.py deleted file mode 100644 index 53b23751b771..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/app_details.py +++ /dev/null @@ -1,38 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from marionette.by import By -from gaiatest.apps.base import Base - - -class Details(Base): - - _write_review_locator = (By.ID, 'add-review') - _app_details_locator = (By.CSS_SELECTOR, '.detail') - _first_review_locator = (By.CSS_SELECTOR, 'li:first-child .review-inner > span') - _first_review_body_locator = (By.CSS_SELECTOR, 'li:first-child .body') - - def __init__(self, marionette): - Base.__init__(self, marionette) - self.wait_for_element_present(*self._app_details_locator) - - @property - def is_app_details_displayed(self): - return self.is_element_displayed(*self._app_details_locator) - - @property - def first_review_body(self): - return self.marionette.find_element(*self._first_review_body_locator).text - - @property - def first_review_rating(self): - return int(self.marionette.find_element(*self._first_review_locator).get_attribute('class')[-1]) - - def tap_write_review(self): - self.wait_for_element_present(*self._write_review_locator) - write_review_button = self.marionette.find_element(*self._write_review_locator) - write_review_button.tap() - - from gaiatest.apps.marketplace.regions.review_box import AddReview - return AddReview(self.marionette) diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/review_box.py b/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/review_box.py deleted file mode 100644 index 93deee2cbeb3..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/review_box.py +++ /dev/null @@ -1,32 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from marionette.by import By -from gaiatest.apps.base import Base - - -class AddReview(Base, dict): - """ - Page for adding reviews. - """ - - _add_review_input_field_locator = (By.ID, 'id_body') - _submit_review_button_locator = (By.CSS_SELECTOR, 'button[type="submit"]') - _review_box_locator = (By.CSS_SELECTOR, '.add-review-form') - _rating_locator = (By.CSS_SELECTOR, ".ratingwidget.stars-0 > label[data-stars='%s']") - - def __init__(self, marionette, **kwargs): - Base.__init__(self, marionette) - self.wait_for_element_present(*self._review_box_locator) - - def set_review_rating(self, rating): - self.marionette.find_element(self._rating_locator[0], self._rating_locator[1] % rating).tap() - - def type_review(self, text): - self.marionette.find_element(*self._add_review_input_field_locator).send_keys(text) - - def write_a_review(self, rating, body): - self.set_review_rating(rating) - self.type_review(body) - self.marionette.find_element(*self._submit_review_button_locator).tap() diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/search_results.py b/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/search_results.py deleted file mode 100644 index a2f6d1e3976b..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/search_results.py +++ /dev/null @@ -1,82 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from marionette.by import By -from gaiatest.apps.base import Base -from gaiatest.apps.base import PageRegion - - -class SearchResults(Base): - - _search_results_area_locator = (By.ID, 'search-results') - _search_results_loading_locator = (By.CSS_SELECTOR, 'div.loading') - _search_result_locator = (By.CSS_SELECTOR, '#search-results li.item') - _filter_button_locator = (By.CSS_SELECTOR, '#site-header .header-button.filter') - - def __init__(self, marionette): - Base.__init__(self, marionette) - self.wait_for_element_not_present(*self._search_results_loading_locator) - - def tap_filter(self): - self.marionette.find_element(*self._filter_button_locator).tap() - return FilterResults(self.marionette) - - @property - def search_results(self): - self.wait_for_element_displayed(*self._search_result_locator) - search_results = self.marionette.find_elements(*self._search_result_locator) - return [Result(self.marionette, result) for result in search_results] - - -class Result(PageRegion): - - _name_locator = (By.CSS_SELECTOR, '.info > h3') - _author_locator = (By.CSS_SELECTOR, '.info .author') - _install_button_locator = (By.CSS_SELECTOR, '.button.product.install') - _price_locator = (By.CSS_SELECTOR, '.premium.button.product') - - @property - def name(self): - return self.root_element.find_element(*self._name_locator).text - - @property - def author(self): - return self.root_element.find_element(*self._author_locator).text - - @property - def install_button_text(self): - return self.root_element.find_element(*self._install_button_locator).text - - def tap_install_button(self): - self.root_element.find_element(*self._install_button_locator).tap() - self.marionette.switch_to_frame() - - @property - def price(self): - return self.root_element.find_element(*self._price_locator).text - - def tap_app(self): - app_name = self.marionette.find_element(*self._name_locator) - app_name.tap() - from gaiatest.apps.marketplace.regions.app_details import Details - return Details(self.marionette) - - -class FilterResults(Base): - - _apply_locator = (By.CSS_SELECTOR, '.footer-action > .apply') - _all_price_filter_locator = (By.CSS_SELECTOR, '#filter-prices > li:nth-child(1) > a') - _free_price_filter_locator = (By.CSS_SELECTOR, '#filter-prices > li:nth-child(2) > a') - _paid_price_filter_locator = (By.CSS_SELECTOR, '#filter-prices > li:nth-child(3) > a') - - def __init__(self, marionette): - Base.__init__(self, marionette) - self.wait_for_element_displayed(*self._apply_locator) - - def by_price(self, filter_name): - self.marionette.find_element(*getattr(self, '_%s_price_filter_locator' % filter_name)).tap() - - def tap_apply(self): - self.marionette.find_element(*self._apply_locator).tap() - return SearchResults(self.marionette) diff --git a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/settings.py b/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/settings.py deleted file mode 100644 index e8382d29e233..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/apps/marketplace/regions/settings.py +++ /dev/null @@ -1,61 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from marionette.by import By -from gaiatest.apps.base import Base - - -class Settings(Base): - - name = 'Marketplace Dev' - - _email_account_field_locator = (By.ID, 'email') - _save_locator = (By.CSS_SELECTOR, 'footer > p > button') - _sign_in_button_locator = (By.CSS_SELECTOR, 'a.button.persona') - _sign_out_button_locator = (By.CSS_SELECTOR, 'a.button.logout') - _back_button_locator = (By.ID, 'nav-back') - _region_select_locator = (By.ID, 'region') - _region_select_value_locator = (By.CSS_SELECTOR, '#region option[selected]') - _save_changes_button_locator = (By.XPATH, "//section[@id='account-settings']//button[text()='Save Changes']") - - def __init__(self, marionette): - Base.__init__(self, marionette) - self.wait_for_element_displayed(*self._save_locator) - - def tap_back(self): - self.marionette.find_element(*self._back_button_locator).tap() - from gaiatest.apps.marketplace.app import Marketplace - return Marketplace(self.marionette) - - def wait_for_sign_in_displayed(self): - self.wait_for_element_displayed(*self._sign_in_button_locator) - - def tap_sign_in(self): - self.marionette.find_element(*self._sign_in_button_locator).tap() - from gaiatest.apps.persona.app import Persona - return Persona(self.marionette) - - def wait_for_sign_out_button(self): - self.wait_for_element_displayed(*self._sign_out_button_locator) - - def tap_sign_out(self): - sign_out_button = self.marionette.find_element(*self._sign_out_button_locator) - # TODO: remove scrollIntoView hack - self.marionette.execute_script("arguments[0].scrollIntoView(false);", [sign_out_button]) - sign_out_button.tap() - - def select_region(self, region): - self.marionette.find_element(*self._region_select_locator).tap() - self.select(region) - - def tap_save_changes(self): - self.marionette.find_element(*self._save_changes_button_locator).tap() - - @property - def region(self): - return self.marionette.find_element(*self._region_select_value_locator).text - - @property - def email(self): - return self.marionette.find_element(*self._email_account_field_locator).get_attribute('value') diff --git a/tests/python/gaia-ui-tests/gaiatest/gaia_test.py b/tests/python/gaia-ui-tests/gaiatest/gaia_test.py index e7d6041873c8..d6f653a73a51 100644 --- a/tests/python/gaia-ui-tests/gaiatest/gaia_test.py +++ b/tests/python/gaia-ui-tests/gaiatest/gaia_test.py @@ -542,21 +542,6 @@ def cleanUp(self): # disable sound completely self.data_layer.set_volume(0) - def install_marketplace(self): - _yes_button_locator = (By.ID, 'app-install-install-button') - mk = {"name": "Marketplace Dev", - "manifest": "https://marketplace-dev.allizom.org/manifest.webapp ", - } - - if not self.apps.is_app_installed(mk['name']): - # install the marketplace dev app - self.marionette.execute_script('navigator.mozApps.install("%s")' % mk['manifest']) - - # TODO add this to the system app object when we have one - self.wait_for_element_displayed(*_yes_button_locator) - self.marionette.find_element(*_yes_button_locator).tap() - self.wait_for_element_not_displayed(*_yes_button_locator) - def connect_to_network(self): if not self.device.is_online: try: diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_add_review.py b/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_add_review.py deleted file mode 100644 index e0c7f197e7de..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_add_review.py +++ /dev/null @@ -1,56 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -import time -import random - -from gaiatest import GaiaTestCase -from gaiatest.apps.marketplace.app import Marketplace -from gaiatest.mocks.persona_test_user import PersonaTestUser - - -class TestMarketplaceAddReview(GaiaTestCase): - - def setUp(self): - GaiaTestCase.setUp(self) - self.connect_to_network() - self.install_marketplace() - - self.user = PersonaTestUser().create_user(verified=True, - env={"browserid": "firefoxos.persona.org", "verifier": "marketplace-dev.allizom.org"}) - - 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) diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_change_region_anonymous.py b/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_change_region_anonymous.py deleted file mode 100644 index 9e9445c39dea..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_change_region_anonymous.py +++ /dev/null @@ -1,43 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from gaiatest import GaiaTestCase -from gaiatest.apps.marketplace.app import Marketplace - - -class TestMarketplaceChangeRegionAnonymous(GaiaTestCase): - - _REGION = 'Spain' - - def setUp(self): - GaiaTestCase.setUp(self) - - self.connect_to_network() - self.install_marketplace() - - def test_marketplace_change_region_anonymous(self): - - marketplace = Marketplace(self.marionette, 'Marketplace Dev') - marketplace.launch() - - settings = marketplace.tap_settings() - - # change region - settings.select_region(self._REGION) - - # save changes - settings.tap_save_changes() - - # wait for the changes to be saved - marketplace.wait_for_notification_message_displayed() - self.assertEqual(marketplace.notification_message, 'Settings saved') - - # go to home - marketplace.tap_back() - - # go back to settings - settings = marketplace.tap_settings() - - # check if the region is same as changed before - self.assertEqual(settings.region, self._REGION) diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_change_region_login.py b/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_change_region_login.py deleted file mode 100644 index cdcaa2f8b262..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_change_region_login.py +++ /dev/null @@ -1,50 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from gaiatest import GaiaTestCase -from gaiatest.apps.marketplace.app import Marketplace -from gaiatest.mocks.persona_test_user import PersonaTestUser - - -class TestMarketplaceChangeRegionLogin(GaiaTestCase): - - _REGION = 'Spain' - - def setUp(self): - GaiaTestCase.setUp(self) - - self.connect_to_network() - self.install_marketplace() - - # generate unverified PersonaTestUser account - self.user = PersonaTestUser().create_user(verified=True, env={ - "browserid": "firefoxos.persona.org", - "verifier": "marketplace-dev.allizom.org"}) - - def test_marketplace_change_region_login(self): - - marketplace = Marketplace(self.marionette, 'Marketplace Dev') - marketplace.launch() - - # login to marketplace - settings = marketplace.login(self.user) - - # change region - settings.select_region(self._REGION) - - # save changes - settings.tap_save_changes() - - # wait for the changes to be saved - marketplace.wait_for_notification_message_displayed() - self.assertEqual(marketplace.notification_message, 'Settings saved') - - # go to home - marketplace.tap_back() - - # go back to settings - settings = marketplace.tap_settings() - - # check if the region is same as changed before - self.assertEqual(settings.region, self._REGION) diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_feedback_anonymous.py b/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_feedback_anonymous.py deleted file mode 100644 index c8a5f07a31d3..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_feedback_anonymous.py +++ /dev/null @@ -1,38 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from gaiatest import GaiaTestCase -from gaiatest.apps.marketplace.app import Marketplace - - -class TestMarketplaceFeedback(GaiaTestCase): - MARKETPLACE_DEV_NAME = 'Marketplace Dev' - feedback_submitted_message = u'Feedback submitted. Thanks!' - test_comment = 'This is a test comment.' - - def setUp(self): - GaiaTestCase.setUp(self) - self.connect_to_network() - self.install_marketplace() - - def test_marketplace_feedback_anonymous(self): - # launch marketplace dev and go to marketplace - self.marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) - self.marketplace.launch() - - # wait for settings button to come out - self.marketplace.wait_for_setting_displayed() - settings = self.marketplace.tap_settings() - self.marketplace.select_setting_feedback() - - # enter and submit your feedback - self.marketplace.enter_feedback(self.test_comment) - self.marketplace.submit_feedback() - - # catch the notification - self.marketplace.wait_for_notification_message_displayed() - message_content = self.marketplace.notification_message - - # verify if the notification is right - self.assertEqual(message_content, self.feedback_submitted_message) diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_feedback_login.py b/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_feedback_login.py deleted file mode 100644 index adc6ee002cc9..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_feedback_login.py +++ /dev/null @@ -1,52 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from gaiatest import GaiaTestCase -from gaiatest.apps.marketplace.app import Marketplace -from gaiatest.mocks.persona_test_user import PersonaTestUser - - -class TestMarketplaceFeedback(GaiaTestCase): - MARKETPLACE_DEV_NAME = 'Marketplace Dev' - feedback_submitted_message = u'Feedback submitted. Thanks!' - test_comment = 'This is a test comment.' - - def setUp(self): - GaiaTestCase.setUp(self) - self.connect_to_network() - self.install_marketplace() - - self.user = PersonaTestUser().create_user(verified=True, - env={"browserid": "firefoxos.persona.org", "verifier": "marketplace-dev.allizom.org"}) - - def test_marketplace_feedback_user(self): - # launch marketplace dev and go to marketplace - self.marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) - self.marketplace.launch() - - # wait for settings button to come out - self.marketplace.wait_for_setting_displayed() - settings = self.marketplace.tap_settings() - - # sign in with persona - persona = settings.tap_sign_in() - persona.login(self.user.email, self.user.password) - - # switch back to Marketplace - self.marionette.switch_to_frame() - self.marketplace.launch() - - # go to feedback tab - self.marketplace.select_setting_feedback() - - # enter and submit your feedback - self.marketplace.enter_feedback(self.test_comment) - self.marketplace.submit_feedback() - - # catch the notification - self.marketplace.wait_for_notification_message_displayed() - message_content = self.marketplace.notification_message - - # verify if the notification is right - self.assertEqual(message_content, self.feedback_submitted_message) diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_login.py b/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_login.py deleted file mode 100644 index f761d49965dc..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_login.py +++ /dev/null @@ -1,49 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from marionette.by import By -from gaiatest import GaiaTestCase -from gaiatest.apps.marketplace.app import Marketplace -from gaiatest.mocks.persona_test_user import PersonaTestUser - - -class TestMarketplaceLogin(GaiaTestCase): - - MARKETPLACE_DEV_NAME = 'Marketplace Dev' - - def setUp(self): - GaiaTestCase.setUp(self) - self.connect_to_network() - self.install_marketplace() - - self.user = PersonaTestUser().create_user(verified=True, - env={"browserid": "firefoxos.persona.org", "verifier": "marketplace-dev.allizom.org"}) - - self.marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) - self.marketplace.launch() - - def test_login_marketplace(self): - # https://moztrap.mozilla.org/manage/case/4134/ - - self.marketplace.wait_for_setting_displayed() - settings = self.marketplace.tap_settings() - persona = settings.tap_sign_in() - - persona.login(self.user.email, self.user.password) - - # switch back to Marketplace - self.marionette.switch_to_frame() - self.marketplace.launch() - - # wait for signed-in notification at the bottom of the screen to clear - self.marketplace.wait_for_notification_message_not_displayed() - - # Verify that user is logged in - self.assertEqual(self.user.email, settings.email) - - # Sign out, which should return to the Marketplace home screen - settings.tap_sign_out() - - # Verify that user is signed out - settings.wait_for_sign_in_displayed() diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_search_and_install_app.py b/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_search_and_install_app.py deleted file mode 100644 index e62f2763f970..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_search_and_install_app.py +++ /dev/null @@ -1,64 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from marionette.by import By -from gaiatest import GaiaTestCase -from gaiatest.apps.marketplace.app import Marketplace -from gaiatest.apps.homescreen.app import Homescreen - - -class TestSearchMarketplaceAndInstallApp(GaiaTestCase): - - MARKETPLACE_DEV_NAME = 'Marketplace Dev' - - APP_INSTALLED = False - - # System app confirmation button to confirm installing an app - _yes_button_locator = (By.ID, 'app-install-install-button') - - def setUp(self): - GaiaTestCase.setUp(self) - self.connect_to_network() - self.install_marketplace() - - 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 - - # 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)) - - def confirm_installation(self): - # TODO add this to the system app object when we have one - self.wait_for_element_displayed(*self._yes_button_locator) - self.marionette.find_element(*self._yes_button_locator).tap() - self.wait_for_element_not_displayed(*self._yes_button_locator) - - def tearDown(self): - - if self.APP_INSTALLED: - self.apps.uninstall(self.app_name) - - GaiaTestCase.tearDown(self) diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_search_for_paid_apps.py b/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_search_for_paid_apps.py deleted file mode 100644 index b3bcaccf8e14..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_search_for_paid_apps.py +++ /dev/null @@ -1,38 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -import re -from gaiatest import GaiaTestCase -from gaiatest.apps.marketplace.app import Marketplace - - -class TestSearchMarketplacePaidApp(GaiaTestCase): - - # System app confirmation button to confirm installing an app - - def setUp(self): - GaiaTestCase.setUp(self) - self.connect_to_network() - self.install_marketplace() - - 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) - - def tearDown(self): - GaiaTestCase.tearDown(self) diff --git a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_without_connectivity.py b/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_without_connectivity.py deleted file mode 100644 index a9b50b706be1..000000000000 --- a/tests/python/gaia-ui-tests/gaiatest/tests/functional/marketplace/test_marketplace_without_connectivity.py +++ /dev/null @@ -1,37 +0,0 @@ -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at http://mozilla.org/MPL/2.0/. - -from gaiatest import GaiaTestCase -from gaiatest.apps.marketplace.app import Marketplace - - -class TestMarketplaceWithoutConnectivity(GaiaTestCase): - - MARKETPLACE_DEV_NAME = 'Marketplace Dev' - - expected_error_title = u'Network connection unavailable' - expected_error_message = u'Marketplace Dev requires a network connection. Try connecting to a Wi-Fi or mobile data network.' - - def setUp(self): - GaiaTestCase.setUp(self) - - self.connect_to_network() - self.install_marketplace() - - # disable all potential data connections - if self.device.has_mobile_connection: - self.data_layer.disable_cell_data() - - if self.device.has_wifi: - self.data_layer.forget_all_networks() - self.data_layer.disable_wifi() - - def test_marketplace_without_connectivity(self): - marketplace = Marketplace(self.marionette, self.MARKETPLACE_DEV_NAME) - marketplace.launch() - - self.marionette.switch_to_frame() - - self.assertEqual(marketplace.error_title_text, self.expected_error_title) - self.assertEqual(marketplace.error_message_text, self.expected_error_message)