I'm building a SaaS solution using AngularJS / JBOSS, hosted on a AWS EC2 instance; all our functionality is covered by unit and e2e tests. All the tests run fine locally. We can't figure out how to run them on AWS. Our AWS installation includes a headless CHROME, installed according to these instructions:
Steps to Reproduce
Observed Behavior 1. The following error is shown on the webdriver terminal:
/usr/local/lib/node_modules/protractor/selenium/chromedriver: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
06:41:15.140 WARN - Exception thrown
Expected Behavior 1. The protractor test is executed without errors
Additional resources: 1. Protractor configuration file
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['../test/e2e/**/*.js'],
// A base URL for your application under test. Calls to browser.get()
// with relative paths will be prepended with this.
baseUrl: 'http://localhost:8080/markodojo_solution/#/a3bc8692-5af4-4a4d-b21b-4e6f87dc2a32',
// Options to be passed to Jasmine-node.
jasmineNodeOpts: {
showColors: true,
isVerbose: true,
defaultTimeoutInterval: 30000
},
//Options to output testreuslts in xml format
onPrepare: function() {
// The require statement must be down here, since jasmine-reporters
// needs jasmine to be in the global and protractor does not guarantee
// this until inside the onPrepare function.
require('jasmine-reporters');
jasmine.getEnv().addReporter(
new jasmine.JUnitXmlReporter('xmloutput', true, true));
}
};
Thanks in advance for any assistance!
Testing Against Multiple Browsers If you would like to test against multiple browsers, use the multiCapabilities configuration option. Protractor will run tests in parallel against each set of capabilities. Please note that if multiCapabilities is defined, the runner will ignore the capabilities configuration.
Protractor is an end-to-end testing framework for AngularJS applications and works as a solution integrator — combining powerful tools and technologies such as NodeJS, Selenium, web driver, Jasmine, Cucumber and Mocha. It has a bunch of customizations from Selenium to easily create tests for AngularJS applications.
Go with Headless Chrome option
This greatly simplifies the workflow and having to use more system resources.
Follow the broad steps below:
Change your protractor options to something like below. The important thing is --headless
. Additionally keep in mind that headless mode requires the browser size be specified upfront:-
chromeOptions: {
args: [ "--headless", "--disable-gpu", "--window-size=800,600" ]
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With