title: Conditional testing withing a NightWatchJS test script
body: <p>I am trying to write a nightwatch test script with conditions in the test script. My code so far</p>
  
  <pre><code>module.exports = {
  tags: ['getting-started'],
  set_url: function (browser) {
  browser.url('http://www.google.com');
  browser.pause(5000);
  browser.assert.title('Google');
  if (browser.expect.element('#main').to.be.present) {
      browser.pause(5000);
      browser.setValue('input[type=text]', ['Night Watcher', browser.Keys.ENTER]);
      browser.pause(5000);
      if(browser.assert.containsText('#main', 'The Night Watch')){
      console.log('search has the right result'); // for example
      }else{
      console.log('No result found');
      }
  }
  browser.end();
  }
  </code></pre>
  
  <p>}
  But the <code>browser.expect.element('#main').to.be.present</code> and <code>browser.assert.containsText('#main', 'The Night Watch')</code> returns an object and is not actually the result I am interested with.
  But the <code>browser.expect.element('#main').to.be.present</code> and <code>browser.assert.containsText('#main', 'The Night Watch')</code> returns an object and is not actually the result I am interested with.</p>