2

I would like to dynamically generate it blocks based on the values returned by a promise. Something along these lines:

describe('Main Page', function() {
    var rowNumber=event.script1(); //---Getting promise return value from other.js file

    describe('my loopy test', function() {
        rowNumber.then(function(result) {
            console.log(result.row) //printing row number: 2
            let myData = parseInt(result.row) //passed to integer

            console.log(myData) ; //printing row numbe r:2
            for (let i = 0; i < myData; i++) {
                it('gets ' + myData + 'loopy', function () {
                    console.log(myData);
                });
            };
        });
    });
});

This does not work now, jasmine does not generate it tests here. How should I approach the problem?

  • What are you actually asking? – Kate Paulk Sep 15 '17 at 11:32
  • @KatePaulk edited and added my understanding of the question based on what I understand is happening and what I saw people asking in similar situations. Hope this is what the OP meant. – alecxe Sep 15 '17 at 13:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.