0.0.17 • Published 2 years ago

nightwatch-mobile-helper v0.0.17

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@nightwatch/mobile-helper

Setup for mobile-web testing

Android

  1. From your Nightwatch project's root dir, run:

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

  3. It will verify if all the requirements are being met.
  4. If some requirements are not being met, it will ask whether to download and setup those requirements:
  5. Voila :tada: Your setup is now complete. (If something fails, follow the instructions and re-run the command.)
  6. 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'
         ]
       }
     },
    }
  7. If testing on real-device:

    1. Make sure latest version of Chrome/Firefox browsers are installed. If not, install them from Google Play Store.
    2. Turn on USB Debugging on your Android Device and connect it to your system via data cable.
  8. 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.
  9. Run your nightwatch tests on Android mobile browsers:
     # for firefox
     npx nightwatch --env android.firefox
     # for chrome
     npx nightwatch --env android.chrome
0.0.17

2 years ago

0.0.16

2 years ago

0.0.15

2 years ago

0.0.14

2 years ago

0.0.13

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago