I posted an issue because I thought it was a bug with something to do with Jasmine.
Here is link: https://github.com/angular/protractor/issues/3130#event-628418439
I try to run a simple request to the server. The server reply and angular shows the message but the test freezes and i get the error below.
I am new in e2e (testing in general). Am I doing something wrong or it is a bug.
protractor protractor-e2e.js
Starting selenium standalone server...
[launcher] Running 1 instances of WebDriver
Selenium standalone server started at http://192.168.0.115:54697/wd/hub
Started
A Jasmine spec timed out. Resetting the WebDriver Control Flow.
F
Failures:
1) Registration view should ask for a proper email "The email must be a valid email address."
Message:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
Stack:
Error: Timeout - Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL.
at tryOnTimeout (timers.js:224:11)
at Timer.listOnTimeout (timers.js:198:5)
Ran 1 of 9 specs
1 spec, 1 failure
Finished in 27.718 seconds
Shutting down selenium standalone server.
[launcher] 0 instance(s) of WebDriver still running
[launcher] chrome #01 failed 1 test(s)
[launcher] overall: 1 failed spec(s)
[launcher] Process exited with error code 1
```
protractor --version Version 3.2.2
==UPDATE : complete test ==
'use strict';
var fulanito = {
name: 'Fulano',
last_name: 'De Tal',
email: '[email protected]',
password: 'lacontraseñadefulanito',
};
describe('Registration view', function() {
beforeEach(function() {
browser.get('#/account/register');
browser.manage().logs().get('browser').then(function(browserLog) {
console.log('log: ' + require('util').inspect(browserLog));
});
});
fit('should aske for a proper email "The email must be a valid email address."', function function_name(argument) {
var inputname = element(by.model('userData.name')).sendKeys(fulanito.name);
var inputname = element(by.model('userData.last_name')).sendKeys(fulanito.last_name);
var inputemail = element(by.model('userData.email')).sendKeys('fulanito@ara');
var inputpassword = element(by.model('userData.password')).sendKeys(fulanito.password);
var inputpassword_confirmation = element(by.model('userData.password_confirmation')).sendKeys(fulanito.password);
});
it('should see "Registro"', function() {
expect(element(by.css('h1')).getText()).toContain('Registro');
});
My config file
exports.config = {
allScriptsTimeout: 99999,
// The address of a running selenium server.
//seleniumAddress: 'http://localhost:4444/wd/hub',
// Capabilities to be passed to the webdriver instance.
capabilities: {
'browserName': 'chrome'
},
onPrepare: function() {
// you can also add properties to globals here
global.host= 'http://localhost:9000/';
},
keepAlive: true, //intesive testing
baseUrl: 'http://localhost:9000',
//Stand alone: 9001
//baseUrl: 'http://localhost:9001',
framework: 'jasmine',
// Spec patterns are relative to the current working directly when
// protractor is called.
//specs: ['test/e2e/*.js'],
specs: ['test/e2e/register-spec.js'],
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 25000,
isVerbose: true,
includeStackTrace: true
}
};