I have hard time getting the protractor to run tests in Firefox
Following is a sample test case. It can be tested in Chrome - but fails in Firefox and IE browsers.
Test file
<html>
<head>
<title>automation test</title>
<style>
#tst{
width: 200px;
height: 200px;
border: 1px solid;
}
</style>
</head>
<body>
<div id="tst"></div>
<button id="clickme">Click me</button>
<script>
document.getElementById('clickme').addEventListener('click', function(e){
document.getElementById('tst').style.backgroundColor = 'red';
});
</script>
</body>
</html>
Specs file(indexspecs.js)
describe('sample test', function(){
it('change bgColor to red when click the button', function(){
browser.driver.get("http://localhost/test/index.html");
var btn = browser.driver.findElement(by.id('clickme'));
var clRed = "rgba(255, 0, 0, 1)";
btn.click();
expect(browser.driver.findElement(by.id('tst')).getCssValue('background-color')).toEqual(clRed);
});
});
Protractor config file
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: ['indexspecs.js'],
jasmineNodeOpts: {
showColors: true
},
capabilities: {
// 'browserName': 'internet explorer'
'browserName': 'firefox'
}
};
protractor version - 2.0.0
Firefox version - 45
IE version - 11
When set to Firefox, the browser launches - but not getting the url to run the test.