I encounter a strange bug with protractor with the following e2e tests:
it('should render vehicle title', () => {
expect(vehicleTitle.getText()).toBeTruthy();
});
it('should have color dropdown', () => {
expect(colorDropdown.isDisplayed()).toBeTruthy();
});
it('should have title and color dropdown', () => {
expect(vehicleTitle.getText()).toBeTruthy();
expect(colorDropdown.isDisplayed()).toBeTruthy();
});
Result:
✓ should render vehicle title
✓ should have color dropdown
✗ sould have title and color dropdown
- Failed: Timed out waiting for asynchronous Angular tasks to finish after 11 seconds. This may be because the current page is not an Angular application. Please see the FAQ for more details: https://github.com/angular/protractor/blob/master/docs/timeouts.md#waiting-for-angular
While waiting for element with locator
my protractor config:
// Protractor configuration file, see link for more information
// https://github.com/angular/protractor/blob/master/lib/config.ts
/*global jasmine */
const { SpecReporter } = require('jasmine-spec-reporter');
const HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
const reporter = new HtmlScreenshotReporter({
dest: 'e2e/reporter/screenshots',
filename: 'protractor-report.html',
userCss: '../style.css',
ignoreSkippedSpecs: true,
reportOnlyFailedSpecs: false,
captureOnlyFailedSpecs: true
});
exports.config = {
allScriptsTimeout: 11000,
specs: [
'./e2e/**/*.e2e-spec.ts'
],
capabilities: {
browserName: 'chrome',
chromeOptions: {
args: [
'incognito',
'disable-extensions'
]
}
},
directConnect: true,
baseUrl: 'http://127.0.0.1:9000/',
framework: 'jasmine',
jasmineNodeOpts: {
showColors: true,
defaultTimeoutInterval: 30000,
print: function() {}
},
// Setup the report before any tests start
beforeLaunch: function() {
return new Promise(function(resolve){
reporter.beforeLaunch(resolve);
});
},
afterLaunch: function(exitCode) {
return new Promise(function(resolve){
reporter.afterLaunch(resolve.bind(this, exitCode));
});
},
onPrepare() {
require('ts-node').register({
project: 'e2e'
});
jasmine.getEnv().addReporter(new SpecReporter({ spec: { displayStacktrace: true } }));
jasmine.getEnv().addReporter(reporter);
}
};
I already tried to increase the multiple timeout available in the protractor config and the use of browser.sleep(n), browser.ignoreSynchronization = true and / or browser.waitForAngularEnabled(false) but nothing works..
Thanks in advance for your time !