Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can take a step further. Since Cypress is controlling all of this and it can also control your Network request and you can intercept that. In that case your request doesn’t need to go event to your server. 

...

In some scenarios, you don’t even have to reach your application server. In that case your request will be intercepted by Interceptor (XHR), it doesn’t even have to reach your server. In that case your request goes to that (interceptor) and response gets back from that. In this scenario your will be mocking so you can go much faster. 

...

That is in high level how the Cypress works.

 ================================================================

HOW TO GET START CYPRESS?

 

Install via npm:

 

...

When you do that, you can see that Cypress automatically generates a file and folder with this file in it.

...

“cypress.json” file it’s basically file configuration.

It’s also generates a folder called “integration” when you will be putting all your tests:

...

Inside this folder your organize your test tests however your like, (adding subfolder, etc).

Another valuable folder is “Fixture folder”

...

It houses all mocked data for certain scenarios. So when you run your test, you can refer to that folder. 

Next one is Pluggins folder. This folder is helpful when you want to extent Cypress functionality.

...

When try to run certain task to automate things, you can put all that code inside this folder to extend the feature of Cypress.

Lastly when you run your test, you have a lot of command code. You will be creating, removing a lot of data or manipulating a lot of data. And also a lot of repetitive code which Cypress puts that in Support folder.

...

How do you run Cypress? It can be in two ways. You can run “npx”, it will find and executable path:

...

If you run in CIN environment you will use “run” command. It will run everything on your terminal. When you fires up, it’s open you Welcome screen”.

...

To see how the Cypress actually is running, just you need to login to PluralSight and start to follow the course on the PluralSight from 19 min and 45 sec: Let’s go started running “todos” application:

https://app.pluralsight.com/course-player?clipId=a57d8964-ce01-4ddf-abb7-715206a39d75  

...

 

 

CYPRESS LIMITATIONS, also called “Trade-offs”. 

Permanent Trade-Offs: 

  • Fist trade-off limitation is: It’s not really “General Automation Tool”. Cypress relies on the browser, it’s not good for the applications which are not web based.

  • Second limitation is: It doesn’t support multiple tabs by design. It things that this scenario can be resolved in different ways. It has an article about it and solution how you can address that.

  • For the same reason it can be fired up the two browser at the same time.

...

Again, Cypress is a tool that runs commands inside browser.

  • So only language that it speaks is JavaScript. That is by design.

  • Each test bound to single origin. For example, you cannot visit at the same test: Google.com and
    Amazon.com. You can test subdomains of one of it but you cannot visit two separate domains at the same test.

...

Temporary Trade-Offs: 

  • It’s relying on the Mocha Trade-Offs Framework.

  • Other limitation is that it only works in Chrome, not able to support other browser at that time.

These temporary trade-offs with can be changed in the future by Cypress team. 

...