1

I have a pool of 5 userIds.

Using concurrent execution I want to use 3 unique userIds of the above at at the same time concurrently as using the same userId in more than one test will interfere and cause failures.

A) While I have the code to manage the pool of users. I dont know how to inform the userId to the pool for which the test has finished. i.e. how to pass the user into the afterEach() which would contain the onLogout() call.

B) I dont know where to initialise the pool (i.e. an array of user Ids) and maintain the array.

Would the UIDs be better to maintain in the config.js at least the list can be put there and accesed as browser.availableUids. But where should I declare/define the dynamic arrays I will be playing with in the onLogout and forLogin functions.

availableUids: ["qpr", "qprpa", "entice", "qprmeapa", "qprentice"],
usedUids: [],



function onLogout() {
   availableUids.push(user);
      _.remove(usedUids, function(el) {
        return (el == user);
      });
      console.log(n, " interval seconds")
      console.log("availableUids :", availableUids);
      console.log("usedUids      :", usedUids);
      console.log("availableUids + usedUids users in CALLED", availableUids.length + usedUids.length);
      console.log();
}


function forLogin() {
   var ra = chooseRandArrayNum(availableUids.length);
   console.log("availableUids.length", availableUids.length);
   var chosenUser = availableUids[ra];

   usedUids.push(chosenUser);
   _.remove(availableUids, function(el) {
      return (el == chosenUser);
   });
   console.log("availableUids + usedUids users in CALLING", availableUids.length + usedUids.length); 
}

Still struggling a bit due to lack of JavaScript and Jasmine knowledge. Any pointers and help are welcome.

win
  • 119
  • 2
  • 14

0 Answers0