Perform function not working as hoped #2612
Unanswered
dharls36
asked this question in
Help Needed
Replies: 1 comment
-
can you please format the code properly? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi.
I have the following code;
'QA-91: trim selection - trim drop down contains a list of trims': function (browser) { browser.perform(function() { browser.elements('css selector', '.trim-equipment-list__filter option[value]:not(:first-child)', function(trimElements) { var numberOfTrimElements = (trimElements.value.length); }); }); },
'QA-91: trim selection - the (standard & optional) equipment accordions are greyed out when a trim is not selected': function (browser) { .assert.elementPresent('.trim-level__equipment:nth-child(3) .trim-level__equipment__heading--disabled'); },
'QA-91: trim selection - a trim can be selected': function (browser) { browser.perform(function(numberOfTrimElements, done) { var randomTrim = Math.floor(Math.random() * numberOfTrimElements) + 1; console.log('a trim can be selected number of trims = ', randomTrim); done(); }); },
So I'm trying to reuse numberOfTrimElements variable from the first test, in the 3rd test.
I thought I could do this using the perform command, but I just get a NaN result in the 3rd test.
Is there something I'm missing with the perform command?
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions