Пример #1
0
    def setUp(self):
        """Sets up the environment for a test case.

        Retreive already running test environment, or create a new one if
        one doesn't exist.  A test environment consists of a web
        server with HTTP and WebSocket handlers which tests can access
        through ``self.handler``.

        Then set up a Marionette session to the connected device if
        one does not already exist.  This is assigned to
        ``self.marionette``.  Marionette can be used to remote control
        the device.

        """

        super(TestCase, self).setUp()

        env = environment.get(InProcessTestEnvironment)

        try:
            if env.device_profile:
                self.check_skip(env.device_profile['webapi'])
        except:
            self.test_name = str(self.__class__).split('.')[1]

        self.server = env.server
        self.handler = env.handler

        self.assert_browser_connected()
        self.marionette = TestCase.create_marionette()

        if not certapp.is_installed():
            certapp.install(marionette=self.marionette, version=self.version)

        # Make sure we don't reuse the certapp context from a previous
        # testrun that was interrupted and left the certapp open.
        try:
            certapp.kill(self.marionette)
        except certapp.CloseError:
            self.close_app_manually()

        try:
            self.app = certapp.launch(self.marionette)
            self.showTestStatusInDevice(self.marionette)
        except certapp.LaunchError:
            self.launch_app_manually()
Пример #2
0
    def setUp(self):
        """Sets up the environment for a test case.

        Retreive already running test environment, or create a new one if
        one doesn't exist.  A test environment consists of a web
        server with HTTP and WebSocket handlers which tests can access
        through ``self.handler``.

        Then set up a Marionette session to the connected device if
        one does not already exist.  This is assigned to
        ``self.marionette``.  Marionette can be used to remote control
        the device.

        """

        super(TestCase, self).setUp()

        env = environment.get(InProcessTestEnvironment)

        try:
            if env.device_profile:
                self.check_skip(env.device_profile['webapi'])
        except:
            self.test_name = str(self.__class__).split('.')[1]

        self.server = env.server
        self.handler = env.handler

        self.assert_browser_connected()
        self.marionette = TestCase.create_marionette()

        if not certapp.is_installed():
            certapp.install(marionette=self.marionette, version=self.version)

        # Make sure we don't reuse the certapp context from a previous
        # testrun that was interrupted and left the certapp open.
        try:
            certapp.kill(self.marionette)
        except certapp.CloseError:
            self.close_app_manually()

        try:
            self.app = certapp.launch(self.marionette)
            self.showTestStatusInDevice(self.marionette)
        except certapp.LaunchError:
            self.launch_app_manually()
Пример #3
0
 def cleanup(self):
     if self.marionette is not None:
         certapp.kill(self.marionette, app=self.app)
Пример #4
0
 def cleanup(self):
     if self.marionette is not None:
         certapp.kill(self.marionette, app=self.app)