lundi 2 mai 2016

Run protractor e2e tests in TFS build

How I should configure my TFS build to make it possible run protractor e2e test in browserstack, and return me some html report which test are failed? I am new in TFS. I can do it manually from my machine, but not sure have I can do it in TFS. This is how my protractor config looks like:

var project = 'testProject',
build = 'build_4',
acceptSslCerts = 'true';

var HtmlScreenshotReporter = require('protractor-jasmine2-screenshot-reporter');

var reporter = new HtmlScreenshotReporter({
dest: './html-report/',
filename: 'my-report.html',
reportOnlyFailedSpecs: false,
captureOnlyFailedSpecs: true,
showSummary: true,    
});

module.exports.config = {
framework: 'jasmine2',
seleniumAddress: 'http://ift.tt/1xLqeX2', /*  'http://localhost:4444/wd/hub', */
allScriptsTimeout: 40000,
specs: [    'test-spec.js'    ],
 capabilities: {
     browserName: 'chrome',
     loggingPrefs: { driver: 'ALL', server: 'ALL', browser: 'ALL' },
     'build' : 'version3',
     'project' : 'newintropage',
     'browserstack.user': 'browserstack.user',
     'browserstack.key': 'browserstack.key',        
     'browser': 'Edge',
     'browser_version': '13.0',
     'os': 'Windows',
     'os_version': '10',
     'resolution': '1024x768',

     'acceptSslCerts': acceptSslCerts
 },    
jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 40000
},
// Setup the report before any tests start
beforeLaunch: function () {
    return new Promise(function (resolve) {
        reporter.beforeLaunch(resolve);
    });
},
onPrepare: function () {       
    jasmine.getEnv().addReporter(reporter);
},
// Close the report after all tests finish
afterLaunch: function (exitCode) {
    return new Promise(function (resolve) {
        reporter.afterLaunch(resolve.bind(this, exitCode));
    });
}
};

And that's how my tfs build looks like:

enter image description here

Aucun commentaire:

Enregistrer un commentaire