title: How to get a value from a promise and store it in a variable for further use
body: <p>How to get a value from a promise and store it in a variable for further use.</p>
  <p>I am expecting my method to return a passoword as string rather than a  resolved promise object. I need passoword string so that I can pass it to httpAuth function given below. httpAuth() is from TestCafe automation framework</p>
  <p>Test.js code:</p>
  <pre><code>let mypass=Utils.returnPwd(); //I am using returnPwd() from Utils.js file that's returning a password.
  
  fixture`Automated Test1`
      .meta('fixturepack', 'regression')
      .page(&quot;http://intranetURL&quot;)
      .beforeEach(async t =&gt; {             
          DriverManager.setDriver(t);
          await DriverManager.maximize();         
      })
      .httpAuth({
          username: 'loginuser1',
          password:  mypass
      })
  </code></pre>
  <p>Utils.js code:</p>
  <pre><code>  async base64Decoding(encodedPassword) {        
      var decodedData = Buffer.from(encodedPassword, 'base64').toString('ascii'); 
      var decodedPassword = decodedData.toString()
      console.log(decodedPassword);
      return decodedPassword;
      }
  
      async returnPwd(){
          let mypass2= this.base64Decoding('A2dIOEhBfXYvfSNba');        
         return mypass2.then(function(){ })
      }
  </code></pre>
  <p>Current error:
  credentials.password is expected to be a string, but it was object.</p>
  <blockquote>
  <p>.httpAuth({
  username: 'loginuser1',
  password:  mypass
  })</p>
  </blockquote>