You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Oct 31, 2022. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+74
Original file line number
Diff line number
Diff line change
@@ -64,6 +64,80 @@ yarn serve
64
64
65
65
We use as backend [Json Api Playground](http://jsonapiplayground.reyesoft.com/).
66
66
67
+
## Running cypress test in console
68
+
69
+
```bash
70
+
yarn cy:run
71
+
```
72
+
73
+
## Running cypress test in browser
74
+
75
+
```bash
76
+
yarn cy:open
77
+
```
78
+
79
+
## Creating a test
80
+
81
+
Go to the following location cypress -> integration, and create a file with the extension .spec.ts. The file contains the following structure:
82
+
83
+
```
84
+
describe('ListBase', () => {
85
+
before(() => {
86
+
cy.disableScreenshot();
87
+
});
88
+
it('ListBase integrity test', () => {
89
+
cy.spyAuthors();
90
+
cy.visit('/#/authors?pageSize=10');
91
+
})
92
+
});
93
+
```
94
+
95
+
## Simulate backend response in cypress
96
+
97
+
Go to the following location cypress -> fixtures, and create a file with the extension .json. In it we will have the supposed response from the backend.
98
+
99
+
```
100
+
{
101
+
"meta": {
102
+
"page": 1,
103
+
"resources_per_page": 10,
104
+
"total_resources": 11
105
+
},
106
+
"data": [
107
+
{
108
+
"type": "authors",
109
+
"id": "14",
110
+
"attributes": {
111
+
"name": "Anais Carroll",
112
+
"birthplace": "Taiwan",
113
+
"date_of_birth": "1986-08-12",
114
+
"date_of_death": "2000-10-05"
115
+
},
116
+
"relationships": {
117
+
"photos": {
118
+
"data": []
119
+
},
120
+
"books": {
121
+
"data": [
122
+
{
123
+
"type": "books",
124
+
"id": "23"
125
+
},
126
+
{
127
+
"type": "books",
128
+
"id": "49"
129
+
}
130
+
]
131
+
}
132
+
},
133
+
"links": {
134
+
"self": "/authors/14"
135
+
}
136
+
}
137
+
]
138
+
}
139
+
```
140
+
67
141
## Colaborate
68
142
69
143
Check [Environment development file](DEV_ENVIRONMENT.md) 😉.
0 commit comments