You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure where to post this issue but I'll start here at the top level since I use the wdio test runner with Cucumber.
I think I may be getting a race condition where my spec reporter doesn't always show the test result because the runner is ending prematurely. It seems to only occur when there are multiple browser commands, whether they are in the same step definition or not.
// features/auth.feature
Feature: Auth
Some description
Scenario: Google Auth
Given this should work
// features/step_definitions/auth.js
import { expect } from 'chai';
[...]
this.Given(/^this should work$/, function () {
browser.url('https://google.com');
browser.getSource();
expect('foo').to.exist;
});
// Output:
myApp [testing] :> npm run ui-test
> react-redux-universal-hot-example@0.9.0 ui-test /Users/GabbAHH/Desktop/Dev/myApp
> better-npm-run ui-test
running better-npm-run in /Users/GabbAHH/Desktop/Dev/myApp
Executing script: ui-test
to be executed: ./node_modules/.bin/wdio wdio.conf.js
=======================================================================================
Selenium 2.0 / webdriver protocol bindings implementation with helper commands in nodejs.
For a complete list of commands, visit http://webdriver.io/api.html.
=======================================================================================
[16:02:15] COMMAND POST "/wd/hub/session"
[16:02:15] DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"maxInstances":6,"browserName":"chrome","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.2.8","name":"webdriverio"}}}
[16:02:17] INFO SET SESSION ID 42e1e89c-0bbb-4553-b7d7-bce852f847cf
[16:02:17] RESULT {"applicationCacheEnabled":false,"rotatable":false,"mobileEmulationEnabled":false,"networkConnectionEnabled":false,"chrome":{"chromedriverVersion":"2.23.409710 (0c4084804897ac45b5ff65a690ec6583b97225c0)","userDataDir":"/var/folders/59/6pd62vqn20j5qx2hv1l1w9_r0000gn/T/.org.chromium.Chromium.FUqeyq"},"takesHeapSnapshot":true,"pageLoadStrategy":"normal","databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"version":"53.0.2785.116","platform":"MAC","browserConnectionEnabled":false,"nativeEvents":true,"acceptSslCerts":true,"webdriver.remote.sessionid":"42e1e89c-0bbb-4553-b7d7-bce852f847cf","locationContextEnabled":true,"webStorageEnabled":true,"browserName":"chrome","takesScreenshot":true,"javascriptEnabled":true,"cssSelectorsEnabled":true}
[16:02:18] COMMAND POST "/wd/hub/session/42e1e89c-0bbb-4553-b7d7-bce852f847cf/url"
[16:02:18] DATA {"url":"https://google.com"}
[16:02:25] RESULT null
[16:02:25] COMMAND GET "/wd/hub/session/42e1e89c-0bbb-4553-b7d7-bce852f847cf/source"
[16:02:25] DATA {}
[16:02:25] RESULT "<!DOCTYPE html><html xmlns=\"http://www.w3.org/1999/xhtml\" itemscope=\"\" itemtype=\"http://schema.org/WebPage\" lang=\"en\"><head><meta content=\"Search the world's information, including webpages, ... (230174 more bytes)
[16:02:25] COMMAND DELETE "/wd/hub/session/42e1e89c-0bbb-4553-b7d7-bce852f847cf"
[16:02:25] DATA {}
[16:02:25] RESULT null
Now if I remove the second command of browser.getSource(), I am able to complete the test properly:
So,
// features/step_definitions/auth.js
this.Given(/^this should work$/, function () {
browser.url('https://google.com');
expect('foo').to.exist;
});
gives:
myApp [testing] :> npm run ui-test
> react-redux-universal-hot-example@0.9.0 ui-test /Users/GabbAHH/Desktop/Dev/myApp
> better-npm-run ui-test
running better-npm-run in /Users/GabbAHH/Desktop/Dev/myApp
Executing script: ui-test
to be executed: ./node_modules/.bin/wdio wdio.conf.js
=======================================================================================
Selenium 2.0 / webdriver protocol bindings implementation with helper commands in nodejs.
For a complete list of commands, visit http://webdriver.io/api.html.
=======================================================================================
[16:02:41] COMMAND POST "/wd/hub/session"
[16:02:41] DATA {"desiredCapabilities":{"javascriptEnabled":true,"locationContextEnabled":true,"handlesAlerts":true,"rotatable":true,"maxInstances":6,"browserName":"chrome","loggingPrefs":{"browser":"ALL","driver":"ALL"},"requestOrigins":{"url":"http://webdriver.io","version":"4.2.8","name":"webdriverio"}}}
[16:02:44] INFO SET SESSION ID 2ef670fe-d842-4052-8d24-260e48fcb376
[16:02:44] RESULT {"applicationCacheEnabled":false,"rotatable":false,"mobileEmulationEnabled":false,"networkConnectionEnabled":false,"chrome":{"chromedriverVersion":"2.23.409710 (0c4084804897ac45b5ff65a690ec6583b97225c0)","userDataDir":"/var/folders/59/6pd62vqn20j5qx2hv1l1w9_r0000gn/T/.org.chromium.Chromium.GidKiN"},"takesHeapSnapshot":true,"pageLoadStrategy":"normal","databaseEnabled":false,"handlesAlerts":true,"hasTouchScreen":false,"version":"53.0.2785.116","platform":"MAC","browserConnectionEnabled":false,"nativeEvents":true,"acceptSslCerts":true,"webdriver.remote.sessionid":"2ef670fe-d842-4052-8d24-260e48fcb376","locationContextEnabled":true,"webStorageEnabled":true,"browserName":"chrome","takesScreenshot":true,"javascriptEnabled":true,"cssSelectorsEnabled":true}
[16:02:45] COMMAND POST "/wd/hub/session/2ef670fe-d842-4052-8d24-260e48fcb376/url"
[16:02:45] DATA {"url":"https://google.com"}
[16:02:50] RESULT null
[16:02:50] COMMAND DELETE "/wd/hub/session/2ef670fe-d842-4052-8d24-260e48fcb376"
[16:02:50] DATA {}
[16:02:50] RESULT null
------------------------------------------------------------------
[chrome #0a] Session ID: 2ef670fe-d842-4052-8d24-260e48fcb376
[chrome #0a] Spec: /Users/GabbAHH/Desktop/Dev/myApp/features/auth.feature
[chrome #0a] Running: chrome
[chrome #0a]
[chrome #0a] Auth
[chrome #0a]
[chrome #0a] Google Auth
[chrome #0a] ✓ this should work
[chrome #0a]
[chrome #0a]
[chrome #0a] 1 passing (9s)
[chrome #0a]
The text was updated successfully, but these errors were encountered:
The problem
I'm not sure where to post this issue but I'll start here at the top level since I use the wdio test runner with Cucumber.
I think I may be getting a race condition where my spec reporter doesn't always show the test result because the runner is ending prematurely. It seems to only occur when there are multiple browser commands, whether they are in the same step definition or not.
Environment
wdio-spec-reporter: 0.0.3
wdio-cucumber-framework: 0.2.4
chai: 3.3.0
Code To Reproduce Issue
I simplified my code into these code snippets. I'm wondering if anyone can reproduce this.
Here's my gist to the config file
Now if I remove the second command of
browser.getSource()
, I am able to complete the test properly:So,
gives:
The text was updated successfully, but these errors were encountered: