vitalets / autotester

Chrome extension that allows to develop and run automation tests right in browser
MIT License
169 stars 25 forks source link

TimeOut #8

Closed kauz closed 7 years ago

kauz commented 7 years ago

I'm really new to selenium. My script works but breaks with an error after a while: timeout of 30000ms exceeded. Ensure the done() callback is being called in this test. I tried to search for different ways, but it looks like that done(); callback is not supported? How can I increase the amount of 30000ms for timeout?

Here is an example of my script:

test.describe('Tests dataset', function () {
  var driver;

  test.before(function () {
    driver = new Driver();
  });

  test.after(function () {
    driver.quit();
  });

  test.it('should return may 2017', function () {
    var artist = ["A Great Big World"];
    for (var i = 0; i < 844; i++) {
    driver.get('http://example.com');
    driver.sleep(1000);
    driver.findElement(By.id("search_value_first")).sendKeys(artist[i] + Key.ENTER);
    driver.sleep(3000);
    var title = driver.findElement(By.className("header_title")).getText().then(function (title) {
    console.log(title);
});
    var text = driver.findElement(By.className("dataset")).getText().then(function (text) {
    console.log(text);
});

   }

  });
});
vitalets commented 7 years ago

Hi @CKIF Yes done() callback is not needed in Selenium tests as they wrap them automatically. I see you are calling scenario 844 times so likely time is more than 30s. Currently there is no configuration option for that but for sure it should be. I will add it to roadmap. Now the solution is to change timeout in extension sources:

kauz commented 7 years ago

Hi @vitalets Thank you for reply. I've already tried to add this line to my 'test.it' function, and it works: this.timeout(100000);

vitalets commented 7 years ago

Ok! Thats great!