When we create a project in the Cypress it creates the following folders by default,
1. Fixtures
2. Integration
3. Plugins
4. Screenshots and Videos
5. Support
In order to completely understand the working of cypress we must know what are these folders and what are its purpose.
Fixtures
It is used for loading our data for the test cases otherwise we can also say that they are used for performing data driven testing.
As we have seen in selenium it take few no of code or a separate class to perform a data driven test but here we can load them directly from this folder. We can see their usage in the upcoming sections.
Integration
This is were our test scripts are kept. When we run test via CLI it executes all the test which are present in this folders and its sub folders.
The files in this folders are only displayed when the Test Runner is started.
Plugins
This allows us to utilize the Node process in it for executes our custom code during a particular or any part of out test.
With this you can extend or modify the internal behavior of Cypress.
Screenshots and Videos
Cypress has the ability to take screenshot and Videos whenever the tests are ran, both via Test Runner or CLI.
We can use the below command to manually take screen shots between test,
cy.screenshot()
Video recording can be turned off entirely by setting video to false from within your configuration.
After cypress run completes, Cypress automatically compresses the video in order to save on file size. By default it compresses to a 32 CRF, but this is configurable with the videoCompression property.
Cypress clears any existing screenshots before cypress run. If you do not want to clear your screenshots folder before a run, you can set trashAssetsBeforeRuns to false.