Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot integrate webdriver-io boilerplate project with Browserstack #18

Open
sergiybuch opened this issue Mar 13, 2019 · 3 comments
Open

Comments

@sergiybuch
Copy link

Hi, I am trying to integrate Browserstack with https://github.com/webdriverio/appium-boilerplate/.
I have created new conf.js file

`exports.config = {
services: ['browserstack'],
user: process.env.BROWSERSTACK_USERNAME || 'xxxxxxxxxxxxxxxxxxxxxxxx',
key: process.env.BROWSERSTACK_ACCESS_KEY || '000000000000000000000',
browserstackLocal: true,
updateJob: false,
specs: [
'./tests/specs/app*.spec.js',
],
exclude: [],

capabilities: [{
    name: 'single_appium_test',
    build: 'webdriver-browserstack',
    device: 'Samsung Galaxy S7',
    browserName: 'android',
    app: process.env.BROWSERSTACK_APP_ID || 'bs://xxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    appPackage: 'com.wdiodemoapp',
    appActivity: 'com.wdiodemoapp.MainActivity',
    'browserstack.debug': true
}],
logLevel: 'verbose',
coloredLogs: true,
screenshotPath: './errorShots/',
baseUrl: '',
waitforTimeout: 10000,
connectionRetryTimeout: 90000,
connectionRetryCount: 3,

framework: 'mocha',
mochaOpts: {
    ui: 'bdd',
    timeout: 20000
}

};
When I am running tests I am getting errors in console:> [email protected] android.browserstack C:\Source\appium-boilerplate-master

wdio ./config/wdio.android.browserstack.conf.js

2019-03-13T15:21:42.248Z DEBUG wdio-config: @wdio/sync found, running tests synchronous
2019-03-13T15:21:42.880Z DEBUG wdio-cli:run: Run suite with config ./config/wdio.android.browserstack.conf.js and params { _: [ './config/wdio.android.browserstack.conf.js' ],
'$0': 'node_modules\@wdio\cli\bin\wdio.js' }

Test Suites: 0 passed, 6 total (0% completed)
Time: 🕓 0.09s

Test Suites: 0 passed, 6 total (0% completed)
Time: 🕗 0.13s

RUNNING 0-3 in android - \tests\specs\app.swipe.spec.js
RUNNING 0-4 in android - \tests\specs\app.webview.spec.js
RUNNING 0-5 in android - \tests\specs\app.webview.xpath.spec.js

Stdout:
2019-03-13T15:21:43.043Z INFO wdio-local-runner: Start worker 0-5 with arg: ./config/wdio.android.browserstack.conf.js
2019-03-13T15:21:43.204Z DEBUG wdio-local-runner: Runner 0-1 finished with exit code 1
2019-03-13T15:21:43.214Z DEBUG wdio-local-runner: Runner 0-0 finished with exit code 1
2019-03-13T15:21:43.230Z DEBUG wdio-local-runner: Runner 0-2 finished with exit code 1
2019-03-13T15:21:43.246Z DEBUG wdio-local-runner: Runner 0-3 finished with exit code 1

Stderr:
[0-0]
C:\Source\appium-boilerplate-master\node_modules\loglevel\lib\loglevel.js:186
throw "log.setLevel() called with invalid level: " + level;
^
log.setLevel() called with invalid level: verbose
[0-1]
C:\Source\appium-boilerplate-master\node_modules\loglevel\lib\loglevel.js:186
throw "log.setLevel() called with invalid level: " + level;
^
log.setLevel() called with invalid level: verbose
[0-2]
C:\Source\appium-boilerplate-master\node_modules\loglevel\lib\loglevel.js:186
throw "log.setLevel() called with invalid level: " + level;
^
log.setLevel() called with invalid level: verbose
[0-2]
C:\Source\appium-boilerplate-master\node_modules\loglevel\lib\loglevel.js:186
throw "log.setLevel() called with invalid level: " + level;
^
log.setLevel() called with invalid level: verbose
[0-3]
C:\Source\appium-boilerplate-master\node_modules\loglevel\lib\loglevel.js:186
throw "log.setLevel() called with invalid level: " + level;
^
log.setLevel() called with invalid level: verbose
[0-4]
C:\Source\appium-boilerplate-master\node_modules\loglevel\lib\loglevel.js:186
throw "log.setLevel() called with invalid level: " + level;
^
log.setLevel() called with invalid level: verbose
[0-5]
C:\Source\appium-boilerplate-master\node_modules\loglevel\lib\loglevel.js:186
throw "log.setLevel() called with invalid level: " + level;
^
log.setLevel() called with invalid level: verbose

Test Suites: 0 passed, 6 failed, 6 total (100% completed)
Time: 🕕 0.37s

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] android.browserstack: wdio ./config/wdio.android.browserstack.conf.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] android.browserstack script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\user\AppData\Roaming\npm-cache_logs\2019-03-13T15_21_43_294Z-debug.log
`

