title: How to fix the Error "TypeError: cy.[custom command] is not a function"?
body: <p>I have written some function in commands.js file for cypress automation testing, out of which I am able to invoke only one i.e."login" but unable to invoke other functions form another .js file. Cypress Test Runner showing </p>
  
  <blockquote>
    <p>"TypeError: <code>cy.FillAddCaseDetails</code> is not a function" </p>
  </blockquote>
  
  <pre class="lang-js prettyprint-override"><code>describe('Adding a Case on CSS Poratal ', function() {
  
    before(function () {
      cy.login()    // calling login function successfully
    })
  
    it('open add case',function(){
      cy.wait(9000)
      cy.hash().should('contains','#/home')
      cy.wait(['@GETcontentLoad']);
      cy.wait(['@POSTcontentLoad']);
      cy.get('[uib-tooltip="Add Case"]').click({force:true})
      cy.log('clicked on Add case')
      cy.wait(3000) 
      cy.get('[ng-click="lookup.cancel()"]').click({force: true})
      cy.get('[ng-click="lookup.closeAddCase()"]').click({force: true})
      cy.get('[uib-tooltip="Add Case"]').click({force:true}) 
      cy.wait(3000)
      cy.get('[ng-model="lookup.selectedPartner"]',{force:true})
        .type(AddJob.JobData.Partner,{force: true}) 
      cy.xpath('//input[@ng-model="lookup.selectedPartner"]')
        .should('be.visible').then(() =&gt; {
          cy.FillAddCaseDetails()   // unable to call   
          cy.FillCustomerDetails()  // unable to call 
        })
  </code></pre>
  
  
  
  <p>Function:</p>
  
  <pre class="lang-js prettyprint-override"><code>Cypress.Commands.add("FillCustomerDetails", () =&gt; {
  
    cy.get('[ng-model="lookup.firstName"]')
      .type(AddJob.JobData.FirstName, { force: true}) 
  
    cy.get('[ng-model="lookup.lastName"]')
      .type(AddJob.JobData.LastName, { force: true })
  
    cy.get('[ng-model="lookup.customerPhone"]')
      .type(AddJob.JobData.CustomerPhone, { force: true })
  
    cy.get('[value="NEXT"]').click({ force: true })
  })
  </code></pre>
  
  <p>expected : function will get called
  <br>
  actual : TypeError: <code>cy.FillAddCaseDetails</code> is not a function</p>