I am completely new to the protractor and I wonder why my button does not get a click when starting a test in Protractor using the selenium webdriver manager.
Button:
<button class="preview-toggle" icon="add" icon-only="" right="" ng-reflect-router-link="add"></button>
In chrome, when I use the following selector: [ng-reflection-router-link = "add"] the required element is found.
My protractor-conf.js:
exports.config = {
seleniumAddress: 'http://localhost:4444/wd/hub',
specs: [
'./features/**/*.feature'
],
capabilities: {
browserName: 'chrome'
},
framework: 'custom',
frameworkPath: require.resolve('protractor-cucumber-framework'),
cucumberOpts: {
format: 'pretty',
require: './features/step_definitions/**/*.js'
},
useAllAngular2AppRoots: true
};
My feature class is simple
Feature: Cool_feature
Scenario: I do something awesome
Given I open up the application
When I click on add
Then I should be the best
My class is test.js
test = function() {
this.Given(/^I open up the application$/, function (callback) {
browser.get('foo.com').then(callback);
});
this.When(/^I click on add$/, function (callback) {
browser.element(by.css('[ng-reflect-router-link="add"]')).click().then(callback);
});
this.Then(/^I should be the best"$/, function (callback) {
});
};
module.exports=test;
source
share