Exemple #1
0
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)
        self.UTILS = UTILS(self)
        self.actions = Actions(self.marionette)
        self.settings = Settings(self)
        self.eme = EverythingMe(self)
        self.cat_id = "207"
        self.app_name = "Pacman"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.data_layer.connect_to_wifi()

        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)

        # First of all, make sure an application is installed
        self.eme.install_app(self.cat_id, self.app_name)
        self.UTILS.home.goHome()

        # Then, proceed to uninstall the application through the Edit mode
        self.UTILS.app.uninstallApp(self.app_name)
Exemple #2
0
class test_main(GaiaTestCase):

    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.EME = EverythingMe(self)
        self.settings = Settings(self)
        self.cat_id = "207"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)

        # Select a category (group).
        self.EME.pick_group(self.cat_id)

        # Verify that the message is displayed.
        self.UTILS.element.waitForElements(DOM.EME.offline_message,
                                   "Connection message (without using with a network first)", timeout=30)
Exemple #3
0
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.EME = EverythingMe(self)

        self.UTILS.app.setPermission('Homescreen', 'geolocation', 'deny')
Exemple #4
0
class test_main(GaiaTestCase):

    def setUp(self):
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.eme = EverythingMe(self)
        self.cat_id = "207"
        self.app_name = "Pacman"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.data_layer.connect_to_wifi()

        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)

        # Launch the group
        self.eme.pick_group(self.cat_id)
        time.sleep(3)
        pacman = self.UTILS.element.getElementByXpath(DOM.EME.app_to_install.format(self.app_name))
        pacman_url = pacman.get_attribute("data-identifier")
        self.UTILS.reporting.debug("Pacman URL: {}".format(pacman_url))
        pacman.tap()
        time.sleep(5)
        self.UTILS.iframe.switchToFrame("src", pacman_url)
        content = self.UTILS.element.getElement(DOM.EME.game_content, "Game contents")
        self.UTILS.test.test(content, "Game content found")

        self.marionette.switch_to_frame()
        menu = self.UTILS.element.getElement(DOM.EME.launched_menu_button, "Menu button")
        menu.tap()
        add_btn = self.UTILS.element.getElement(DOM.EME.launched_add_to_homescreen, "Add to homescreen button")
        add_btn.tap()
        self.UTILS.iframe.switchToFrame(*DOM.EME.bookmark_frame_locator)
        done_btn = self.UTILS.element.getElement(DOM.EME.add_to_homescreen_done_btn, "Add Done button")
        done_btn.tap()

        self.apps.kill_all()
        time.sleep(2)

        icon = self.UTILS.app.findAppIcon(self.app_name)
        self.UTILS.test.test(icon, "Icon for application {} was found".format(self.app_name))

        time.sleep(3)
        self.UTILS.app.uninstallApp(self.app_name)
Exemple #5
0
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.EME = EverythingMe(self)
        self.settings = Settings(self)
        self.cat_id = "207"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")
Exemple #6
0
class test_main(GaiaTestCase):

    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    _GROUP_NAME = "Games"

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.EME = EverythingMe(self)

        # Don't prompt me for geolocation
        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")

        self.cat_id = "289"

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.data_layer.connect_to_wifi()

        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)
        self.EME.pick_group(self.cat_id)
        self.UTILS.iframe.switchToFrame(*DOM.EME.frame_locator)
        app_name = self.UTILS.element.getElementByXpath(DOM.EME.app_to_install.format("Line")).text
        self.EME.add_app_to_homescreen(app_name)

        self.UTILS.iframe.switchToFrame(*DOM.EME.bookmark_frame_locator)
        time.sleep(2)
        add_btn = self.UTILS.element.getElement(DOM.EME.add_to_homescreen_done_btn,
                                                "Add bookmark to Home Screen Button")
        add_btn.tap()
        time.sleep(4)

        self.UTILS.home.goHome()
        self.UTILS.app.uninstallApp(app_name)
