Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

karma-ios-hybrid-app-launcher

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-ios-hybrid-app-launcher

A karma launcher for hybrid apps on iOS.

  • 0.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
decreased by-100%
Maintainers
1
Weekly downloads
 
Created
Source

CircleCI

karma-ios-hybrid-app-launcher

:warning: This is pre-production software and not recommended for production use.

A karma launcher for hybrid apps on iOS.

Use this launcher to run karma tests in a webview-based iOS app.

Installation

npm install -D karma-ios-hybrid-app-launcher

Requirements

Xcode should be installed on the system. /usr/bin/xcodebuild should exist on the system.

Manual Cleanup

This plugin will leave a simulator on your system named "karma-ios-hybrid-app-simulator" (unless your config sets the "configSimulatorName" field). It will re-use this simulator on re-runs. It is up to the developer to manually delete this simulator if cleanup is desired.

Usage

Update your karma config to use this plugin and set it as a "browser", and also provide a config object with the hybrid native test app name and app path.

    browsers: ["iOSHybridApp"],

    plugins: ["karma-ios-hybrid-app-launcher", /* other plugins here */],

    iOSHybridApp: {
      packageId: "ios-test-app",
      appPath: path.resolve("./ios-test-app/ios-test-app.app"),
    },

An example karma config is in this repo.

iOS Hybrid App Requirements

A url will be passed by Webdriver agent to start the app. This url points to Karma endpoint that will serve a page with Jasmine tests. This url is processed inside the view controller.

Debugging Karma Tests

If you want to be able to tap the "DEBUG" button on the karma test page that runs in the webview and have it load that debug page inside the webview (instead of opening in the browser) you'll need to implement the delegate method for WKNavigationDelegate, see the example ios app.

Note that when you open the debug page the original karma (non-debug) page will navigate away so the karma runner will think it's disconnected from the original page and console output will show errors, but if you attach a remote debugger to your webview you will see that the debug page does actually run the karma tests. Auto watch won't work but in the debug tools you can just refresh the page after updating your tests.

Contributing

See the CONTRIBUTING doc.

Running the tests

npm run test

Debugging

There is a vs code debug profile for debugging the karma test. Just press F5 in vs code.

Keywords

FAQs

Package last updated on 07 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc