0

I'm using Protractor on Selenium, MacOS and Chrome. I'm trying to run the same test using an array of elements to provide the test data:

As I read here: Looping on a protractor test with parameters

I was trying that solution but when I run it, my test is not even found:

 for(var i = 0; casos.length; i++){

            (function(cotizacion){
                it('obtener $1,230.00 de la cotizacion', function(){
                    browser.get('https://mifel-danielarias.c9users.io');
                    login(user,pass);
                    fillVidaCotizadorForm(formData);
                    //browser.sleep(5000);
                    var primaTotal = element(by.binding('vida.primaTotal'));
                    browser.wait(EC.visibilityOf(primaTotal),4000);
                    expect(primaTotal.getText()).toBe(cotizacion);
                });
            })(casos[i].Fallecimiento);
        }

Output message:

> [14:13:01] I/hosted - Using the selenium server at
> http://localhost:4444/wd/hub [14:13:01] I/launcher - Running 1
> instances of WebDriver Started
> 
> 
> No specs found Finished in 0.003 seconds

This loop is inside my describe function and if I run the test normally without any loop, it runs flawlessly.

David Buck
  • 3,752
  • 35
  • 31
  • 35
Fcojavmelo
  • 368
  • 1
  • 11

1 Answers1

0

As @OptimWorks mentioned in his comment, Data Driven Approach was exactly what I was looking for, and this question provided several good answers.

Fcojavmelo
  • 368
  • 1
  • 11
  • You should add some context from the link as link only answers are not considered good practice. Please see https://stackoverflow.com/help/how-to-answer – Marcello B. Feb 19 '20 at 23:22