Exemplo n.º 1
0
 def setUpClass(cls):
     """Set up a new project."""
     os.chdir(TESTS_DIR)
     if is_device_rooted():
         test_utils.stop_app(PACKAGE_NAME)
     test_utils.remove_directories_if_exist([PROJECT_DIR])
     create_app.create_app([APP_NAME, DOMAIN])
Exemplo n.º 2
0
    def tearDown(self):

        if is_device_rooted():

            # Wait until the app was started successful
            time.sleep(6)

            self.assertTrue(test_utils.is_app_running(PACKAGE_NAME))
            test_utils.stop_app(PACKAGE_NAME)
Exemplo n.º 3
0
    def tearDown(self):
        self.assertTrue(os.path.exists(PROJECT_DIR))

        # Wait for termination of the app installation before checking
        time.sleep(6)
        self.assertTrue(test_utils.is_app_running(PACKAGE_NAME))
        if is_device_rooted():
            test_utils.stop_app(PACKAGE_NAME)
        os.chdir(TESTS_DIR)
        test_utils.remove_directories_if_exist([PROJECT_DIR])
Exemplo n.º 4
0
 def setUp(self):
     """
     Explicitly remove previous test projects, to be sure a new one is
     created.
     """
     os.chdir(TESTS_DIR)
     if is_device_rooted():
         test_utils.stop_app(PACKAGE_NAME)
         self.assertFalse(test_utils.is_app_running(PACKAGE_NAME))
     test_utils.remove_directories_if_exist([PROJECT_DIR])
     self.assertFalse(os.path.exists(PROJECT_DIR))
Exemplo n.º 5
0
    def setUpClass(cls):
        """Create a new test project and install and run it properly."""

        if is_device_rooted():
            os.chdir(TESTS_DIR)
            test_utils.stop_app(PACKAGE_NAME)
            hello_world.hello_world(show_log=False)

            # Wait for termination of the app installation before doing fast deploys.
            time.sleep(6)
            test_utils.stop_app(PACKAGE_NAME)
Exemplo n.º 6
0
    def test_examples(self):
        """Test deploying all examples."""

        for example_name in self.conf.sections():
            os.chdir(TESTS_DIR)
            app_name = example_name + create_example.APP_NAME_SUFFIX
            package_name = "%s.%s" % (create_example.DOMAIN, app_name)
            project_dir = os.path.join(TESTS_DIR, app_name)
            test_utils.remove_directories_if_exist([project_dir])

            self.assertFalse(os.path.exists(project_dir))

            if is_device_rooted():
                test_utils.stop_app(package_name)
                self.assertFalse(test_utils.is_app_running(package_name))

            create_example.create_example([example_name])
            self.assertTrue(os.path.exists(project_dir))
            complete_deploy.complete_deploy()
            time.sleep(8)
            self.assertTrue(test_utils.is_app_running(package_name))
            if is_device_rooted():
                test_utils.stop_app(package_name)
            test_utils.remove_directories_if_exist([project_dir])
Exemplo n.º 7
0
    def test_examples(self):
        """Test deploying all examples."""

        for example_name in self.conf.sections():
            os.chdir(TESTS_DIR)
            app_name = example_name + create_example.APP_NAME_SUFFIX
            package_name = "%s.%s" % (create_example.DOMAIN, app_name)
            project_dir = os.path.join(TESTS_DIR, app_name)
            test_utils.remove_directories_if_exist([project_dir])

            self.assertFalse(os.path.exists(project_dir))

            if is_device_rooted():
                test_utils.stop_app(package_name)
                self.assertFalse(test_utils.is_app_running(package_name))

            create_example.create_example([example_name])
            self.assertTrue(os.path.exists(project_dir))
            complete_deploy.complete_deploy()
            time.sleep(8)
            self.assertTrue(test_utils.is_app_running(package_name))
            if is_device_rooted():
                test_utils.stop_app(package_name)
            test_utils.remove_directories_if_exist([project_dir])
Exemplo n.º 8
0
 def tearDown(self):
     # Wait for termination of the app installation before checking
     time.sleep(6)
     self.assertTrue(test_utils.is_app_running(PACKAGE_NAME))
     if is_device_rooted():
         test_utils.stop_app(PACKAGE_NAME)