Versions Compared

Key

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

...

https://app.pluralsight.com/course-player?courseId=d3324477-3780-4dac-9dbb-1b8361f3e4ef

Image RemovedImage Added

Provided Course provided by:

Instructor: Fernando Avindra, Company: Array (Software Consulting Company -> helping the client to find the best solution for 2E2 – end to end solution).

...

Testing for web application 2E2 prior Cypress required to think about framework. To test that people were using application like: Mocha, Jasmin, QUnit, Karma, etc. Also some other tools for assertion library like: Chai and Expect.js to see if their application is doing what supposed to do.

...

Then they pick the tool like appeared tool called: Selenium, which is very popular today to test end to end, interact with your application and runs automation. They are different flavours of Selenium that with different abilities like Nightwatch or Webdriver. Other tools to help us add additional libraries like: Sinon or TestDouble.

...

Change your code to “False” and run it.             expect(true).to.equal(false)

 

...

Automatic Waiting – third feature of Cypress, probably the biggest one. Cypress is a tool that knows about your network request when you are sending and you are receiving. 

...

You can take control over of those request by (Network Control):  You can spy on them: by spying – you make a request by you actually are spying what is going on. 

...

Stubbing is is a way to modify a function and delegate control overs its behavior to you (the programmer).

...

Clock - there are situations when it is useful to control your application's date and time in order to override its behavior or avoid slow tests. With cy.clock() you can control. If in your test you have to need wait for some time, you can actually trick the clock to not waste your time:

  • Date

  • setTimeout

  • setInterva

 

Cypress also comes with a lot of tools build in:CYPRESS ALSO COMES WITH A LOT OF TOOLS BUILD IN:

...

  • Lodash - a JavaScript utility library delivering consistency, modularity, performance, & extras.

  • Sinon for network stubbing

  • Moment – for time manipulation

  • JQuery

  • Mocha

...

 

Finally, Cypress has an ability to take screenshots and videos when your test fails.  Also generates and compresses and high quality videos. So, you don’t want to waste the space. To get high quality video you need to disable compression. It is possible to disable and unable the compression. It can be run on CIN (Convert Interconnected Network) environment and you can see what happens, why the test failed and on what step. So you can visually and quickly see what is going on.

...

 

 

 

Cypress Architecture

 CYPRESS ARCHITECTURE

How all this really work? How Cypress is different from other apps?

What is Cypress API? Cypress is an open sourced JavaScript-based test automation framework that is typically used for testing web applications that leverage modern JavaScript frameworks. 

...

Cypress is essentially an electronic app. It can interact with your application server. You can interact with them when Cypress runs. Cypress has a browser inside of it. Because of that reason, it is able to can control everything what is going on in and out of the browser. Has an access of all of the browsers of APIs. It knows when request has been made and complete. Because of this “inbrowser” tool. And testing time what it is really doing? It is firing your application in this “inbrowser” then you can interact with you application server when you run your test. So can make request and you can get the response back. 

...

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.

...