1

I have a desktop app which is build using electron and angular. I would like to develop e2e tests for the application.

We have been trying the spectron framework but support and stability are not to good.

As an alternative I would like to explore protractor. I am having issues writing test cases. The electron app seems to start OK, but every async/await seems to timeout.

"conf.js"

const electronPath = require('electron')

// An example configuration file.
exports.config = {
  directConnect: true,

  SELENIUM_PROMISE_MANAGER: false,

  // Capabilities to be passed to the webdriver instance.
  capabilities: {
    'browserName': 'chrome',
    'chromeOptions': {
      'binary': electronPath,
      'args': ['app=.']
    }
  },

  // Framework to use. Jasmine is recommended.
  framework: 'jasmine',

  // Spec patterns are relative to the current working directory when
  // protractor is called.
  specs: ['../tests/example_spec.js'],

  // Options to be passed to Jasmine.
  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
};

spec.js:


describe('angularjs homepage', function() {

  it('example', async function() {
    console.log('breakpoint');
    var item = element(by.tagName('title'));
    let title = await item.getText();
    console.log(title);
    console.log('breakpoint');
  });

});
wallage
  • 73
  • 2
  • 6

0 Answers0