Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

nightwatch-mobile-helper

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

nightwatch-mobile-helper

Mobile helper tool to easily setup mobile requirements

unpublished
latest
Source
npmnpm
Version
0.0.17
Version published
Maintainers
1
Created
Source

@nightwatch/mobile-helper

Setup for mobile-web testing

Android

  • From your Nightwatch project's root dir, run:

    npx @nightwatch/mobile-helper android
    
  • Answer a few questions related to your requirements:

  • It will verify if all the requirements are being met.

  • If some requirements are not being met, it will ask whether to download and setup those requirements:

  • Voila :tada: Your setup is now complete. (If something fails, follow the instructions and re-run the command.)

  • Add the following env configuration to your nightwatch.conf.js or nightwatch.json file:

    "test_settings": {
     // other envs above this line
     'android.chrome': {
       desiredCapabilities: {
         browserName: 'chrome',
         'goog:chromeOptions': {
           w3c: true,
           args: [
             //'--no-sandbox',
             //'--ignore-certificate-errors',
             //'--allow-insecure-localhost',
             //'--headless'
           ],
           androidPackage: 'com.android.chrome',
           // add the device serial to run tests on, if multiple devices are online
           // Run command: `$ANDROID_HOME/platform-tools/adb devices`
           // androidDeviceSerial: ''
         },
       },
    
       webdriver: {
         start_process: true,
         server_path: 'chromedriver-mobile/chromedriver',
         cli_args: [
           // --verbose
         ]
       }
     },
    
     'android.firefox': {
       desiredCapabilities: {
         browserName: 'firefox',
         acceptInsecureCerts: true,
         'moz:firefoxOptions': {
           args: [
             // '-headless',
             // '-verbose'
           ],
           androidPackage: 'org.mozilla.firefox',
           // add the device serial to run tests on, if multiple devices are online
           // Run command: `$ANDROID_HOME/platform-tools/adb devices`
           // androidDeviceSerial: 'ZD2222W62Y'
         }
       },
       webdriver: {
         start_process: true,
         server_path: '',
         cli_args: [
           // very verbose geckodriver logs
           // '-vv'
         ]
       }
     },
    }
    
  • If testing on real-device:

    • Make sure latest version of Chrome/Firefox browsers are installed. If not, install them from Google Play Store.
    • Turn on USB Debugging on your Android Device and connect it to your system via data cable.
  • If testing on emulator, make sure chromedriver-mobile/chromedriver is present in your Nightwatch project's root dir. If not present, re-run the command in first step.

  • Run your nightwatch tests on Android mobile browsers:

     # for firefox
     npx nightwatch --env android.firefox
     # for chrome
     npx nightwatch --env android.chrome
    

FAQs

Package last updated on 01 Nov 2022

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