Closed galenp closed 5 months ago
Thanks for the detailed issue. I haven't used protractor in over a year, but I suspect this might be due to version problems. First, make sure you're running the very latest jasmine-given.
Next, if you could share a minimal sample project that'd be really fantastic for helping me debug. Cheers!
Instead of attaching a project I'll give you the full npm instructions to set up a test.
Assuming you are on a desktop (not VM) linux installation this should work and get selenium going.
mkdir ~/jasmine-given-test
cd ~/jasmine-given-test
npm install protractor jasmine-given --save-dev
./node_modules/protractor/bin/webdriver-manager update
./node_modules/protractor/bin/webdriver-manager start
So you should have selenium running now ... so create another terminal session/console and do:
cd ~/jasmine-given-test
mkdir test
mkdir test/e2e
nano protractor.js
// An example configuration file.
require('coffee-script/register');
require('jasmine-given');
exports.config = {
// The address of a running selenium server.
seleniumAddress: 'http://localhost:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
// Spec patterns are relative to the current working directly when
// protractor is called.
specs: [
'test/e2e/*_spec.{js,coffee}'
],
baseUrl: 'http://hello-angularjs.appspot.com/helloworld',
jasmineNodeOpts: {
onComplete: function () {},
isVerbose: false,
showColors: true,
includeStackTrace: false,
defaultTimeoutInterval: 30000
}
};
Save and Exit
nano test/e2e/test_spec.coffee
describe 'test', ->
describe 'connect to test site', ->
Given -> browser.get("/")
Then -> expect(1).toBe 1
Save and Exit
./node_modules/protractor/bin/protractor ./protractor.js
TypeError: Object [object Object] has no method 'toHaveReturnedFalseFromThen'
getting the same error with newest version 2.6.2, coffescript 1.7.1 and protractor 2.0.0
Did you find a solution, @galenp?
Thanks a lot! Marcel
Hello
I am attempting to write coffeescript protractor e2e tests using jasmine-given.
Things seem to work for the most part, the tests run and the form is filled in and submitted but the Then statement fails with an error. It seems to fail regardless of my test...
login_spec.coffee
top of protractor.conf
And then it's a standard protractor conf.
Results
I don't understand the error or what it could relate to. I've checked that toHaveReturnedFalseFromThen is part of jasmine-given.
Thanks in Advance