lundi 7 décembre 2020

When running e2e tests in Angular 9 and Protractor, is there a way to cache the building of modules?

I'm using Angular 9. I want to run some end-to-end tests using Chrome and protractor. When I run

npm run e2e

I notice each time the modules are re-built

[09:06:45] I/update - chromedriver: setting permissions to 0755 for /Users/davea/Documents/workspace/myangularproject/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_87.0.4280.88
[09:06:45] I/update - chromedriver: chromedriver_87.0.4280.88 up to date
12% building 23/30 modules 7 acti

even if nothing has changed between test runs. Is there anyone I can cache the building of these modules so that it doesn't happen each time? Below if my protractor configuration ...

exports.config = {
  allScriptsTimeout: 11000,
  specs: [
    './src/**/*.e2e-spec.ts'
  ],
  capabilities: {
    browserName: 'chrome',
    chromeOptions: {
      ...chromeBinary,
      args: [
        '--headless', 
        '--window-size=1920,1080',
      ]
    },
  },
  directConnect: true,
  baseUrl: 'http://localhost:4200',
  framework: 'jasmine',
  jasmineNodeOpts: {
    showColors: true,
    defaultTimeoutInterval: 35000,
    print: function() {}
  },
  params:{
    accountlocation_id: 11,
    accountlocation_name: 'Miramar HQ',
    account_name: 'United Data Technologies',
    device_id: 3,
    date: '2020-08-27',
    code: 'UDT-SCANNER-0001',
    short_code: 'Scanner 01',
    device_type: 'V2Lite',
    serial_number: '000008999',
  },
  onPrepare() {
     ...
  }
};

Aucun commentaire:

Enregistrer un commentaire