title: Nighwatchjs reading text file nodejs
body: <p>Can anyone help me, i'm trying to add client information on website by reading a text file but i cant get this to work. I want each line to be added</p>
  
  <p>sample text</p>
  
  <pre><code>John:Doe:555-555
  Jane:Doe:555-555
  Ann:Doe:555-555
  </code></pre>
  
  <p>--</p>
  
  <pre><code>const fs = require('fs');
  module.exports = {
  
    'Add Client Info': (browser) =&gt; {
      fs.readFile('RESERVED-CLIENT.txt', {encoding: "utf8"}, function read(err, data) {
      data.split('\r\n').forEach(i =&gt; {
        const a = i.split(':')
        const first_name =  a[0];
        const last_name = a[1];
         const phone_number = a[2];
        return (
          browser
            .url('https://localhost:8000/admin/dashboard')
            .waitForElementVisible('.add-new-client-form', 5000)
            .waitForElementVisible('input[id=client-firstname]', 5000)
            .waitForElementVisible('input[id=client-lastname]', 5000)
            .waitForElementVisible('input[id=client-phone]', 5000)
            .setValue('input[id=client-firstname]', `${first_name}`)
            .setValue('input[id=client-lastname]', `${last_name}`)
             .setValue('input[id=client-phone]', `${phone_number}`)
            .click('#add-client-button')
            .waitForElementVisible('.notice-dashboard', 5000)
             .end()
             )
        })
      })
    }
  }
  </code></pre>
  
  <p>i got error <code>✖ TypeError: Cannot read property 'split' of undefined</code></p>