logs-debug.txt

How can i make these tests run in Browserstack?

@sergiybuch
Copy link
Author

I made some changes in my package.json and now I am getting this error:
`
[13:31:06] COMMAND POST "/wd/hub/session"
[13:31:06] DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"name":"single_appium_test","build":"webdriver-browserstack","de
vice":"Samsung Galaxy S7","browserName":"android","app":"bs://f8f8e513f30233679fe79d32e8d8ace28a67d987","browserstack.debug":true,"_":"2 more keys: ["browserstack.local","requestOrigins"]"}}
[13:31:38] INFO SET SESSION ID f576aaeddb11b947251f7d9e2e5125152e4b784d
[13:31:38] RESULT {"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"device":"samsung galaxy s7","browserstack.debug":"true","browserstack.local":"true","r
equestOrigins":{"ur ... (1188 more bytes)
StatusCodeError: 404 - {"status":404,"message":"Not Found"}
at new StatusCodeError (C:\Source\appium-boilerplate-master\node_modules\request-promise-core\lib\errors.js:32:15)
at Request.plumbing.callback (C:\Source\appium-boilerplate-master\node_modules\request-promise-core\lib\plumbing.js:104:33)
at Request.RP$callback [as _callback] (C:\Source\appium-boilerplate-master\node_modules\request-promise-core\lib\plumbing.js:46:31)
at Request.self.callback (C:\Source\appium-boilerplate-master\node_modules\request\request.js:185:22)
at Request.emit (events.js:189:13)
at Request.EventEmitter.emit (domain.js:441:20)
at Request. (C:\Source\appium-boilerplate-master\node_modules\request\request.js:1161:10)
at Request.emit (events.js:189:13)
at Request.EventEmitter.emit (domain.js:441:20)
at IncomingMessage. (C:\Source\appium-boilerplate-master\node_modules\request\request.js:1083:12)
at Object.onceWrapper (events.js:277:13)
at IncomingMessage.emit (events.js:194:15)
at IncomingMessage.EventEmitter.emit (domain.js:441:20)
at endReadableNT (_stream_readable.js:1103:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
ERROR: Unexpected identifier
android.f8f8e513f30233679fe79d32e8d8ace28a67d987
[13:31:39] COMMAND DELETE "/wd/hub/session/f576aaeddb11b947251f7d9e2e5125152e4b784d"
C:\Source\appium-boilerplate-master\tests\specs\app.login.spec.js:1
(function (exports, require, module, __filename, __dirname) { import TabBar from '../screenobjects/components/tab.bar';
^^^^^^

`

@sergiybuch
Copy link
Author

Looks like Browserstack does not work with projects that has page objects structure.

@Biswajeet11
Copy link

Are you still able to integrate webdriverio with browserstack? @sergiybuch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@sergiybuch @Biswajeet11 and others