gulp-protractor-qa icon indicating copy to clipboard operation
gulp-protractor-qa copied to clipboard

pageObjects with dynamic attributes in locators not working

Open patfrat opened this issue 8 years ago • 2 comments

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));
};

patfrat avatar May 20 '16 09:05 patfrat

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.

ramonvictor avatar May 27 '16 10:05 ramonvictor

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

patfrat avatar May 27 '16 11:05 patfrat