Skip to content

garg3133/browserstack-examples-nightwatchjs-appium

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

browserstack-appium-nightwatch-example

Nightwatch Integration with BrowserStack.

Setup

  • Clone the repo

  • Install the dependencies using npm install

  • Export the environment variables for the Username and Access Key of your BrowserStack account, which you can get directly from the app automate dashboard

    export BROWSERSTACK_USERNAME=<browserstack-username> &&
    export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>
    
  • Upload the apps provided in resources folder using this command

  curl -u "<username>:<access-key>" \
  -X POST "https://api-cloud.browserstack.com/app-automate/upload" \
  -F "file=@/path/to/app/file/application-debug.apk"
  • Please note the value of app_url in the API response and set the app capbility in the nightwatch.conf.js, nightwatch-local.conf.js and nightwatch-suite.conf.js in conf folder for the respective apps.
    • android_app_url in browserstack.android_01 and browserstack.android_02 capability set in nightwatch-suite.conf.js
    • android_app_url in browserstack.android_01 capability set in nightwatch.conf.js
    • ios_app_url in browserstack.ios_01 capability set in nightwatch.conf.js
    • android_local_app_url in browserstack.local_01 and browserstack.local_02 capability set in nightwatch-local.conf.js
  • Please go through this documentation for better understanding.

Running your tests

  • To run a single android test, run npm run single-android
  • To run a single ios test, run npm run single-ios
  • To run parallel tests, run npm run parallel
  • To run parallel tests on different devices, run npm run parallel-devices
  • To run test suite, run npm run suite
  • To run local tests, run npm run local
  • To run parallel local tests, run npm run parallel-local

Understand how many parallel sessions you need by using our Parallel Test Calculator

Notes

Connecting to BrowserStack via a proxy server

You can specify proxy settings in Nightwatch by adding the proxy key in your *.conf.js

  test_settings: {
    default: {
      desiredCapabilities: {
        // Your capabilities
      },
      proxy: {
        "host": "",     // "127.0.0.1"
        "port": "",     // "8081"
        "protocol": ""  // "http"
      }
    }
  }

Additional Resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%