Exemple #7
0
class test_main(GaiaTestCase):
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.eme = EverythingMe(self)
        self.actions = Actions(self.marionette)
        self.cat_id = "207"
        self.app_name = "Pacman"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation',
                                     'deny')
        except:
            self.UTILS.reporting.logComment(
                "Unable to automatically set geolocation permission.")

        # Try to uninstall app, just in case it was previously installed
        self.UTILS.app.uninstallApp(self.app_name)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.data_layer.connect_to_wifi()

        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)

        # First of all, make sure an application is installed
        installed = self.eme.install_app(self.cat_id, self.app_name)
        self.UTILS.test.test(
            installed, "The application {} was successfully installed".format(
                self.app_name))

        # Go back and try to reinstall again
        self.UTILS.home.goHome()
        installed = self.eme.install_app(self.cat_id, self.app_name, False)
        self.UTILS.test.test(not installed, "The application {} was already previously installed".\
                                            format(self.app_name))

        self.UTILS.app.uninstallApp(self.app_name)
Exemple #8
0
class test_main(GaiaTestCase):
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.EME = EverythingMe(self)

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation',
                                     'deny')
        except:
            self.UTILS.reporting.logComment(
                "Unable to automatically set geolocation permission.")

        self.ids = ["289", "207", "142"]

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Make sure 'things' are as we expect them to be first.
        self.connect_to_network()

        for i in range(3):
            self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)
            self.EME.pick_group(self.ids[i])
            time.sleep(2)
            self.UTILS.iframe.switch_to_frame(*DOM.EME.frame_locator)
            items = self.UTILS.element.getElements(
                DOM.EME.apps_not_installed, "Getting available applications")
            group_name = self.UTILS.element.getElement(
                DOM.EME.bookmark_group_name, "Bookmark group name")
            self.UTILS.test.test(items, "There are {} applications available for group {}".\
                                        format(len(items), group_name.text))
            self.marionette.find_element('css selector',
                                         'gaia-header[action=close]').tap(
                                             25, 25)
Exemple #9
0
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.eme = EverythingMe(self)
        self.actions = Actions(self.marionette)
        self.cat_id = "207"
        self.app_name = "Pacman"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")

        # Try to uninstall app, just in case it was previously installed
        self.UTILS.app.uninstallApp(self.app_name)

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.data_layer.connect_to_wifi()

        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)

        # First of all, make sure an application is installed
        installed = self.eme.install_app(self.cat_id, self.app_name)
        self.UTILS.test.test(installed, "The application {} was successfully installed".format(self.app_name))

        # Go back and try to reinstall again
        self.UTILS.home.goHome()
        installed = self.eme.install_app(self.cat_id, self.app_name, False)
        self.UTILS.test.test(not installed, "The application {} was already previously installed".\
                                            format(self.app_name))

        self.UTILS.app.uninstallApp(self.app_name)
Exemple #10
0
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS      = UTILS(self)
        self.settings   = Settings(self)
        self.EME        = EverythingMe(self)

        self.UTILS.app.setPermission('Homescreen', 'geolocation', 'deny')
Exemple #11
0
class test_main(GaiaTestCase):
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.eme = EverythingMe(self)
        self.cat_id = "207"
        self.app_name = "Pacman"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation',
                                     'deny')
        except:
            self.UTILS.reporting.logComment(
                "Unable to automatically set geolocation permission.")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.data_layer.connect_to_wifi()

        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)

        # Launch the group
        self.eme.pick_group(self.cat_id)
        time.sleep(3)
        pacman = self.UTILS.element.getElementByXpath(
            DOM.EME.app_to_install.format(self.app_name))
        pacman_url = pacman.get_attribute("data-identifier")
        self.UTILS.reporting.debug("Pacman URL: {}".format(pacman_url))
        pacman.tap()
        time.sleep(5)
        self.UTILS.iframe.switchToFrame("src", pacman_url)
        content = self.UTILS.element.getElement(DOM.EME.game_content,
                                                "Game contents")
        self.UTILS.test.test(content, "Game content found")
Exemple #12
0
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.eme = EverythingMe(self)
        self.cat_id = "207"
        self.app_name = "Pacman"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.data_layer.connect_to_wifi()

        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)

        # Launch the group
        self.eme.pick_group(self.cat_id)
        time.sleep(3)
        pacman = self.UTILS.element.getElementByXpath(DOM.EME.app_to_install.format(self.app_name))
        pacman_url = pacman.get_attribute("data-identifier")
        self.UTILS.reporting.debug("Pacman URL: {}".format(pacman_url))
        pacman.tap()
        time.sleep(5)
        self.UTILS.iframe.switchToFrame("src", pacman_url)
        content = self.UTILS.element.getElement(DOM.EME.game_content, "Game contents")
        self.UTILS.test.test(content, "Game content found")
Exemple #13
0
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.eme = EverythingMe(self)
        self.actions = Actions(self.marionette)
        self.cat_id = "207"
        self.app_name = "Pacman"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation',
                                     'deny')
        except:
            self.UTILS.reporting.logComment(
                "Unable to automatically set geolocation permission.")

        # Try to uninstall app, just in case it was previously installed
        self.UTILS.app.uninstallApp(self.app_name)
Exemple #14
0
class test_main(GaiaTestCase):

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.EME = EverythingMe(self)

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")

        self.ids = ["289", "207", "142"]

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Make sure 'things' are as we expect them to be first.
        self.connect_to_network()

        for i in range(3):
            self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)
            self.EME.pick_group(self.ids[i])
            time.sleep(2)
            self.UTILS.iframe.switch_to_frame(*DOM.EME.frame_locator)
            items = self.UTILS.element.getElements(DOM.EME.apps_not_installed, "Getting available applications")
            group_name = self.UTILS.element.getElement(DOM.EME.bookmark_group_name, "Bookmark group name")
            self.UTILS.test.test(items, "There are {} applications available for group {}".\
                                        format(len(items), group_name.text))
            self.marionette.find_element('css selector', 'gaia-header[action=close]').tap(25, 25)
Exemple #15
0
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.eme = EverythingMe(self)
        self.cat_id = "207"
        self.app_name = "Pacman"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")
Exemple #16
0
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.EME = EverythingMe(self)

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.error(
                "Unable to automatically set Homescreen geolocation permission."
            )
Exemple #17
0
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.EME = EverythingMe(self)

        # Don't prompt me for geolocation
        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")
Exemple #18
0
    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.eme = EverythingMe(self)
        self.actions = Actions(self.marionette)
        self.cat_id = "207"
        self.app_name = "Pacman"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")

        # Try to uninstall app, just in case it was previously installed
        self.UTILS.app.uninstallApp(self.app_name)
Exemple #19
0
class test_main(GaiaTestCase):

    _newGroup = "Sports"

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS      = UTILS(self)
        self.settings   = Settings(self)
        self.EME        = EverythingMe(self)

        self.UTILS.app.setPermission('Homescreen', 'geolocation', 'deny')

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Make sure 'things' are as we expect them to be first.
        self.connect_to_network()

        # Launch the 'everything.me' app.
        self.UTILS.reporting.logResult("info", "Launching EME ...")
        self.EME.launch()

        # Make sure our group isn't already present.
        #self.EME.remove_groups([self._newGroup], p_validate=False)
        #self.EME.remove_groups([self._newGroup], p_validate=False)
        self.EME.remove_groups([self._newGroup])

        # Add the group.
        self.EME.add_group(self._newGroup)

        # Remove the group.
        self.EME.remove_groups([self._newGroup])
Exemple #20
0
class test_main(GaiaTestCase):

    _newGroup = "Sports"

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.EME = EverythingMe(self)

        self.UTILS.app.setPermission('Homescreen', 'geolocation', 'deny')

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Make sure 'things' are as we expect them to be first.
        self.connect_to_network()

        # Launch the 'everything.me' app.
        self.UTILS.reporting.logResult("info", "Launching EME ...")
        self.EME.launch()

        # Make sure our group isn't already present.
        #self.EME.remove_groups([self._newGroup], p_validate=False)
        #self.EME.remove_groups([self._newGroup], p_validate=False)
        self.EME.remove_groups([self._newGroup])

        # Add the group.
        self.EME.add_group(self._newGroup)

        # Remove the group.
        self.EME.remove_groups([self._newGroup])
Exemple #21
0
class test_main(GaiaTestCase):
    def setUp(self):
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.eme = EverythingMe(self)
        self.cat_id = "207"
        self.app_name = "Pacman"

        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation',
                                     'deny')
        except:
            self.UTILS.reporting.logComment(
                "Unable to automatically set geolocation permission.")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):
        self.data_layer.connect_to_wifi()

        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)

        # Launch the group
        self.eme.pick_group(self.cat_id)
        time.sleep(3)
        pacman = self.UTILS.element.getElementByXpath(
            DOM.EME.app_to_install.format(self.app_name))
        pacman_url = pacman.get_attribute("data-identifier")
        self.UTILS.reporting.debug("Pacman URL: {}".format(pacman_url))
        pacman.tap()
        time.sleep(5)
        self.UTILS.iframe.switchToFrame("src", pacman_url)
        content = self.UTILS.element.getElement(DOM.EME.game_content,
                                                "Game contents")
        self.UTILS.test.test(content, "Game content found")

        self.marionette.switch_to_frame()
        menu = self.UTILS.element.getElement(DOM.EME.launched_menu_button,
                                             "Menu button")
        menu.tap()
        add_btn = self.UTILS.element.getElement(
            DOM.EME.launched_add_to_homescreen, "Add to homescreen button")
        add_btn.tap()
        self.UTILS.iframe.switchToFrame(*DOM.EME.bookmark_frame_locator)
        done_btn = self.UTILS.element.getElement(
            DOM.EME.add_to_homescreen_done_btn, "Add Done button")
        done_btn.tap()

        self.apps.kill_all()
        time.sleep(2)

        icon = self.UTILS.app.findAppIcon(self.app_name)
        self.UTILS.test.test(
            icon, "Icon for application {} was found".format(self.app_name))

        time.sleep(3)
        self.UTILS.app.uninstallApp(self.app_name)
Exemple #22
0
class test_main(GaiaTestCase):

    _group_name = "Games"
    _group_games_id = "207"

    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.EME = EverythingMe(self)

        # Don't prompt me for geolocation
        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation', 'deny')
        except:
            self.UTILS.reporting.logComment("Unable to automatically set geolocation permission.")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Make sure 'things' are as we expect them to be first.
        self.connect_to_network()

        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)

        # First, get the name of the app we're going to install.
        time.sleep(3)
        found = self.EME.pick_group(self._group_games_id)
        self.UTILS.reporting.debug("*** Group found: {}".format(found))
        self.UTILS.test.test(found, "Group '{}' exists in EverythingME.".format(self._group_name), True)

        self.UTILS.iframe.switchToFrame(*DOM.EME.frame_locator)
        app_name = self.UTILS.element.getElementByXpath(DOM.EME.app_to_install.format("Pacman")).text
        self.UTILS.reporting.logResult("info", "App name is <b>{}</b>".format(app_name))
        self.UTILS.home.goHome()

        # Make sure our app isn't installed already.
        self.UTILS.app.uninstallApp(app_name)

        # Pick a group.
        found = self.EME.pick_group(self._group_games_id)
        self.UTILS.test.test(found, "Group '{}' exists in EverythingME.".format(self._group_name), True)
        time.sleep(2)

        # Add the app to the homescreen.
        added = self.EME.add_app_to_homescreen(app_name)

        self.UTILS.iframe.switchToFrame(*DOM.EME.bookmark_frame_locator)
        time.sleep(4)
        add_btn = self.UTILS.element.getElement(DOM.EME.add_to_homescreen_done_btn,
                                                "Add bookmark to Home Screen Button")
        add_btn.tap()

        self.UTILS.test.test(added, "Application '{}' is added to the homescreen.".format(app_name), True)

        # Go back to the homescreen and check it's installed.
        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)
        self.UTILS.test.test(self.UTILS.app.launchAppViaHomescreen(app_name), app_name + " is installed.", True)

        # Give it 10 seconds to start up, switch to the frame for it and grab a screenshot.
        time.sleep(3)
        self.marionette.switch_to_frame()
        iframe = self.marionette.find_element('css selector', 'iframe.browser:not(.hidden)')
        self.marionette.switch_to_frame(iframe)

        screenshot = self.UTILS.debug.screenShot(app_name)
        self.UTILS.reporting.logResult("info", "NOTE: For a screenshot of the game running, please see this: " +
                                       screenshot)
