Esempio n. 1
0
 def setUpClass(cls):
     BaseClass.setUpClass(cls.__name__)
     Process.kill('Safari')
     Process.kill('NativeScript Inspector')
     Emulator.stop()
     Simulator.stop()
     cls.SIMULATOR_ID = Simulator.ensure_available(
         simulator_name=SIMULATOR_NAME)
     Folder.cleanup(cls.INSPECTOR_GLOBAL_PATH)
     Tns.create_app(cls.app_name,
                    attributes={
                        '--template':
                        os.path.join('data', 'apps',
                                     'livesync-hello-world.tgz')
                    },
                    update_modules=True)
     Tns.platform_add_ios(attributes={
         '--path': cls.app_name,
         '--frameworkPath': IOS_PACKAGE
     })
     if USE_YARN == "True":
         Npm.install(package=IOS_INSPECTOR_PACKAGE,
                     option='--dev',
                     folder=cls.app_name)
     else:
         Npm.install(package=IOS_INSPECTOR_PACKAGE,
                     option='--save-dev',
                     folder=cls.app_name)
     Tns.build_ios(attributes={"--path": cls.app_name})
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Emulator.stop()
        Emulator.ensure_available()

        Tns.create_app(cls.app_name, update_modules=True)
        Tns.install_npm(package=WEBPACK_PACKAGE, option='--save-dev', folder=cls.app_name)
        Tns.platform_add_android(attributes={"--path": cls.app_name, "--frameworkPath": ANDROID_PACKAGE})
 def tearDownClass(cls):
     Tns.kill()
     Emulator.stop()
     Gradle.kill()
     if CURRENT_OS == OSType.OSX:
         Process.kill('NativeScript Inspector')
         Process.kill('Safari')
         Simulator.stop()
Esempio n. 4
0
 def tearDownClass(cls):
     Tns.kill()
     Emulator.stop()
     Gradle.kill()
     if CURRENT_OS == OSType.OSX:
         Process.kill('NativeScript Inspector')
         Process.kill('Safari')
         Simulator.stop()
 def setUpClass(cls):
     BaseClass.setUpClass(cls.__name__)
     Emulator.stop()
     Device.ensure_available(platform=Platform.ANDROID)
     Device.uninstall_app(app_prefix="org.nativescript.", platform=Platform.ANDROID)
     Tns.create_app(cls.app_name,
                    attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                    update_modules=True)
     Tns.platform_add_android(attributes={'--path': cls.app_name, '--frameworkPath': ANDROID_PACKAGE})
 def test_300_tns_run_android_emulator_should_start_emulator_even_if_device_is_connected(self):
     """
     `tns run android --emulator` should start emulator even if physical device is connected
     """
     Emulator.stop()
     output = Tns.run_android(
         attributes={'--path': self.app_name, '--timeout': '180', '--emulator': '', '--justlaunch': ''},
         assert_success=False)
     assert 'Starting Android emulator with image' in output
     assert Emulator.wait(device_id=EMULATOR_ID), 'Emulator not started by `tns run android`!'
Esempio n. 7
0
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Emulator.stop()
        Device.uninstall_app(app_prefix="org.nativescript.", platform=Platform.ANDROID)
        Emulator.ensure_available()
        Folder.cleanup(cls.app_name)

        # Create default NG app (to get right dependencies from package.json)
        Tns.create_app_ng(cls.app_name)
        Tns.platform_add_android(attributes={'--path': cls.app_name, '--frameworkPath': ANDROID_PACKAGE}) 
 def setUp(self):
     BaseClass.setUp(self)
     Folder.cleanup(self.source_app)
     if CURRENT_OS != OSType.WINDOWS:
         Folder.copy(self.temp_app, self.source_app)
     else:
         Tns.create_app(self.app_name,
                        attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                        update_modules=True)
         Tns.platform_add_android(attributes={'--path': self.app_name, '--frameworkPath': ANDROID_PACKAGE})
         Emulator.ensure_available()
 def test_310_tns_run_android_emulator_should_run_only_on_emulator(self):
     """
     `tns run android --emulator` should start emulator even if physical device is connected
     """
     Emulator.stop()
     Emulator.ensure_available()
     output = Tns.run_android(attributes={'--path': self.app_name, '--emulator': '', '--justlaunch': ''},
                              assert_success=False)
     assert 'Starting Android emulator with image' not in output
     assert EMULATOR_ID in output
     for device_id in self.DEVICES:
         assert device_id not in output, 'Application is deployed on {0} device.'.format(device_id)
Esempio n. 10
0
 def setUpClass(cls):
     BaseClass.setUpClass(cls.__name__)
     Emulator.stop()
     Simulator.stop()
     cls.SIMULATOR_ID = Simulator.ensure_available(simulator_name=SIMULATOR_NAME)
     Folder.cleanup(cls.app_name)
     Tns.create_app(cls.app_name,
                    attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                    update_modules=True)
     Tns.platform_add_ios(attributes={'--path': cls.app_name, '--frameworkPath': IOS_PACKAGE})
     Folder.cleanup(TEST_RUN_HOME + "/data/TestApp")
     Folder.copy(TEST_RUN_HOME + "/" + cls.app_name, TEST_RUN_HOME + "/data/TestApp")
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Emulator.stop()
        Simulator.stop()
        Device.ensure_available(platform=Platform.IOS)
        Device.uninstall_app(app_prefix='org.nativescript.', platform=Platform.IOS)

        Folder.cleanup(cls.app_name)
        Tns.create_app(cls.app_name,
                       attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                       update_modules=True)
        Folder.copy(src=os.path.join(cls.app_name, 'app'), dst=cls.TEMP_FOLDER)
        Tns.platform_add_ios(attributes={'--path': cls.app_name, '--frameworkPath': IOS_PACKAGE})
 def setUpClass(cls):
     BaseClass.setUpClass(cls.__name__)
     Tns.kill()
     Emulator.stop()
     Emulator.ensure_available()
     Device.uninstall_app(app_prefix="org.nativescript.", platform=Platform.ANDROID)
     if CURRENT_OS != OSType.WINDOWS:
         Tns.create_app(cls.app_name,
                        attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                        update_modules=True)
         Tns.platform_add_android(attributes={'--path': cls.app_name, '--frameworkPath': ANDROID_PACKAGE})
         Folder.cleanup(cls.temp_app)
         Folder.copy(cls.source_app, cls.temp_app)
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Emulator.stop()
        Emulator.ensure_available()

        Tns.create_app(BaseClass.app_name)
        Tns.platform_add_android(attributes={"--path": BaseClass.app_name, "--frameworkPath": ANDROID_PACKAGE})
        Tns.update_webpack(BaseClass.app_name)
        Folder.copy(os.path.join(TEST_RUN_HOME, BaseClass.app_name), os.path.join(TEST_RUN_HOME, "data", "TestApp"))

        #Download bundletool
        url = 'https://github.com/google/bundletool/releases/download/0.8.0/bundletool-all-0.8.0.jar'
        urllib.urlretrieve(url, os.path.join(SUT_FOLDER, 'bundletool.jar'))
Esempio n. 14
0
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Emulator.stop()
        Emulator.ensure_available()

        Tns.create_app(cls.app_name, update_modules=True)
        Tns.install_npm(package=WEBPACK_PACKAGE,
                        option='--save-dev',
                        folder=cls.app_name)
        Tns.platform_add_android(attributes={
            "--path": cls.app_name,
            "--frameworkPath": ANDROID_PACKAGE
        })
Esempio n. 15
0
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Emulator.stop()
        Emulator.ensure_available()

        Tns.create_app(BaseClass.app_name)
        Tns.platform_add_android(attributes={
            "--path": BaseClass.app_name,
            "--frameworkPath": ANDROID_PACKAGE
        })
        Tns.update_webpack(BaseClass.app_name)
        Folder.copy(os.path.join(TEST_RUN_HOME, BaseClass.app_name),
                    os.path.join(TEST_RUN_HOME, "data", "TestApp"))

        #Download bundletool
        url = 'https://github.com/google/bundletool/releases/download/0.8.0/bundletool-all-0.8.0.jar'
        urllib.urlretrieve(url, os.path.join(SUT_FOLDER, 'bundletool.jar'))
 def setUpClass(cls):
     BaseClass.setUpClass(cls.__name__)
     Process.kill('Safari')
     Process.kill('NativeScript Inspector')
     Emulator.stop()
     Simulator.stop()
     cls.SIMULATOR_ID = Simulator.ensure_available(simulator_name=SIMULATOR_NAME)
     Folder.cleanup(cls.INSPECTOR_GLOBAL_PATH)
     Tns.create_app(cls.app_name,
                    attributes={'--template': os.path.join('data', 'apps', 'livesync-hello-world.tgz')},
                    update_modules=True)
     Tns.platform_add_ios(attributes={'--path': cls.app_name, '--frameworkPath': IOS_PACKAGE})
     if USE_YARN == "True":
         Npm.install(package=IOS_INSPECTOR_PACKAGE, option='--dev', folder=cls.app_name)
     else:
         Npm.install(package=IOS_INSPECTOR_PACKAGE, option='--save-dev', folder=cls.app_name)
     Tns.build_ios(attributes={"--path": cls.app_name})
Esempio n. 17
0
 def setUp(self):
     BaseClass.setUp(self)
     Folder.cleanup(self.source_app)
     if CURRENT_OS != OSType.WINDOWS:
         Folder.copy(self.temp_app, self.source_app)
     else:
         Tns.create_app(self.app_name,
                        attributes={
                            '--template':
                            os.path.join('data', 'apps',
                                         'livesync-hello-world.tgz')
                        },
                        update_modules=True)
         Tns.platform_add_android(attributes={
             '--path': self.app_name,
             '--frameworkPath': ANDROID_PACKAGE
         })
         Emulator.ensure_available()
Esempio n. 18
0
 def setUpClass(cls):
     BaseClass.setUpClass(cls.__name__)
     Tns.kill()
     Emulator.stop()
     Emulator.ensure_available()
     Device.uninstall_app(app_prefix="org.nativescript.",
                          platform=Platform.ANDROID)
     if CURRENT_OS != OSType.WINDOWS:
         Tns.create_app(cls.app_name,
                        attributes={
                            '--template':
                            os.path.join('data', 'apps',
                                         'livesync-hello-world.tgz')
                        },
                        update_modules=True)
         Tns.platform_add_android(attributes={
             '--path': cls.app_name,
             '--frameworkPath': ANDROID_PACKAGE
         })
         Folder.cleanup(cls.temp_app)
         Folder.copy(cls.source_app, cls.temp_app)
Esempio n. 19
0
    def setUpClass(cls):
        BaseClass.setUpClass(cls.__name__)
        Emulator.stop()
        Simulator.stop()
        Device.ensure_available(platform=Platform.IOS)
        Device.uninstall_app(app_prefix='org.nativescript.',
                             platform=Platform.IOS)

        Folder.cleanup(cls.app_name)
        Tns.create_app(cls.app_name,
                       attributes={
                           '--template':
                           os.path.join('data', 'apps',
                                        'livesync-hello-world.tgz')
                       },
                       update_modules=True)
        Folder.copy(src=os.path.join(cls.app_name, 'app'), dst=cls.TEMP_FOLDER)
        Tns.platform_add_ios(attributes={
            '--path': cls.app_name,
            '--frameworkPath': IOS_PACKAGE
        })
Esempio n. 20
0
             output_file=os.path.join(SUT_FOLDER,
                                      'tns-template-hello-world-ng.tgz'))


if __name__ == '__main__':

    # Cleanup files and folders created by the test execution
    Folder.cleanup(OUTPUT_FOLDER)
    Folder.create(OUTPUT_FOLDER)
    Folder.cleanup(SUT_FOLDER)
    Folder.cleanup("node_modules")
    Npm.cache_clean()
    Gradle.kill()
    Gradle.cache_clean()
    get_repos()
    Emulator.stop()  # Stop running emulators

    # Copy test packages and cleanup
    if CURRENT_OS == OSType.OSX:
        Simulator.stop()
        disable_crash_report()
        get_test_packages(platform=Platform.BOTH)
        Simulator.reset()

        if Xcode.get_version() < 10:
            SIMULATOR_SDK = '11.0'
        if Xcode.get_version() < 9:
            SIMULATOR_SDK = '10.0'

        Simulator.create(SIMULATOR_NAME, SIMULATOR_TYPE, SIMULATOR_SDK)
        Xcode.cleanup_cache()  # Clean Xcode cache folders
Esempio n. 21
0
 def tearDownClass(cls):
     BaseClass.tearDownClass()
     Emulator.stop()
Esempio n. 22
0
 def tearDownClass(cls):
     BaseClass.tearDownClass()
     Emulator.stop()
     Folder.cleanup(TEST_RUN_HOME + "/data/TestApp")
    Npm.pack(folder=os.path.join(SUT_FOLDER, 'template-hello-world-ng'),
             output_file=os.path.join(SUT_FOLDER, 'tns-template-hello-world-ng.tgz'))


if __name__ == '__main__':

    # Cleanup files and folders created by the test execution
    Folder.cleanup(OUTPUT_FOLDER)
    Folder.create(OUTPUT_FOLDER)
    Folder.cleanup(SUT_FOLDER)
    Folder.cleanup("node_modules")
    Npm.cache_clean()
    Gradle.kill()
    Gradle.cache_clean()
    get_repos()
    Emulator.stop()  # Stop running emulators

    # Copy test packages and cleanup
    if CURRENT_OS == OSType.OSX:
        Simulator.stop()
        disable_crash_report()
        get_test_packages(platform=Platform.BOTH)
        Simulator.reset()

        if Xcode.get_version() < 10:
            SIMULATOR_SDK = '11.0'
        if Xcode.get_version() < 9:
            SIMULATOR_SDK = '10.0'
        

        Simulator.create(SIMULATOR_NAME, SIMULATOR_TYPE, SIMULATOR_SDK)
 def tearDownClass(cls):
     BaseClass.tearDownClass()
     Emulator.stop()  # We need this because of test_400_tns_run_android_respect_adb_errors
     Folder.cleanup(cls.temp_app)
 def tearDown(self):
     Tns.kill()
     if CURRENT_OS == OSType.WINDOWS:
         Emulator.stop()
     BaseClass.tearDown(self)
     Folder.cleanup('TestApp2')
Esempio n. 26
0
 def tearDownClass(cls):
     BaseClass.tearDownClass()
     Emulator.stop(
     )  # We need this because of test_400_tns_run_android_respect_adb_errors
     Folder.cleanup(cls.temp_app)
Esempio n. 27
0
 def tearDown(self):
     Tns.kill()
     if CURRENT_OS == OSType.WINDOWS:
         Emulator.stop()
     BaseClass.tearDown(self)
     Folder.cleanup('TestApp2')