Hi there!
- Operating system and version
Jasmine version: 2.4.1
Browser name: chrome
Browser version: 53.0.2785.143
Platform: LINUX
Javascript enabled: true
Css selectors enabled: true
- Node.js version - v8.1.2
- Protractor version - ~4.0.10
- Protractor flake version : "^3.0.1"
- Protractor configuration file :
flake :
#!/usr/bin/env node
/**
- flake is a node script that uses protractor-flake to re-run failed tests. Note
- that it reruns tests at the file level, so if one test fails, it will rerun all
- the tests in that file. Still... awesome.
- usage:
./flake conf.js [other protractor args]
*/
//const rerun = require('./module');
const protractorFlake = require('protractor-flake');
// skip first two passed args (node and self)
let protractorArgs = process.argv.splice(2);
protractorFlake({
protractorPath: 'node_modules/.bin/protractor',
maxAttempts: 2,
parser: 'standard', //even tried with multi
nodeBin: 'node',
color: 'magenta',
protractorArgs: protractorArgs
}, function(status, output) {
process.exit(status);
});
Package.json :
{
"version": "0.0.0",
"private": true,
"name": "weardex-app-bazooka-test",
"description": "weardex",
"license": "MIT",
"devDependencies": {
"jasmine-reporters": "~1.0.1",
"jasmine-spec-reporter": "^4.2.1",
"moment": "~2.9.0",
"mysql": "~2.8.0",
"protractor": "~4.0.10",
"protractor-console": "^3.0.0",
"protractor-html-screenshot-reporter": "0.0.19",
"protractor-jasmine2-screenshot-reporter": "^0.4.0"
},
"scripts": {
"postinstall": "node_modules/protractor/bin/webdriver-manager update",
"prestart": "npm install",
"start": "node_modules/protractor/bin/webdriver-manager start",
"pretest": "npm install",
"test": "./flake conf.js",
"debug": "npm install;node_modules/protractor/bin/protractor debug config.js",
"update-index-async": "node -e "require('shelljs/global'); sed('-i', /\/\/@@NG_LOADER_START@@[\s\S]*\/\/@@NG_LOADER_END@@/, '//@@NG_LOADER_START@@\n' + cat('bower_components/angular-loader/angular-loader.min.js') + '\n//@@NG_LOADER_END@@', 'app/index-async.html');""
},
"dependencies": {
"node-redshift": "0.0.6",
"protractor-flake": "^3.0.1"
}
}
conf.js :
/**
- Protractor config file for running LIVE test #cases
*/
var path = require('path');
var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
var reporter = new SpecReporter({
spec: {
displayStackTrace: true;
}
})
// var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');
// var reporter = new HtmlScreenshotReporter({
// dest: 'screenshots',
// filename: 'Dashboard_E2E_Results.html',
// showConfiguration: true,
// reportFailedUrl: true,
// inlineImages: true,
// captureOnlyFailedSpecs: true,
// reportOnlyFailedSpecs: false,
// showSummary: true,
// showQuickLinks: true,
// reportTitle: "SUMMARY_OF_FAILED_SPECS_E2E_RESULTS",
// metadataBuilder: function(currentSpec, suites, browserCapabilities) {
// return { id: currentSpec.id, os: browserCapabilities.get('browserName') };
// },
// pathBuilder: function(currentSpec, suites, browserCapabilities) {
// // will return chrome/your-spec-name.png
// return browserCapabilities.get('browserName') + '/' + currentSpec.fullName;
// }
// });
exports.config = {
// seleniumAddress: 'http://0.0.0.0:4444/wd/hub',
// seleniumAddress: 'http://localhost:4444/wd/hub',
// CSS Selector for the element housing the angular app - this defaults to
// body, but is necessary if ng-app is on a descendant of .
rootElement: 'body',
allScriptsTimeout: 60000,
framework: 'jasmine',
jasmineNodeOpts: {
// If true, display spec names.
isVerbose: true,
// If true, print colors to the terminal.
showColors: true,
// If true, include stack traces in failures.
includeStackTrace: true,
// Default time to wait in ms before a test fails.
defaultTimeoutInterval: 60000,
print: function();
},
params : {
// lang : 'zh_CN'
lang : 'en'
},
baseUrl: 'https://dashboard.visenze.com',
multiCapabilities: [
//{'browserName': 'firefox'},
{'specs': ['tests/regression/ftpUpload.js'],
'browserName': 'chrome',
},
// {'specs': ['tests/regression/uploadAndTag.js'],
// 'browserName': 'chrome',
// },
{'specs':['tests/regression/forgetPassword.js','tests/regression/changePassword.js','tests/regression/updateProfile.js','tests/regression/application.js'],
'browserName': 'chrome',
},
{'specs':['tests/regression/teamMember/adminOperations.js','tests/regression/teamMember/powerUserOperations.js','tests/regression/teamMember/readOnlyUserOperations.js'],
'browserName': 'chrome',
},
{'specs':['tests/regression/permission.js','tests/regression/overview.js','tests/regression/apiIntegration.js','tests/regression/clientSideIntegration.js'],
'browserName': 'chrome',
},
{'specs': ['tests/regression/systemManagement2.js','tests/regression/urlRouting/userOperations.js'],
'browserName': 'chrome'
},
{'specs': ['tests/regression/uploadDatafeed.js','tests/regression/schemaEdit.js','tests/regression/search.js'],
'browserName': 'chrome'
},
// {'specs': ['tests/regression/gettingStarted.js'],
// 'browserName': 'chrome'
// },
],
plugins: [{
package: 'protractor-console',
logLevels: ['severe']
}],
// Maximum number of total browser sessions to run. Tests are queued in
// sequence if number of browser sessions is limited by this parameter.
// Use a number less than 1 to denote unlimited. Default is unlimited.
// maxSessions: 1,
// onPrepare: function(){
// // Add a screenshot reporter and set location for storing screenshots
// var now = new Date();
// var timeStamp = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate() + '-' + now.getHours() + 'h' + now.getMinutes() + 'm' + now.getSeconds()+'s';
// var HtmlReporter = require('protractor-html-screenshot-reporter');
//
// jasmine.getEnv().addReporter(new HtmlReporter({
// baseDirectory: './test_results/screenshot_reports',
// pathBuilder: function pathBuilder(spec, descriptions, results, capabilities) {
// return path.join(capabilities.caps_.browserName, descriptions.join('_'));
// },
// docName: 'html_screenshots_test_report_' + timeStamp + '.html',
// takeScreenShotsOnlyForFailedSpecs: true
// }));
// require('jasmine-reporters');
// jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter('./test_results/xml_reports', true, true, ''));
// }
// Setup the report before any tests start
// beforeLaunch: function () {
// return new Promise(function (resolve) {
// reporter.beforeLaunch(resolve);
// });
// },
// // Close the report after all tests finish
// afterLaunch: function (exitCode) {
// return new Promise(function (resolve) {
// reporter.afterLaunch(resolve.bind(this, exitCode));
// });
// },
//Onprepare function
onPrepare: function () {
var width = 1300;
var height = 1200;
browser.driver.manage().window().maximize();
browser.driver.manage().timeouts().implicitlyWait(20000);
browser.driver.manage().window().setSize(width, height);
jasmine.getEnv().addReporter(reporter);
afterAll(function (done) {
process.nextTick(done);
});
}
};
You can collect the first few items easily with the trouble cli npx @nicktomlin/trouble protractor protractor-flake
(or npm i -g @nicktomlin/trouble && trouble protractor protractor-flake
)