ramonvictor / gulp-protractor-qa

Warns whether Protractor locators have their matches within a given set of AngularJS view files
https://www.npmjs.org/package/gulp-protractor-qa
MIT License
59 stars 18 forks source link

pageObjects with dynamic attributes in locators not working #21

Open patfrat opened 8 years ago

patfrat commented 8 years ago

Hello

Protractor-qa does not recognize this type of selectors I have in my pageObjects ! With dynamic attributes or variables.

var myFunc = function (name) {
  return element(by.css('h1[attr-name="' + name + '"]'));
};

or

var myFunc = function (myClass) {
  return element(by.css(myClass));
};
ramonvictor commented 8 years ago

Hi @patfrat,

First of all, sorry for the delay. It's been a pretty busy week. So, this is a "known issue", because my code is not smart enough to figure out what are the dynamic variable values. At the moment, gulp-protractor-qa can only check for static string arguments (e.g.: element(by.css('h1[attr-name="whatever"]')).

Unfortunately I'm not planning to work on this any time soon. So, if anybody is willing to open a PR to fix this issue I'd be more than happy to merge the change.

Thanks for raising the issue anyways. Hope we can find more contributors to keep this project alive.

patfrat commented 8 years ago

ok, so there is a hope to add a support for dynamic variables ... just missing time and contributors Thanks