title: Cypress BDD: Cypress Cucumber processor: Cannot Run Step Definition .js file
body: <p>I am trying to build a cypress BDD framework.  I've think I've created the feature and step definition file correctly. When I run the the test with <code>npx cypress run --spec cypress/integration/examples/shoppingCart.feature  --headed --browser chrome</code>, I get the following result <a href="https://www.dropbox.com/s/d7v8ae7ilx0eae1/shoppingCart.feature.mp4?dl=0" rel="nofollow noreferrer">here in this video</a> , the vid is about 20sec long.</p>
  <p>I wasn't sure what to think so <a href="https://www.dropbox.com/s/lwhorpwtxxcoxfr/BDDError.mp4?dl=0" rel="nofollow noreferrer">I did another video</a> that was a process of elimination and looking at the BDD set up. I'm still unsure (this one is about 8 mins long).</p>
  <p>I will add the feature file, step definition file and error message.</p>
  <p>I am totally puzzled.</p>
  <p>Error message</p>
  <pre><code>`1) End to End shopping cart
         User can purchase items and have them delivered to shipping address:
       Error: Step implementation missing for: I am on the Ecommerce page
        at Context.resolveAndRunStepDefinition (http://localhost:54824/__cypress/tests?p=cypress/integration/examples/shoppingCart.feature:12277:11)
        at Context.eval (http://localhost:54824/__cypress/tests?p=cypress/integration/examples/shoppingCart.feature:11603:35)
  `
  </code></pre>
  <p>Feature file</p>
  <p>Scenario: User can purchase items and have them delivered to shipping address</p>
  <pre><code>Given I am on the Ecommerce page
  When I add the mobile handsets to the shopping cart
  And I verify the total price of shopping cart
  Then I select the checkout button
  When I will select my shipping location
  And I agree to the terms and conditions checkbox
  When I select the Purchase button
  Then I will see an alert stating my order was successful, plus an ETA delivery
  </code></pre>
  <p>Step Definition file</p>
  <pre class="lang-js prettyprint-override"><code>/// &lt;reference types=&quot;Cypress&quot; /&gt;
  
  import { Given,When,Then,And } from &quot;cypress-cucumber-preprocessor/steps&quot;;
  import Homepage from &quot;../../../support/pageObjects/Homepage&quot;;
  import orderSummaryPage from &quot;../../../support/pageObjects/orderSummaryPage&quot;;
  import completeOrderPage from &quot;../../../support/pageObjects/completeOrderPage&quot;;
   
  const homepage = new Homepage()
  const StartCheckout = new orderSummaryPage()
  const CompleteOrder = new completeOrderPage()
   
  Given ( 'I am on the Ecommerce page', () =&gt; {
   
      cy.visit(Cypress.env('url')+&quot;/angularpractice/&quot;)
      
      })
   
  When('I add the mobile handsets to the shopping cart',function () {
   
          homepage.getShopTab().click() 
      
          this.data.mobileHandset.forEach(function(element) {// this custom commad will add items to your cart
      
                cy.AddToCart(element)  
              }); 
      
      
      StartCheckout.getBasketCheckoutButton().click()
      
      } )//end of step 
   
  And('I verify the total price of shopping cart',() =&gt; {
   
      //calculate shopping cart here
      let sum=0
         
      CompleteOrder.getProductCost().each(($e1, index, $list) =&gt;{
      
        const unitCost=$e1.text()  
        let res= unitCost.split(&quot; &quot;) 
        res= res[1].trim() 
        sum=Number(sum)+Number(res)
        
      }).then(function() 
      {
        cy.log(sum)
      
      })
      
      CompleteOrder.getBasketTotalCost().then(function(element)
      {
        const shopCartTotal=element.text()  
        var res= shopCartTotal.split(&quot; &quot;) 
        var total= res[1].trim() 
        expect(Number(total)).to.equal(sum)
      
      })
      
      
      } )//end of step
   
  Then('I select the checkout button',() =&gt; {
   
      StartCheckout.getStartCheckoutButton().click()
   
  } )//end of step
   
  When('I will select my shipping location',() =&gt; {
   
      CompleteOrder.getShippingCountry().type('United Kingdom')
      CompleteOrder.getShippingCountryConfirm().click()
   
  } )//end of step
   
  And('I agree to the terms and conditions checkbox',()=&gt; {
   
      CompleteOrder.getTermsConditionsCheckbox().click({force: true})
   
  })//end of step 
   
  When('I select the Purchase button',()=&gt; {
   
      CompleteOrder.getPurchaseButton().click()
   
  })
   
  Then('I will see an alert stating my order was successful, plus an ETA delivery',()=&gt; {
   
      CompleteOrder.getPurchaseAlert().then(function(element){
   
        
          const actualText= element.text()
         expect(actualText.includes('Success')).to.be.true
      
        }) 
   
  })
  </code></pre>
  <p>I'm sure I even created the BDD framework in the right place.</p>
  <p><a href="https://i.stack.imgur.com/RYpn4.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RYpn4.png" alt="enter image description here" /></a></p>
  <p>Update:</p>
  <p>I was just asked about the <code>non global step definitions</code> in my package.json  (I only copied from the 'script' section onwards).<br />
  Taking a quick look I don't even see it.</p>
  <pre><code> &quot;scripts&quot;: {
      &quot;open&quot;: &quot;cypress open&quot;,
      &quot;scripts&quot;: &quot;cypress run&quot;,
      &quot;headTest&quot;: &quot;cypress run --headed &quot;,
      &quot;chromeTest&quot;: &quot;cypress run --browser chrome&quot;,
      &quot;firefoxTest&quot;: &quot;cypress run --browser firefox&quot;,
      &quot;edgeTest&quot;: &quot;cypress run --browser edge&quot;,
      &quot;testDashboard&quot;: &quot;cypress run --record --key 1642c226-ca7f-49c3-b513-da4ee9222ca8 --parallel&quot;,
      &quot;clean:reports&quot;: &quot;rm -R -f cypress/reports &amp;&amp; mkdir cypress/reports &amp;&amp; mkdir cypress/reports/mochareports&quot;,
      &quot;pretest&quot;: &quot;npm run clean:reports&quot;,
      &quot;combine-reports&quot;: &quot;mochawesome-merge ./cypress/reports/mocha/*.json &gt; cypress/reports/mochareports/report.json&quot;,
      &quot;generate-report&quot;: &quot;marge cypress/reports/mochareports/report.json -f report -o cypress/reports/mochareports&quot;,
      &quot;posttest&quot;: &quot;npm run combine-reports &amp;&amp; npm run generate-report&quot;,
      &quot;test&quot;: &quot;npm run scripts || npm run posttest&quot;
    },
    &quot;cypress-cucumber-preprocessor&quot;: {
      &quot;nonGlobalStepDefinitions&quot;: true
    },
    
    &quot;keywords&quot;: [],
    &quot;author&quot;: &quot;&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;devDependencies&quot;: {
      &quot;cypress&quot;: &quot;^7.4.0&quot;,
      &quot;cypress-cucumber-preprocessor&quot;: &quot;^4.1.3&quot;
    },
    &quot;dependencies&quot;: {
      &quot;cypress-multi-reporters&quot;: &quot;^1.5.0&quot;,
      &quot;mocha&quot;: &quot;^9.0.0&quot;,
      &quot;mochawesome&quot;: &quot;^6.2.2&quot;,
      &quot;mochawesome-merge&quot;: &quot;^4.2.0&quot;,
      &quot;mochawesome-report-generator&quot;: &quot;^5.2.0&quot;,
      &quot;start-server-and-test&quot;: &quot;^1.12.5&quot;
    }
  }
  </code></pre>