Exemple #23
0
class test_main(GaiaTestCase):

    _group_name = "Games"
    _group_games_id = "207"

    def __init__(self, *args, **kwargs):
        kwargs['restart'] = True
        super(test_main, self).__init__(*args, **kwargs)

    def setUp(self):

        # Set up child objects...
        GaiaTestCase.setUp(self)

        self.UTILS = UTILS(self)
        self.settings = Settings(self)
        self.EME = EverythingMe(self)

        # Don't prompt me for geolocation
        try:
            self.apps.set_permission('Homescreen', 'geolocation', 'deny')
            self.apps.set_permission('Smart Collections', 'geolocation',
                                     'deny')
        except:
            self.UTILS.reporting.logComment(
                "Unable to automatically set geolocation permission.")

    def tearDown(self):
        self.UTILS.reporting.reportResults()
        GaiaTestCase.tearDown(self)

    def test_run(self):

        # Make sure 'things' are as we expect them to be first.
        self.connect_to_network()

        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)

        # First, get the name of the app we're going to install.
        time.sleep(3)
        found = self.EME.pick_group(self._group_games_id)
        self.UTILS.reporting.debug("*** Group found: {}".format(found))
        self.UTILS.test.test(
            found,
            "Group '{}' exists in EverythingME.".format(self._group_name),
            True)

        self.UTILS.iframe.switchToFrame(*DOM.EME.frame_locator)
        app_name = self.UTILS.element.getElementByXpath(
            DOM.EME.app_to_install.format("Pacman")).text
        self.UTILS.reporting.logResult(
            "info", "App name is <b>{}</b>".format(app_name))
        self.UTILS.home.goHome()

        # Make sure our app isn't installed already.
        self.UTILS.app.uninstallApp(app_name)

        # Pick a group.
        found = self.EME.pick_group(self._group_games_id)
        self.UTILS.test.test(
            found,
            "Group '{}' exists in EverythingME.".format(self._group_name),
            True)
        time.sleep(2)

        # Add the app to the homescreen.
        added = self.EME.add_app_to_homescreen(app_name)

        self.UTILS.iframe.switchToFrame(*DOM.EME.bookmark_frame_locator)
        time.sleep(4)
        add_btn = self.UTILS.element.getElement(
            DOM.EME.add_to_homescreen_done_btn,
            "Add bookmark to Home Screen Button")
        add_btn.tap()

        self.UTILS.test.test(
            added,
            "Application '{}' is added to the homescreen.".format(app_name),
            True)

        # Go back to the homescreen and check it's installed.
        self.UTILS.iframe.switchToFrame(*DOM.Home.frame_locator)
        self.UTILS.test.test(self.UTILS.app.launchAppViaHomescreen(app_name),
                             app_name + " is installed.", True)

        # Give it 10 seconds to start up, switch to the frame for it and grab a screenshot.
        time.sleep(3)
        self.marionette.switch_to_frame()
        iframe = self.marionette.find_element('css selector',
                                              'iframe.browser:not(.hidden)')
        self.marionette.switch_to_frame(iframe)

        screenshot = self.UTILS.debug.screenShot(app_name)
        self.UTILS.reporting.logResult(
            "info",
            "NOTE: For a screenshot of the game running, please see this: " +
            screenshot)