def test_102_ng_app_ipa(self):
     ipa = TnsPaths.get_ipa_path(app_name=self.ng_app,
                                 release=True,
                                 for_device=True)
     assert PerfUtils.is_value_in_range(actual=File.get_size(ipa),
                                        expected=16226626,
                                        tolerance=0.05)
    def build(app_name,
              platform,
              release=False,
              provision=Settings.IOS.PROVISIONING,
              for_device=False,
              bundle=True,
              aot=False,
              source_map=False,
              uglify=False,
              snapshot=False,
              log_trace=False,
              verify=True,
              app_data=None,
              aab=False,
              compile_snapshot=False):
        result = Tns.exec_command(command='build',
                                  path=app_name,
                                  platform=platform,
                                  release=release,
                                  provision=provision,
                                  for_device=for_device,
                                  bundle=bundle,
                                  aot=aot,
                                  source_map=source_map,
                                  uglify=uglify,
                                  snapshot=snapshot,
                                  wait=True,
                                  log_trace=log_trace,
                                  aab=aab,
                                  compile_snapshot=compile_snapshot)
        if verify:
            # Verify output
            assert result.exit_code == 0, 'Build failed with non zero exit code.'
            assert 'Project successfully built.' in result.output

            # Verify apk, app or ipa produced
            if platform == Platform.ANDROID:
                assert File.exists(
                    TnsPaths.get_apk_path(app_name=app_name, release=release))
            if platform == Platform.IOS:
                app_path = TnsPaths.get_ipa_path(app_name=app_name,
                                                 release=release,
                                                 for_device=for_device)
                if for_device:
                    assert File.exists(app_path)
                else:
                    assert Folder.exists(app_path)

            # Verify based on app_data
            if app_data is not None:
                pass

        return result
    def test_001_build_ios(self):
        Tns.platform_remove(self.app_name, platform=Platform.ANDROID)
        Tns.build_ios(self.app_name)
        Tns.build_ios(self.app_name, release=True)
        Tns.build_ios(self.app_name, for_device=True)
        Tns.build_ios(self.app_name, for_device=True, release=True)
        assert not File.exists(os.path.join(TnsPaths.get_platforms_ios_folder(self.app_name), '*.aar'))
        assert not File.exists(os.path.join(TnsPaths.get_platforms_ios_npm_modules(self.app_name), '*.framework'))

        # Verify ipa has both armv7 and arm64 archs
        ipa_path = TnsPaths.get_ipa_path(app_name=self.app_name, release=True, for_device=True)
        run("mv " + ipa_path + " TestApp-ipa.tgz")
        run("unzip -o TestApp-ipa.tgz")
        result = run("lipo -info Payload/TestApp.app/TestApp")
        Folder.clean("Payload")
        assert "Architectures in the fat file: Payload/TestApp.app/TestApp are: armv7 arm64" in result.output
示例#4
0
 def test_101_plugin_add_prepare_verify_app_ios(self):
     Tns.plugin_add(plugin_name='tns-plugin', path=self.app_name)
     Tns.build_ios(app_name=self.app_name)
     path_app = os.path.join(TnsPaths.get_ipa_path(self.app_name))
     assert Folder.exists(path_app)