From the course: Advanced Cypress
Unlock this course with a free trial
Join today to access over 23,200 courses taught by industry experts.
What are Cypress fixtures? - Cypress Tutorial
From the course: Advanced Cypress
What are Cypress fixtures?
In this video, we're going to talk about setting up fixtures. And fixtures are a way of setting up some local data that can be used for a variety of things. In this video, we're going to look at understanding how to set up and import those fixtures or those bits of hard-coded data that we can use. And then we're going to actually write a test that uses stubbed data or this kind of hard-coded set of fixtures to kind of mock out a network request so that we'll have a set of reliable data. So let's go ahead and dive in. So we have our test runner running. We've got our application running locally. And we're in our my first test.spec.js. So first of all, whenever you initially make your Cypress like initial setup, Cypress bundles this fixtures folder. And inside of it, they've got an example.json file. Now you can use this, which we're going to in this video. You can add more JSON files as well. And the default path to finding and accessing these fixtures, which we'll talk about in a…
Contents
-
-
-
(Locked)
GET and FIND command hacks20m 5s
-
(Locked)
How to install Cypress plugin and set environment variables17m 52s
-
(Locked)
How to handle Cypress async commands12m 10s
-
How to handle non-Cypress async promises11m
-
(Locked)
How to use assertions in Cypress9m 45s
-
(Locked)
How to write tests with Cypress UI commands15m 41s
-
(Locked)
What are Cypress hooks?11m 54s
-
(Locked)
What are Cypress fixtures?16m 56s
-
(Locked)
What are Cypress custom commands?16m 53s
-
(Locked)
What are Cypress mouse commands?14m 13s
-
(Locked)
What are Cypress actions?10m 14s
-
(Locked)
Perform cross-browser testing on Cloud14m 25s
-
(Locked)