samccone / drool

Automated memory leak detection and analysis
1.48k stars 53 forks source link

Strange example #7

Closed LinusU closed 9 years ago

LinusU commented 9 years ago

The example includes a return statement that always gets run before the first line. I'm not sure if driver.quit() is suppose to be run thought, probably not since that would shut down the driver before the test is finished?

I think that return should be removed.


var drool = require('drool');
var assert = require('assert');

var driver = drool.start({
  chromeOptions: 'no-sandbox'
});

return drool.flow({
  repeatCount: 100,
  setup: function() {
    driver.get('http://todomvc.com/examples/backbone/');
  },
  action: function() {
    driver.findElement(drool.webdriver.By.css('#new-todo')).sendKeys('find magical goats', drool.webdriver.Key.ENTER);
    driver.findElement(drool.webdriver.By.css('#todo-list li')).click();
    driver.findElement(drool.webdriver.By.css('.destroy')).click();
  },
  assert: function(after, initial) {
    assert.equal(initial.nodes, after.nodes, 'node count should match');
  }
}, driver)

driver.quit();
samccone commented 9 years ago

You are right sorry this is my mistake