angularjs - Protractor test not executing -


i have protractor test. want provide data test can generate tests automatically.

my function below. problem can console log after opening of describe. is'nt case after function.

the code:

bigtestfunction = function(testelements) {  testelements = json.parse(testelements);  (i = 0; < testelements.length; i++) {     var title = testelements[i].title;     var shouldtext = testelements[i].should     var url = testelements[i].url;     var actions = testelements[i].action;      describe(title, function() {         it(shouldtext, function() {              gotourl(url);              (x = 0; x < actions.length; x++) {                  var action = actions[x].action;                 var value = actions[x].value;                 var element = actions[x].element;                 var notempty = actions[x].notempty;                 var nested = actions[x].nested;                  if (action === 'sendkeys') {                     sendkey(element, value);                 }                  if (action === 'click') {                     click(element, notempty);                      if (nested) {                         (x = 0; x < nested.length; x++) {                              if (nested[x]['action'] === 'sendkeys') {                                 sendkey(nested[x]['element'], nested[x]['value']);                             }                              if (nested[x]['action'] === 'click') {                                 click(nested[x]['element'], nested[x]['notempty']);                             }                         }                     }                 }              }         });     }); } 

}

testelements = json.parse(testelements); 

the json:

[   {     "id": 1,     "title": "small test one",     "should": "should start training",     "url": "https://ledmagazine.nl/home",     "actions": [       {         "id": 1,         "test_id": 1,         "element": "/html/body/div[1]/div/div/header/div/div[2]/div[2]/div/div/div/div/nav/section/ul/li[3]/a",         "action": "click",         "status": "notempty",         "value": "/html/body/div[1]/div/div/div[2]/div/div/div[1]/div/section",         "nested": {           "id": 1,           "action_id": 1,           "action": "sendkeys",           "element": "//*[@id=\"mce-email\"]",           "value": "dennisageffen@hotmail.com",           "created_at": null,           "updated_at": null         }       }     ]   } ] 

i think i'm close function stops after 'describe(title, function() {...'

propably missing beforeeach(function() {...} data.


Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -