xolvio / chimp Goto Github PK
View Code? Open in Web Editor NEWTooling that helps you do quality, faster.
License: MIT License
Tooling that helps you do quality, faster.
License: MIT License
currently you have to write:
this.Given(/^I have created a settings file with the title "([^"]*)"$/, function (title, callback) {
this.ddp.call('updateTitle', [title], function(err, res) {
if (err) {
callback.fail(err);
} else {
callback();
}
});
});
This would be much cleaner this way:
this.ddp.call('updateTitle', [title], callback);
And can be achieved by monkey-patching global.ddp.call
I want to use ES2015 in my test automation code (step definitions, page objects).
Hey there!
Just wanted to point a problem that i am running into a lot when working with services like Facebook that use pop-ups etc. Chimp currently is really sensitive to browser windows not being closed "correctly" etc. which is kind of annoying when you try to setup a tab-switching workflow in your tests.
To try it, just run some tests and close the browser window by hand in the middle of anything. Chimp will completely freak out and not restart anymore. IMO it should not care at all โ just stop the current test run and wait for the next file change to be there for you ๐
Here is one of the logs from such an error where i have to completely restart the test-server afterwards:
[chimp][hooks] BeforeFeatures hook had error
{ [Error: Window not found. The browser window may have been closed.
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'Macintosh.local', ip: '25.174.89.152', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.8.0_60'
Driver info: driver.version: unknown]
message: 'Window not found. The browser window may have been closed.\nBuild info: version: \'2.47.1\', revision: \'411b314\', time: \'2015-07-30 03:03:16\'\nSystem info: host: \'Macintosh.local\', ip: \'25.174.89.152\', os.name: \'Mac OS X\', os.arch: \'x86_64\', os.version: \'10.9.5\', java.version: \'1.8.0_60\'\nDriver info: driver.version: unknown',
type: 'RuntimeError' }
Error: Window not found. The browser window may have been closed.
at Object.Future.wait (/Users/dominik/.meteor/packages/xolvio_cucumber/.0.14.1.1kokaqw++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/node_modules/fibers/future.js:420:15)
at Object.timeoutsAsyncScriptSync (/Users/dominik/.meteor/packages/xolvio_cucumber/.0.14.1.1kokaqw++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/xolvio-fiber-utils/index.js:48:19)
at initBrowser (/Users/dominik/.meteor/packages/xolvio_cucumber/.0.14.1.1kokaqw++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/lib/cucumberjs/hooks.js:91:15)
at /Users/dominik/.meteor/packages/xolvio_cucumber/.0.14.1.1kokaqw++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/lib/cucumberjs/hooks.js:119:7
at /Users/dominik/.meteor/packages/xolvio_cucumber/.0.14.1.1kokaqw++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/lib/cucumber-wrapper.js:116:43
- - - - -
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'Macintosh.local', ip: '25.174.89.152', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.8.0_60'
Driver info: driver.version: unknown
at new ErrorHandler.RuntimeError (/Users/dominik/.meteor/packages/xolvio_cucumber/.0.14.1.1kokaqw++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/webdriverio/lib/utils/ErrorHandler.js:92:12)
at RequestHandler.<anonymous> (/Users/dominik/.meteor/packages/xolvio_cucumber/.0.14.1.1kokaqw++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/webdriverio/lib/utils/RequestHandler.js:138:25)
at Request.self.callback (/Users/dominik/.meteor/packages/xolvio_cucumber/.0.14.1.1kokaqw++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/webdriverio/node_modules/request/request.js:373:22)
at Request.emit (events.js:98:17)
at Request.<anonymous> (/Users/dominik/.meteor/packages/xolvio_cucumber/.0.14.1.1kokaqw++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/webdriverio/node_modules/request/request.js:1318:14)
at Request.emit (events.js:117:20)
at IncomingMessage.<anonymous> (/Users/dominik/.meteor/packages/xolvio_cucumber/.0.14.1.1kokaqw++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/node_modules/xolvio-sync-webdriverio/node_modules/webdriverio/node_modules/request/request.js:1266:12)
at IncomingMessage.emit (events.js:117:20)
at _stream_readable.js:944:16
at process._tickDomainCallback (node.js:492:13)
[chimp] Finished running async processes with errors
[chimp] run complete with errors Cucumber steps failed
[chimp] Could not get Cucumber Results from run result:
[ undefined, [ null ] ]
[xolvio:cucumber] Bad response from Chimp server.
{ statusCode: 200,
content: '',
headers:
{ 'content-type': 'application/json; charset=utf-8',
'cache-control': 'no-cache',
'content-length': '0',
date: 'Sun, 27 Sep 2015 12:09:36 GMT',
connection: 'keep-alive' },
data: null }
Session manager should check the noSessionReuse environment variable, and if it's true (as set by bin/chimp when using something like --host=ondemand.saucelabs.com) then the session manager shouldn't attempt to kill the session.
Additionally, when session manager attempts to kill a session it doesn't check if _getWebdriverSessions returned an error message or not.
In the tutorial, the steps definitions file is step_defs.js
in features/support/
. In Letterpress, step definitions are in a step_definitions
subdirectory of features
.
Process the output of cucumber and remove any stacktrace lines that are not part of a whitelist.
This whitelist can contain the users feature and source files directory, and therefore any other unrelated lines can be omitted. I already did something similar here:
https://github.com/xolvio/meteor-cucumber/blob/develop/src/mirror-server.js#L432
After installing chimp using "npm install chimp" cmd, chimp module file "chimp\bin\chimp" is not created in node_modules folder.
NPM version: 3.3.6
Nodejs version: 4.2.0
Allows easy testing of restful services and server side rendering etc
Version of the phantomjs in the repository https://github.com/eugeneware/phantomjs-bin is 1.9.8
In my system (OSX) phantomjs -v
is 2.0.0
I would like the opportunity to use system phantomjs bin
It would be nice to be able to monitor an additional directory of source files for changes
[velocity] Established connection with Velocity.
[xolvio:cucumber] Cucumber is running
[chimp] Finished running async processes with errors
[chimp] run complete with errors [Error: Another Selenium process is already running]
[chimp] Could not get Cucumber Results from run result:
[ undefined, [ undefined ] ]
[xolvio:cucumber] Bad response from Chimp server.
alan 80627 0.0 0.7 3147416 121272 ?? S 4:01PM 0:01.55 /Users/alan/.meteor/packages/velocity_meteor-tool/.1.1.4_2.12re4pp++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node /Users/alan/.meteor/packages/xolvio_cucumber/.0.13.8.17ci1po++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/bin/chimp -r /Users/alan/Dev/AHM/GFF/prototype1/admin/tests/cucumber/features --snippets --ddp=http://localhost:64569/ --log=error --screenshotsPath=/Users/alan/Dev/AHM/GFF/prototype1/admin/tests/cucumber/.screenshots --tags=@dev --server --serverPort=8866
alan 80626 0.0 0.1 3065476 14656 ?? Ss 4:01PM 0:00.05 /Users/alan/.meteor/packages/velocity_meteor-tool/.1.1.4_2.12re4pp++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node /private/var/folders/_q/8jh0f25s4xd5wj0h6p0zd0hr0000gn/T/meteor-test-run1frn2f4/.meteor/local/build/programs/server/assets/packages/sanjo_long-running-child-process/lib/spawnScript.js 80577 Chimp_8866 /Users/alan/.meteor/packages/velocity_meteor-tool/.1.1.4_2.12re4pp++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/bin/node /Users/alan/.meteor/packages/xolvio_cucumber/.0.13.8.17ci1po++os.osx.x86_64+web.browser+web.cordova/npm/node_modules/chimp/bin/chimp -r /Users/alan/Dev/AHM/GFF/prototype1/admin/tests/cucumber/features --snippets --ddp=http://localhost:64569/ --log=error --screenshotsPath=/Users/alan/Dev/AHM/GFF/prototype1/admin/tests/cucumber/.screenshots --tags=@dev --server --serverPort=8866
This is a pretty simple meteor application, fresh install of xolvio:cucumber
and using the sample specifications files.
Leaving the computer and coming back hours later requires chimp to be restarted. Possibly increase Selenium session timeout?
see here:
https://github.com/meteor-velocity/velocity/issues/336#issuecomment-122620375
This line is the culprit:
https://github.com/xolvio/chimp/blob/master/lib/chimp.js#L79
Currently Cucumber can only have one BeforeFeatures and one AfterFeatures hook. Because Chimp uses them, the user cannot specify one.
Also the Chimp BeforeFeatures hook should be executed before the user registered hooks.
The Chimp AfterFeatures hook should be executed after the user registered hooks.
TypeError: invalid pid
at process.kill (node.js:746:15)
at process.<anonymous> (/home/jonas/projects/chimp/lib/chimp.js:60:13)
at emitNone (events.js:67:13)
at process.emit (events.js:166:7)
at Signal.wrap.onsignal (node.js:790:46)
It's this line https://github.com/xolvio/chimp/blob/master/lib/chimp.js#L60 where the pid argument is missing. Has this line any purpose at all? Should it be process.exit()?
chimp create feature hello
would create:
./features/hello.feature
./features/step_definitions/hello.js
(or --coffee)
seems a little similar to git flow feature start MYFEATURE
- hmmmm ๐
This was my commands to update meteor:
โ gdd git:(cucumber) meteor refresh
โ gdd git:(cucumber) meteor update
This project is already at Meteor 1.2.0.1, the latest release.
Changes to your project's package version selections from updating package versions:
xolvio:cucumber upgraded from 0.13.8 to 0.14.1
The following top-level dependencies were not updated to the very latest version available:
* natestrauser:select2 3.5.1 (4.0.0_1 is available)
Newer versions of the following indirect dependencies are available:
* babrahams:editable-json 0.4.3 (0.6.0 is available)
* meteorhacks:aggregate 1.2.1 (1.3.0 is available)
* percolate:velocityjs 1.1.0 (1.2.1_1 is available)
* practicalmeteor:chai 1.9.2_3 (2.1.0_1 is available)
* practicalmeteor:loglevel 1.1.0_3 (1.2.0_2 is available)
* softwarerero:accounts-t9n 1.0.9 (1.1.4 is available)
To update one or more of these packages, pass their names to `meteor update`.
โ gdd git:(cucumber) โ export VELOCITY_DEBUG=1
โ gdd git:(cucumber) โ meteor
[[[[[ ~/Documents/workspace/gettydata/gdd ]]]]]
=> Started proxy.
=> Started MongoDB.
I20150924-17:41:29.605(-3)? [velocity] adding velocity core
I20150924-17:41:29.608(-3)? [xolvio:cucumber] Cucumber hub is loading
I20150924-17:41:29.608(-3)? [velocity] Register framework cucumber with regex ^tests/cucumber/((?!node_modules/).)+\.(feature|js|coffee|litcoffee|coffee\.md)$
I20150924-17:41:32.222(-3)? [velocity] Server startup
I20150924-17:41:32.224(-3)? [velocity] app dir /Users/thiagoassis/Documents/workspace/gettydata/gdd
I20150924-17:41:32.225(-3)? [velocity] config = {
I20150924-17:41:32.225(-3)? "cucumber": {
I20150924-17:41:32.225(-3)? "regex": "^tests/cucumber/((?!node_modules/).)+\\.(feature|js|coffee|litcoffee|coffee\\.md)$",
I20150924-17:41:32.225(-3)? "name": "cucumber",
I20150924-17:41:32.225(-3)? "_regexp": {}
I20150924-17:41:32.225(-3)? }
I20150924-17:41:32.226(-3)? }
I20150924-17:41:32.226(-3)? [velocity] resetting the world
I20150924-17:41:32.228(-3)? [velocity] frameworks with disable auto reset: []
I20150924-17:41:32.247(-3)? [velocity] Add paths to watcher [ '/Users/thiagoassis/Documents/workspace/gettydata/gdd/tests' ]
I20150924-17:41:32.252(-3)? [velocity] 1 mirror(s) requested
I20150924-17:41:32.316(-3)? [velocity] Mirror process forked with pid 24873
I20150924-17:41:32.316(-3)? [velocity] cucumber is starting a mirror at http://localhost:54111/.
I20150924-17:41:32.339(-3)? [velocity] You can see the mirror logs at: tail -f /Users/thiagoassis/Documents/workspace/gettydata/gdd/.meteor/local/log/cucumber.log
=> Started your app.
=> App running at: http://localhost:3000/
I20150924-17:41:32.431(-3)? [velocity] Search framework for path tests/cucumber/package.json
I20150924-17:41:32.432(-3)? [velocity] No framework registered for tests/cucumber/package.json
I20150924-17:41:32.494(-3)? [velocity] Search framework for path tests/cucumber/features/apis.feature
I20150924-17:41:32.495(-3)? [velocity] Target framework for tests/cucumber/features/apis.feature is cucumber
I20150924-17:41:32.498(-3)? [velocity] Search framework for path tests/cucumber/features/countries.feature
I20150924-17:41:32.499(-3)? [velocity] Target framework for tests/cucumber/features/countries.feature is cucumber
I20150924-17:41:32.501(-3)? [velocity] Search framework for path tests/cucumber/features/fields.feature
I20150924-17:41:32.501(-3)? [velocity] Target framework for tests/cucumber/features/fields.feature is cucumber
I20150924-17:41:32.502(-3)? [velocity] Search framework for path tests/cucumber/features/login.feature
I20150924-17:41:32.503(-3)? [velocity] Target framework for tests/cucumber/features/login.feature is cucumber
I20150924-17:41:32.504(-3)? [velocity] Search framework for path tests/cucumber/features/sites.feature
I20150924-17:41:32.504(-3)? [velocity] Target framework for tests/cucumber/features/sites.feature is cucumber
I20150924-17:41:32.542(-3)? [velocity] Search framework for path tests/cucumber/features/users.feature
I20150924-17:41:32.543(-3)? [velocity] Target framework for tests/cucumber/features/users.feature is cucumber
I20150924-17:41:32.543(-3)? [velocity] Search framework for path tests/cucumber/fixtures/base_fixtures.js
I20150924-17:41:32.543(-3)? [velocity] Target framework for tests/cucumber/fixtures/base_fixtures.js is cucumber
I20150924-17:41:32.544(-3)? [velocity] Search framework for path tests/cucumber/features/step_definitions/api_steps.js
I20150924-17:41:32.544(-3)? [velocity] Target framework for tests/cucumber/features/step_definitions/api_steps.js is cucumber
I20150924-17:41:32.546(-3)? [velocity] Search framework for path tests/cucumber/features/step_definitions/country_steps.js
I20150924-17:41:32.546(-3)? [velocity] Target framework for tests/cucumber/features/step_definitions/country_steps.js is cucumber
I20150924-17:41:32.548(-3)? [velocity] Search framework for path tests/cucumber/features/step_definitions/field_steps.js
I20150924-17:41:32.548(-3)? [velocity] Target framework for tests/cucumber/features/step_definitions/field_steps.js is cucumber
I20150924-17:41:32.549(-3)? [velocity] Search framework for path tests/cucumber/features/step_definitions/global_steps.js
I20150924-17:41:32.549(-3)? [velocity] Target framework for tests/cucumber/features/step_definitions/global_steps.js is cucumber
I20150924-17:41:32.550(-3)? [velocity] Search framework for path tests/cucumber/features/step_definitions/login_steps.js
I20150924-17:41:32.550(-3)? [velocity] Target framework for tests/cucumber/features/step_definitions/login_steps.js is cucumber
I20150924-17:41:32.552(-3)? [velocity] Search framework for path tests/cucumber/features/step_definitions/users_steps.js
I20150924-17:41:32.552(-3)? [velocity] Target framework for tests/cucumber/features/step_definitions/users_steps.js is cucumber
I20150924-17:41:32.559(-3)? [velocity] File scan complete, now watching /tests
I20150924-17:41:32.559(-3)? [velocity] Triggering queued startup functions
I20150924-17:43:38.709(-3)? [velocity] Mirror registered. Handshaking with mirror...
I20150924-17:43:38.865(-3)? [velocity] Connected to mirror, setting state to ready { framework: 'cucumber',
I20150924-17:43:38.866(-3)? host: 'http://localhost:54111/',
I20150924-17:43:38.866(-3)? port: '54111' }
It would be great if we could pass baseURL to webdriver
If Chimp exits a few times with
[chimp] Finished running async processes with errors
ps ax | grep java
yields this sort of thing:
2128 s000 S 0:02.27 /Users/myuser/tools/java -jar /Users/myuser/.npm-packages/lib/node_modules/chimp/node_modules/selenium-standalone/.selenium/selenium-server/2.46.0-server.jar -Dwebdriver.chrome.driver=/Users/myuser/.npm-packages/lib/node_modules/chimp/node_modules/selenium-standalone/.selenium/chromedriver/2.16-x64-chromedriver -port 49850
3116 s000 S 0:01.99 /Users/myuser/tools/java -jar /Users/myuser/.npm-packages/lib/node_modules/chimp/node_modules/selenium-standalone/.selenium/selenium-server/2.46.0-server.jar -Dwebdriver.chrome.driver=/Users/myuser/.npm-packages/lib/node_modules/chimp/node_modules/selenium-standalone/.selenium/chromedriver/2.16-x64-chromedriver -port 50325
4381 s000 S 0:04.11 /Users/myuser/tools/java -jar /Users/myuser/.npm-packages/lib/node_modules/chimp/node_modules/selenium-standalone/.selenium/selenium-server/2.46.0-server.jar -Dwebdriver.chrome.driver=/Users/myuser/.npm-packages/lib/node_modules/chimp/node_modules/selenium-standalone/.selenium/chromedriver/2.16-x64-chromedriver -port 50969
4744 s000 S 0:02.82 /Users/myuser/tools/java -jar /Users/myuser/.npm-packages/lib/node_modules/chimp/node_modules/selenium-standalone/.selenium/selenium-server/2.46.0-server.jar -Dwebdriver.chrome.driver=/Users/myuser/.npm-packages/lib/node_modules/chimp/node_modules/selenium-standalone/.selenium/chromedriver/2.16-x64-chromedriver -port 51160
The processes don't seem to hang around if Chimp is stopped before it hits the error
When in watch mode it would be useful to have the browser cache disabled. That way changes to source code would be reflected immediately rather than having to shift reload.
In normal test mode, browser cache is still useful to speed up tests
When I installed Chimp to follow the tutorial, I received an error on startup that prevented the Selenium server from installing/starting. The error was:
[selenium] [Error: Could not request headers from http://selenium-release.storage.googleapis.com/2.47/IEDriverServer_x64_2.47.1.zip: ]
I edited the chimp\lib\selenium.js file line 75, replacing: version: '2.47.1' with version: '2.47.0' and that resolved the problem.
There isn't yet a file at the Google API location referenced above.
As Chimp is using webdriver.io internally, it would be great to use wdio.conf.js you probably already have. Is there a way to pass a configuration file instead of specify everything via command line parameters?
Currently this happens on startup. If we keep a hash of the file, then we don't need to run every startup. We also wouldn't need to restart chimp when the package file changes (as is currently the case)
This happens when sync is set to true
Would it be possible to intercept the boilerplate step definitions that CucumberJS outputs, and adapt them for Chimp, e.g. by removing the callback?
When we first started chimp, this aspect was an experiment.
Now we know a lot more about what we need from cukes so we should rewrite this section with proper testing
Would be really nice to be able to step through the tests and have the DOM available for inspection, as it can be difficult to predict the state of a page as it loads and executes its many scripts.
On https://chimp.readme.io/docs/getting-started
The links for Key Concepts and tutorial under the Develop heading are broken.
If there's a package.json
in the directory node_modules\.bin\chimp --watch
is run from, Chimp fails with this message:
[chimp] stderr: 'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
npm install error { [Error: Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Program Files\nodejs\npm install"
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
]
killed: false,
code: 1,
signal: null,
cmd: 'C:\\Windows\\system32\\cmd.exe /s /c "C:\\Program Files\\nodejs\\npm install"' }
Error in chimp init { [Error: Command failed: C:\Windows\system32\cmd.exe /s /c "C:\Program Files\nodejs\npm install"
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
]
killed: false,
code: 1,
signal: null,
cmd: 'C:\\Windows\\system32\\cmd.exe /s /c "C:\\Program Files\\nodejs\\npm install"' }
To reproduce, save the file below as package.json
in some directory, then run npm install
and node_modules\.bin\chimp --watch
:
{
"name": "chimp-bug",
"devDependencies": {
"chimp": "^0.14.0"
}
}
Version: 0.12 but also before.
Reproduce:
In the chimp directory:
ps ax | grep selenium
# Delete the bdd-cli.feature because it is buggy
node bin/chimp --jsonOutput=result.json
ps ax | grep selenium
Shows me that selenium is still running:
6822 pts/15 Sl 0:01 /usr/bin/java -jar /home/jonas/projects/chimp/node_modules/selenium-standalone/.selenium/selenium-server/2.46.0-server.jar -Dwebdriver.chrome.driver=/home/jonas/projects/chimp/node_modules/selenium-standalone/.selenium/chromedriver/2.16-x64-chromedriver -port 53512
I have requirement to show cucumber report and display screenshot for failed scenarios. Is there any option in chimp to attach the screenshot to scenario.
Just like Selenium but Appium
Also see if calaba.sh can be used here
I'm getting below error when tried to install chimp.
npm http 404 https://registry.npmjs.org/xolvio/sync-webdriverio
npm ERR! 404 Not Found
npm ERR! 404
npm ERR! 404 'xolvio/sync-webdriverio' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
npm ERR! 404 It was specified as a dependency of 'chimp'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, or http url, or git url.
npm ERR! System Darwin 14.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "chimp"
Happens when using --browser firefox
. You can see it with ps -ax | grep selenium-server-standalone
.
When waiting for a condition, such as waitForExist('selector')
, WebdriverIO will do exactly what it's told to do. The synchronous flow will continue regardless of the value returned from waitForExist. The user intention will likely want the step to fail if the waitFor command fails.
The current workaround is to do this:
expect(browser.waitForExist(selector)).to.equal(true, selector + ' does not exist.');
We need a solution that respects the users original intention without the extra work.
Options:
I'm leaning towards option 1 right now. @sanjo what you think?
The session manager should detect a stale session and create a new one.
Just installed chimp and got this warning:
npm WARN peerDependencies The peer dependency bluebird@~2.2.1 included from pogo will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
Are there any plans to add logic to the session-manager so that non-localhost sessions would be properly closed out?
For example, when I run a Sauce Labs session, the session will eventually just timeout and that shows as a failed test - at least in the bit that I've been playing with things. BrowserStack at least shows it as a "timeout" status.
Will probably also happen with the npm install
command that runs
First, apologies if this turns out to be a n00b error, but I've been unable to solve this ever since I started using Chimp, which is a really great tool!
I'm using Windows 10 and installed the latest version of chimp today (Sep 24, 2015) for this test case (npm install chimp) and when running I get this error:
> .\node_modules\.bin\chimp
[chimp] Running...
Feature: Test case for trying to use .then results in error.
As a human
I want to be able to use .then()
Scenario: # features\why_is_client_execute_then_not_working_test_case.feature:6
Given I have visited https://github.com/xolvio/chimp # features\why_is_client_execute_then_not_working_test_case.feature:7
When I try to use .then() I get an error in the chimp console # features\why_is_client_execute_then_not_working_test_case.feature:8
TypeError: undefined is not a function
at World.<anonymous> (features\support\step_defs.js:12:24)
(::) failed steps (::)
TypeError: undefined is not a function
at World.<anonymous> (features\support\step_defs.js:12:24)
Failing scenarios:
features\why_is_client_execute_then_not_working_test_case.feature:6 # Scenario:
1 scenario (1 failed)
2 steps (1 failed, 1 passed)
[chimp] Finished running async processes with errors
[chimp] run complete with errors Cucumber steps failed
Error in chimp init Cucumber steps failed
The error above occurs with this code, line 12 is the line that has .then():
File: step_defs.js
module.exports = function() {
this.Given(/^I have visited https:\/\/github\.com\/xolvio\/chimp$/, function () {
client.url("https://github.com/xolvio/chimp");
});
this.When(/^I try to use \.then\(\) I get an error in the chimp console$/, function () {
// Example code from http://webdriver.io/api/protocol/execute.html
client.execute(function(a, b, c, d) {
// browser context - you may not access neither client nor console
return a + b + c + d;
}, 1, 2, 3, 4).then(function(ret) {
// node.js context - client and console are available
console.log(ret.value); // outputs: 10
});
});
};
File: why_is_client_execute_then_not_working_test_case.feature
Feature: Test case for trying to use .then results in error.
As a human
I want to be able to use .then()
Scenario:
Given I have visited https://github.com/xolvio/chimp
When I try to use .then() I get an error in the chimp console
Let me know if there's any more information you need. I would really like to figure out why I'm unable to use .then() at all.
In case it helps, here's the output from "npm install chimp" and then in case it provides any helpful info:
> npm install chimp
npm WARN optional dep failed, continuing [email protected]
npm WARN deprecated [email protected]: package renamed to "urijs" (lower-case), please update accordingly
-
> [email protected] install C:\Users\elofgren\Desktop\temp\chimp_install_test\node_modules\chimp\node_modules\fibers
> node build.js || nodejs build.js
`win32-x64-v8-3.28` exists; testing
Binary is fine; exiting
[email protected] node_modules\chimp
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
โโโ [email protected]
โโโ [email protected] ([email protected])
โโโ [email protected]
โโโ [email protected] ([email protected], [email protected], [email protected])
โโโ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โโโ [email protected] ([email protected], [email protected], [email protected], [email protected])
โโโ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โโโ [email protected] ([email protected], [email protected], [email protected], [email protected])
โโโ [email protected]
โโโ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โโโ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โโโ [email protected] ([email protected], [email protected], [email protected])
โโโ [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
โโโ [email protected]
Any help or pointers are appreciated, thanks!
When I start cuke-monkey with "--log=/logs/cuke-monkey/"/logs/cuke-monkey/"
Then it writes a separate log file for each tool into the folder "
tail -f
Out of the box nothing happens.
After downloading and starting chromedriver it still fails with:
RuntimeError: RuntimeError
(UnknownError:13) An unknown server-side error occurred while processing the command.
Problem: POST /session//timeouts/async_script
Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:02:37'
System info: host: 'jonas-mbp', ip: '192.168.2.100', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.2', java.version: '1.8.0_25'
Driver info: driver.version: unknown
Posted at https://chimp.readme.io/v1.0/discuss/55c75be337d9670d00ca4485 but not sure if it's a tutorial oversight, or if there's some weird bug with Chimp.
I've had very odd results with this test after changing the waitForExist line to
browser.waitForExist('a=doesntreallyexist');
If I rename the step_defs.js
file and/or move it under some subdirectory and/or change doesntreallyexist
to some other nonexistent string` a bunch of times (couldn't find a clearly reproducible sequence), the test will correctly fail. Most of the time the test will incorrectly pass.
Here's a log excerpt:
[chimp] Running...
Feature: Search the Web
As a human
I want to search the web
So I can find information
@watch
Scenario: Search for Xolv.io # features\search.feature:8
Given I have visited Google # features\search.feature:9
When I search for "Xolv.io" # features\search.feature:10
Then I see "Xolv.io" # features\search.feature:11
1 scenario (1 passed)
3 steps (3 passed)
[chimp] Running...
[chimp] Running...
Feature: Search the Web
As a human
I want to search the web
So I can find information
@watch
Scenario: Search for Xolv.io # features\search.feature:8
Given I have visited Google # features\search.feature:9
When I search for "Xolv.io" # features\search.feature:10
Then I see "Xolv.io" # features\search.feature:11
1 scenario (1 passed)
3 steps (3 passed)
[chimp] Running...
Feature: Search the Web
As a human
I want to search the web
So I can find information
@watch
Scenario: Search for Xolv.io # features\search.feature:8
Given I have visited Google # features\search.feature:9
When I search for "Xolv.io" # features\search.feature:10
Then I see "Xolv.io" # features\search.feature:11
Error: element (a=pp) still not existing after 10000ms
at World.<anonymous> (features\search.steps.js:13:13)
- - - - -
(::) failed steps (::)
Error: element (a=pp) still not existing after 10000ms
at World.<anonymous> (features\search.steps.js:13:13)
- - - - -
Failing scenarios:
features\search.feature:8 # Scenario: Search for Xolv.io
1 scenario (1 failed)
3 steps (1 failed, 2 passed)
[chimp] Finished running async processes with errors
[chimp] run complete with errors Cucumber steps failed
[chimp] Running...
Feature: Search the Web
As a human
I want to search the web
So I can find information
@watch
Scenario: Search for Xolv.io # features\search.feature:8
Given I have visited Google # features\search.feature:9
When I search for "Xolv.io" # features\search.feature:10
Then I see "Xolv.io" # features\search.feature:11
Error: element (a=ppihiu) still not existing after 10000ms
at World.<anonymous> (features\search.steps.js:13:13)
- - - - -
(::) failed steps (::)
Error: element (a=ppihiu) still not existing after 10000ms
at World.<anonymous> (features\search.steps.js:13:13)
- - - - -
Failing scenarios:
features\search.feature:8 # Scenario: Search for Xolv.io
1 scenario (1 failed)
3 steps (1 failed, 2 passed)
[chimp] Finished running async processes with errors
[chimp] run complete with errors Cucumber steps failed
[chimp] Running...
[chimp] Running...
Feature: Search the Web
As a human
I want to search the web
So I can find information
@watch
Scenario: Search for Xolv.io # features\search.feature:8
Given I have visited Google # features\search.feature:9
When I search for "Xolv.io" # features\search.feature:10
Then I see "Xolv.io" # features\search.feature:11
1 scenario (1 passed)
3 steps (3 passed)
I'm running chimp --watch
on Windows 7 with Chrome. Hopefully I'm missing something obvious.
{ [Error: The best matching driver provider org.openqa.selenium.edge.EdgeDriver
can't create a new driver instance for Capabilities [{rotatable=true, locationCo
ntextEnabled=true, name=, loggingPrefs=org.openqa.selenium.logging.LoggingPrefer
ences@49f264be, browserName=IE, javascriptEnabled=true, handlesAlerts=true, vers
ion=, platform=ANY, requestOrigins={name=webdriverio, version=3.2.1, url=http://
webdriver.io}}]
Build info: version: '2.47.1', revision: '411b314', time: '2015-07-30 03:03:16'
System info: host: 'MBP-WINDOWS', ip: '172.16.66.130', os.name: 'Windows 7', os.
arch: 'amd64', os.version: '6.1', java.version: '1.8.0_60'
Driver info: driver.version: unknown]
I can successfully test against Chrome and Firefox
It opens Firefox but then does nothing and times out. It opens Firefox again for the next scenario and the same thing as before happens.
Hello,
I'm trying to use chimpjs with page object pattern.
In my BDD spec I'd like to have something like:
this.Given(I login to app, function () {
loginPageObject.loginToApp();
}
e.g.
loginPageObject - an object having methods available on login page
loginToApp() - a method with webdriverIO API
Could you provide an example how to do this?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.