title: Cypress: "TypeError: form.submit is not a function"
body: <p>I was making a spec file to test my forms in Cypress when suddenly this pops out:</p>
  
  <p><strong>TypeError: form.submit is not a function</strong>
  : __cypress/runner/cypress_runner.js:67597:14</p>
  
  <p>This is the code:</p>
  
  <pre><code>cy.get(form).within(($form) =&gt; {    
  
      cy.root().submit();
  
  });
  </code></pre>
  
  <p>You can clearly see the part that causes the error is the <code>cy.root().submit();</code> line.
  but then when I check the element on the console, this comes out:</p>
  
  <p><a href="https://i.stack.imgur.com/1WQRC.png" rel="nofollow noreferrer">root output on console</a></p>
  
  <p>So, it's a form!</p>
  
  <p>I've got the code from here <a href="https://docs.cypress.io/api/commands/within.html#Forms" rel="nofollow noreferrer">https://docs.cypress.io/api/commands/within.html#Forms</a></p>
  
  <p>Screenshot of the run:</p>
  
  <p><a href="https://i.stack.imgur.com/IoN74.png" rel="nofollow noreferrer">Run test</a></p>
  
  <p><strong>What am I missing? Am i missing some dependency maybe?</strong></p>
  
  <p>PD: I am using chrome 79</p>