stevekinney / cypress

https://frontendmasters.com/courses/cypress/
135 stars 140 forks source link

examples in lessons/Solution, Basic Practice.md have cy.get('form').submit(); #8

Closed harkinj closed 1 year ago

harkinj commented 2 years ago

Hi, Any reason why most examples in lessons/Solution, Basic Practice.md have cy.get('form').submit(); rather than actually clicking button to submit the form?

I'd expect clicking button to be done as that is what user does to submit the form. Thanks for all info. John

UzaeirAzhar commented 1 year ago

@harkinj For submitting a form its a good practice to use submit instead of click. Here is the link from the official documentation for more reference: https://docs.cypress.io/api/commands/submit#docusaurus_skipToContent_fallback

stevekinney commented 1 year ago

Yup, @UzaeirAzhar is right!