Running Protractor tests on Browserstack Automate

前端 未结 4 1851
刺人心
刺人心 2020-12-05 01:03

I\'m developing an AngularJS app and want to do end-2-end testing with Protractor. I would like to benefit from the suite of test browsers available at Browserstack and run

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-05 01:15

    Hello! To only run the test against Browserstack, you may need to skip Step 4 from Niko Nyman answer, and in your conf.js you should have something like here's the one that I've used (+ report), then run Step 5:


        var HtmlReporter = require('protractor-html-screenshot-reporter');
    var reporter=new HtmlReporter({
        baseDirectory: './protractor-result', // a location to store screen shots.
        docTitle: 'Report Test Summary',
        docName:    'protractor-tests-report.html'
    });
    
    // An example configuration file.
    exports.config = {
      // The address of a running selenium server.
      seleniumAddress: 'http://hub.browserstack.com/wd/hub',
    
      // Capabilities to be passed to the webdriver instance.
      capabilities: {
        'browserName': 'chrome',
        'version': '22.0',
        'browserstack.user' : 'user_name',
        'browserstack.key' : 'user_key',
        'browserstack.debug' : 'true'
    
      },
    
      // Spec patterns are relative to the current working directly when
      // protractor is called.
      specs: ['./specs/home_page_spec.js'],
    
      // Options to be passed to Jasmine-node.
      jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000
      },
     onPrepare: function() {
            jasmine.getEnv().addReporter(reporter);
          }
    
      };
    

提交回复
热议问题