/apprim360

Primary LanguageJavaScript

Description of the problem with browserstack

I use webdriver.io to automate app testing build with Cordova.

Everything works like a charm...Except when I try to browser.execute.

Error: The URL '/wd/hub/session/xxx/execute/sync' did not map to a valid resource

I found a workaround by adding 'browserstack.appium_version': '1.9.1' to capabilities

But for device like { 'device' : 'Samsung Galaxy S6', 'os_version' : '5.0' } :

ERROR webdriver: Error: Appium version 1.9.1 is not supported on this device

I tried 'browserstack.appium_version': '1.7.1' but same first error (not map to a valid resource)

To reproduce the bug :

  1. Compile the app
  2. npm run test:browserstack will do the following (see test/browserstack.js for details)

Note : You need to configure your browserstack username and password in https://github.com/fabsharp/apprim360/blob/master/package.json#L12

Compile the app

  1. You need cordova to be installed
  2. npm install
  3. npm run build:android

Launch

  • emulator npm run emulate:android
  • usb device npm run device:android

Test

What test does

In www/index.html there's this script :

<script>
    window.APPRIM360 = {
        "hello" : "world",
        show : function() {
            document.getElementById('textBox').classList.remove('hidden');
        }
    };
</script>

We would like to get the APPRIM360 object in test/specs/basic.js

var apprim360 = browser.execute(function(done)  {
            return window.APPRIM360;
        });
expect(apprim360.hello === 'world').toBe(true);