cypress-cli-select 2.0.4 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/test.yml +14 -0
- package/CONTRIBUTING.md +1 -3
- package/package.json +3 -8
- package/.github/workflows/jest.yml +0 -12
- package/cypress/e2e/2-advanced-examples/actions.cy.js +0 -321
- package/cypress/e2e/2-advanced-examples/assertions.cy.js +0 -176
- package/cypress/e2e/2-advanced-examples/connectors.cy.js +0 -98
- package/cypress/e2e/2-advanced-examples/cookies.cy.js +0 -118
- package/cypress/e2e/2-advanced-examples/cypress_api.cy.js +0 -211
- package/cypress/e2e/2-advanced-examples/location.cy.js +0 -32
- package/cypress/e2e/2-advanced-examples/misc.cy.js +0 -92
- package/cypress/e2e/2-advanced-examples/navigation.cy.js +0 -55
- package/cypress/e2e/2-advanced-examples/network_requests.cy.js +0 -163
- package/cypress/e2e/2-advanced-examples/querying.cy.js +0 -114
- package/cypress/e2e/2-advanced-examples/spies_stubs_clocks.cy.js +0 -220
- package/cypress/e2e/2-advanced-examples/storage.cy.js +0 -117
- package/cypress/e2e/2-advanced-examples/traversal.cy.js +0 -126
- package/cypress/e2e/2-advanced-examples/utilities.cy.js +0 -109
- package/cypress/e2e/2-advanced-examples/viewport.cy.js +0 -58
- package/cypress/e2e/2-advanced-examples/waiting.cy.js +0 -30
- package/tests/cli-component.spec.js +0 -485
- package/tests/cli-e2e.spec.js +0 -508
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
context('Viewport', () => {
|
|
3
|
-
beforeEach(() => {
|
|
4
|
-
cy.visit('https://example.cypress.io/commands/viewport')
|
|
5
|
-
})
|
|
6
|
-
|
|
7
|
-
it('cy.viewport() - set the viewport size and dimension', () => {
|
|
8
|
-
// https://on.cypress.io/viewport
|
|
9
|
-
|
|
10
|
-
cy.get('#navbar').should('be.visible')
|
|
11
|
-
cy.viewport(320, 480)
|
|
12
|
-
|
|
13
|
-
// the navbar should have collapse since our screen is smaller
|
|
14
|
-
cy.get('#navbar').should('not.be.visible')
|
|
15
|
-
cy.get('.navbar-toggle').should('be.visible').click()
|
|
16
|
-
cy.get('.nav').find('a').should('be.visible')
|
|
17
|
-
|
|
18
|
-
// lets see what our app looks like on a super large screen
|
|
19
|
-
cy.viewport(2999, 2999)
|
|
20
|
-
|
|
21
|
-
// cy.viewport() accepts a set of preset sizes
|
|
22
|
-
// to easily set the screen to a device's width and height
|
|
23
|
-
|
|
24
|
-
// We added a cy.wait() between each viewport change so you can see
|
|
25
|
-
// the change otherwise it is a little too fast to see :)
|
|
26
|
-
|
|
27
|
-
cy.viewport('macbook-15')
|
|
28
|
-
cy.wait(200)
|
|
29
|
-
cy.viewport('macbook-13')
|
|
30
|
-
cy.wait(200)
|
|
31
|
-
cy.viewport('macbook-11')
|
|
32
|
-
cy.wait(200)
|
|
33
|
-
cy.viewport('ipad-2')
|
|
34
|
-
cy.wait(200)
|
|
35
|
-
cy.viewport('ipad-mini')
|
|
36
|
-
cy.wait(200)
|
|
37
|
-
cy.viewport('iphone-6+')
|
|
38
|
-
cy.wait(200)
|
|
39
|
-
cy.viewport('iphone-6')
|
|
40
|
-
cy.wait(200)
|
|
41
|
-
cy.viewport('iphone-5')
|
|
42
|
-
cy.wait(200)
|
|
43
|
-
cy.viewport('iphone-4')
|
|
44
|
-
cy.wait(200)
|
|
45
|
-
cy.viewport('iphone-3')
|
|
46
|
-
cy.wait(200)
|
|
47
|
-
|
|
48
|
-
// cy.viewport() accepts an orientation for all presets
|
|
49
|
-
// the default orientation is 'portrait'
|
|
50
|
-
cy.viewport('ipad-2', 'portrait')
|
|
51
|
-
cy.wait(200)
|
|
52
|
-
cy.viewport('iphone-4', 'landscape')
|
|
53
|
-
cy.wait(200)
|
|
54
|
-
|
|
55
|
-
// The viewport will be reset back to the default dimensions
|
|
56
|
-
// in between tests (the default can be set in cypress.config.{js|ts})
|
|
57
|
-
})
|
|
58
|
-
})
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
context('Waiting', () => {
|
|
3
|
-
beforeEach(() => {
|
|
4
|
-
cy.visit('https://example.cypress.io/commands/waiting')
|
|
5
|
-
})
|
|
6
|
-
// BE CAREFUL of adding unnecessary wait times.
|
|
7
|
-
// https://on.cypress.io/best-practices#Unnecessary-Waiting
|
|
8
|
-
|
|
9
|
-
// https://on.cypress.io/wait
|
|
10
|
-
it('cy.wait() - wait for a specific amount of time', () => {
|
|
11
|
-
cy.get('.wait-input1').type('Wait 1000ms after typing')
|
|
12
|
-
cy.wait(1000)
|
|
13
|
-
cy.get('.wait-input2').type('Wait 1000ms after typing')
|
|
14
|
-
cy.wait(1000)
|
|
15
|
-
cy.get('.wait-input3').type('Wait 1000ms after typing')
|
|
16
|
-
cy.wait(1000)
|
|
17
|
-
})
|
|
18
|
-
|
|
19
|
-
it('cy.wait() - wait for a specific route', () => {
|
|
20
|
-
// Listen to GET to comments/1
|
|
21
|
-
cy.intercept('GET', '**/comments/*').as('getComment')
|
|
22
|
-
|
|
23
|
-
// we have code that gets a comment when
|
|
24
|
-
// the button is clicked in scripts.js
|
|
25
|
-
cy.get('.network-btn').click()
|
|
26
|
-
|
|
27
|
-
// wait for GET comments/1
|
|
28
|
-
cy.wait('@getComment').its('response.statusCode').should('be.oneOf', [200, 304])
|
|
29
|
-
})
|
|
30
|
-
})
|
|
@@ -1,485 +0,0 @@
|
|
|
1
|
-
const { render } = require("cli-testing-library");
|
|
2
|
-
require("cli-testing-library/extend-expect");
|
|
3
|
-
const { describe, it, expect } = require("@jest/globals");
|
|
4
|
-
const { resolve } = require("path");
|
|
5
|
-
|
|
6
|
-
describe("component: basic input prompt flows", () => {
|
|
7
|
-
it("handles spec select", async () => {
|
|
8
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
9
|
-
resolve(__dirname, "../index.js"),
|
|
10
|
-
["--submit-focused"],
|
|
11
|
-
["--component"],
|
|
12
|
-
]);
|
|
13
|
-
|
|
14
|
-
expect(
|
|
15
|
-
await findByText(
|
|
16
|
-
"Choose to filter by specs, specific test titles or tags",
|
|
17
|
-
),
|
|
18
|
-
).toBeInTheConsole();
|
|
19
|
-
|
|
20
|
-
expect(await findByText("Specs")).toBeInTheConsole();
|
|
21
|
-
expect(
|
|
22
|
-
await findByText("Test titles or tags (requires cy-grep)"),
|
|
23
|
-
).toBeInTheConsole();
|
|
24
|
-
|
|
25
|
-
userEvent.keyboard("[Enter]");
|
|
26
|
-
|
|
27
|
-
expect(await findByText("Select specs to run")).toBeInTheConsole();
|
|
28
|
-
expect(await findByText("src/components/Clock.cy.js")).toBeInTheConsole();
|
|
29
|
-
expect(await findByText("src/components/Stepper.cy.js")).toBeInTheConsole();
|
|
30
|
-
|
|
31
|
-
userEvent.keyboard("[Enter]");
|
|
32
|
-
expect(
|
|
33
|
-
await findByText("Select specs to run: src/components/Clock.cy.js"),
|
|
34
|
-
).toBeInTheConsole();
|
|
35
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("handles test title select", async () => {
|
|
39
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
40
|
-
resolve(__dirname, "../index.js"),
|
|
41
|
-
["--submit-focused"],
|
|
42
|
-
["--component"],
|
|
43
|
-
]);
|
|
44
|
-
|
|
45
|
-
expect(
|
|
46
|
-
await findByText(
|
|
47
|
-
"Choose to filter by specs, specific test titles or tags",
|
|
48
|
-
),
|
|
49
|
-
).toBeInTheConsole();
|
|
50
|
-
|
|
51
|
-
expect(await findByText("Specs")).toBeInTheConsole();
|
|
52
|
-
expect(
|
|
53
|
-
await findByText("Test titles or tags (requires cy-grep)"),
|
|
54
|
-
).toBeInTheConsole();
|
|
55
|
-
|
|
56
|
-
userEvent.keyboard("[ArrowDown]");
|
|
57
|
-
userEvent.keyboard("[Enter]");
|
|
58
|
-
|
|
59
|
-
expect(
|
|
60
|
-
await findByText("Choose to filter by specific test titles or tags"),
|
|
61
|
-
).toBeInTheConsole();
|
|
62
|
-
expect(await findByText("Test titles")).toBeInTheConsole();
|
|
63
|
-
expect(await findByText("Test tags")).toBeInTheConsole();
|
|
64
|
-
|
|
65
|
-
userEvent.keyboard("[Enter]");
|
|
66
|
-
|
|
67
|
-
expect(await findByText("Select tests to run")).toBeInTheConsole();
|
|
68
|
-
expect(
|
|
69
|
-
await findByText("Clock.cy.js > <Clock> > mounts"),
|
|
70
|
-
).toBeInTheConsole();
|
|
71
|
-
expect(
|
|
72
|
-
await findByText("Stepper.cy.js > <Stepper> > mounts"),
|
|
73
|
-
).toBeInTheConsole();
|
|
74
|
-
|
|
75
|
-
userEvent.keyboard("[Enter]");
|
|
76
|
-
expect(
|
|
77
|
-
await findByText("Select tests to run: Clock.cy.js > <Clock> > mounts"),
|
|
78
|
-
);
|
|
79
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
it("handles tag select", async () => {
|
|
83
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
84
|
-
resolve(__dirname, "../index.js"),
|
|
85
|
-
["--submit-focused"],
|
|
86
|
-
["--component"],
|
|
87
|
-
]);
|
|
88
|
-
|
|
89
|
-
expect(
|
|
90
|
-
await findByText(
|
|
91
|
-
"Choose to filter by specs, specific test titles or tags",
|
|
92
|
-
),
|
|
93
|
-
).toBeInTheConsole();
|
|
94
|
-
|
|
95
|
-
expect(await findByText("Specs")).toBeInTheConsole();
|
|
96
|
-
expect(
|
|
97
|
-
await findByText("Test titles or tags (requires cy-grep)"),
|
|
98
|
-
).toBeInTheConsole();
|
|
99
|
-
|
|
100
|
-
userEvent.keyboard("[ArrowDown]");
|
|
101
|
-
userEvent.keyboard("[Enter]");
|
|
102
|
-
|
|
103
|
-
expect(
|
|
104
|
-
await findByText("Choose to filter by specific test titles or tags"),
|
|
105
|
-
).toBeInTheConsole();
|
|
106
|
-
expect(await findByText("Test titles")).toBeInTheConsole();
|
|
107
|
-
expect(await findByText("Test tags")).toBeInTheConsole();
|
|
108
|
-
|
|
109
|
-
userEvent.keyboard("[ArrowDown]");
|
|
110
|
-
userEvent.keyboard("[Enter]");
|
|
111
|
-
|
|
112
|
-
expect(await findByText("Select tags to run")).toBeInTheConsole();
|
|
113
|
-
expect(await findByText("@p3")).toBeInTheConsole();
|
|
114
|
-
|
|
115
|
-
userEvent.keyboard("[ArrowDown]");
|
|
116
|
-
userEvent.keyboard("[Enter]");
|
|
117
|
-
|
|
118
|
-
expect(await findByText("Select tags to run: @p3"));
|
|
119
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
describe("component: prompt flags skip beginning prompts", () => {
|
|
124
|
-
it("handles --specs flag", async () => {
|
|
125
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
126
|
-
resolve(__dirname, "../index.js"),
|
|
127
|
-
["--submit-focused"],
|
|
128
|
-
["--component"],
|
|
129
|
-
["--specs"],
|
|
130
|
-
]);
|
|
131
|
-
|
|
132
|
-
expect(await findByText("Select specs to run")).toBeInTheConsole();
|
|
133
|
-
expect(await findByText("src/components/Clock.cy.js")).toBeInTheConsole();
|
|
134
|
-
expect(await findByText("src/components/Stepper.cy.js")).toBeInTheConsole();
|
|
135
|
-
|
|
136
|
-
userEvent.keyboard("[Enter]");
|
|
137
|
-
expect(
|
|
138
|
-
await findByText("Select specs to run: src/components/Clock.cy.js"),
|
|
139
|
-
).toBeInTheConsole();
|
|
140
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
141
|
-
});
|
|
142
|
-
|
|
143
|
-
it("handles --titles flag", async () => {
|
|
144
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
145
|
-
resolve(__dirname, "../index.js"),
|
|
146
|
-
["--submit-focused"],
|
|
147
|
-
["--component"],
|
|
148
|
-
["--titles"],
|
|
149
|
-
]);
|
|
150
|
-
|
|
151
|
-
expect(await findByText("Select tests to run")).toBeInTheConsole();
|
|
152
|
-
expect(
|
|
153
|
-
await findByText("Clock.cy.js > <Clock> > mounts"),
|
|
154
|
-
).toBeInTheConsole();
|
|
155
|
-
expect(
|
|
156
|
-
await findByText("Stepper.cy.js > <Stepper> > mounts"),
|
|
157
|
-
).toBeInTheConsole();
|
|
158
|
-
|
|
159
|
-
userEvent.keyboard("[Enter]");
|
|
160
|
-
expect(
|
|
161
|
-
await findByText("Select tests to run: Clock.cy.js > <Clock> > mounts"),
|
|
162
|
-
);
|
|
163
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
it("handles --tags flag", async () => {
|
|
167
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
168
|
-
resolve(__dirname, "../index.js"),
|
|
169
|
-
["--submit-focused"],
|
|
170
|
-
["--component"],
|
|
171
|
-
["--tags"],
|
|
172
|
-
]);
|
|
173
|
-
|
|
174
|
-
expect(await findByText("Select tags to run")).toBeInTheConsole();
|
|
175
|
-
expect(await findByText("@p3")).toBeInTheConsole();
|
|
176
|
-
|
|
177
|
-
userEvent.keyboard("[ArrowDown]");
|
|
178
|
-
userEvent.keyboard("[Enter]");
|
|
179
|
-
|
|
180
|
-
expect(await findByText("Select tags to run: @p3"));
|
|
181
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
it("cannot pass both --titles and --tags", async () => {
|
|
185
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
186
|
-
resolve(__dirname, "../index.js"),
|
|
187
|
-
["--submit-focused"],
|
|
188
|
-
["--component"],
|
|
189
|
-
["--titles"],
|
|
190
|
-
["--tags"],
|
|
191
|
-
]);
|
|
192
|
-
|
|
193
|
-
expect(
|
|
194
|
-
await findByText("Cannot choose both titles and tags"),
|
|
195
|
-
).toBeInTheConsole();
|
|
196
|
-
});
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
describe("component: print selected displays prior to run", () => {
|
|
200
|
-
it("handles spec display", async () => {
|
|
201
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
202
|
-
resolve(__dirname, "../index.js"),
|
|
203
|
-
["--submit-focused"],
|
|
204
|
-
["--component"],
|
|
205
|
-
["--print-selected"],
|
|
206
|
-
]);
|
|
207
|
-
|
|
208
|
-
expect(
|
|
209
|
-
await findByText(
|
|
210
|
-
"Choose to filter by specs, specific test titles or tags",
|
|
211
|
-
),
|
|
212
|
-
).toBeInTheConsole();
|
|
213
|
-
|
|
214
|
-
expect(await findByText("Specs")).toBeInTheConsole();
|
|
215
|
-
expect(
|
|
216
|
-
await findByText("Test titles or tags (requires cy-grep)"),
|
|
217
|
-
).toBeInTheConsole();
|
|
218
|
-
|
|
219
|
-
userEvent.keyboard("[Enter]");
|
|
220
|
-
|
|
221
|
-
expect(await findByText("Select specs to run")).toBeInTheConsole();
|
|
222
|
-
expect(await findByText("src/components/Clock.cy.js")).toBeInTheConsole();
|
|
223
|
-
expect(await findByText("src/components/Stepper.cy.js")).toBeInTheConsole();
|
|
224
|
-
|
|
225
|
-
userEvent.keyboard("[Enter]");
|
|
226
|
-
expect(await findByText("Spec(s) selected:")).toBeInTheConsole();
|
|
227
|
-
expect(
|
|
228
|
-
await findByText("[ 'src/components/Clock.cy.js' ]"),
|
|
229
|
-
).toBeInTheConsole();
|
|
230
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
it("handles test title display", async () => {
|
|
234
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
235
|
-
resolve(__dirname, "../index.js"),
|
|
236
|
-
["--submit-focused"],
|
|
237
|
-
["--component"],
|
|
238
|
-
["--print-selected"],
|
|
239
|
-
]);
|
|
240
|
-
|
|
241
|
-
expect(
|
|
242
|
-
await findByText(
|
|
243
|
-
"Choose to filter by specs, specific test titles or tags",
|
|
244
|
-
),
|
|
245
|
-
).toBeInTheConsole();
|
|
246
|
-
|
|
247
|
-
expect(await findByText("Specs")).toBeInTheConsole();
|
|
248
|
-
expect(
|
|
249
|
-
await findByText("Test titles or tags (requires cy-grep)"),
|
|
250
|
-
).toBeInTheConsole();
|
|
251
|
-
|
|
252
|
-
userEvent.keyboard("[ArrowDown]");
|
|
253
|
-
userEvent.keyboard("[Enter]");
|
|
254
|
-
|
|
255
|
-
expect(
|
|
256
|
-
await findByText("Choose to filter by specific test titles or tags"),
|
|
257
|
-
).toBeInTheConsole();
|
|
258
|
-
expect(await findByText("Test titles")).toBeInTheConsole();
|
|
259
|
-
expect(await findByText("Test tags")).toBeInTheConsole();
|
|
260
|
-
|
|
261
|
-
userEvent.keyboard("[Enter]");
|
|
262
|
-
|
|
263
|
-
expect(await findByText("Select tests to run")).toBeInTheConsole();
|
|
264
|
-
expect(
|
|
265
|
-
await findByText("Clock.cy.js > <Clock> > mounts"),
|
|
266
|
-
).toBeInTheConsole();
|
|
267
|
-
expect(
|
|
268
|
-
await findByText("Stepper.cy.js > <Stepper> > mounts"),
|
|
269
|
-
).toBeInTheConsole();
|
|
270
|
-
|
|
271
|
-
userEvent.keyboard("[Enter]");
|
|
272
|
-
expect(await findByText("Test(s) selected:")).toBeInTheConsole();
|
|
273
|
-
expect(await findByText("spec: 'Clock.cy.js',")).toBeInTheConsole();
|
|
274
|
-
expect(await findByText("parent: [ '<Clock>' ],")).toBeInTheConsole();
|
|
275
|
-
expect(await findByText("mounts")).toBeInTheConsole();
|
|
276
|
-
|
|
277
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
278
|
-
});
|
|
279
|
-
|
|
280
|
-
it("handles tag display", async () => {
|
|
281
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
282
|
-
resolve(__dirname, "../index.js"),
|
|
283
|
-
["--submit-focused"],
|
|
284
|
-
["--component"],
|
|
285
|
-
["--print-selected"],
|
|
286
|
-
]);
|
|
287
|
-
|
|
288
|
-
expect(
|
|
289
|
-
await findByText(
|
|
290
|
-
"Choose to filter by specs, specific test titles or tags",
|
|
291
|
-
),
|
|
292
|
-
).toBeInTheConsole();
|
|
293
|
-
|
|
294
|
-
expect(await findByText("Specs")).toBeInTheConsole();
|
|
295
|
-
expect(
|
|
296
|
-
await findByText("Test titles or tags (requires cy-grep)"),
|
|
297
|
-
).toBeInTheConsole();
|
|
298
|
-
|
|
299
|
-
userEvent.keyboard("[ArrowDown]");
|
|
300
|
-
userEvent.keyboard("[Enter]");
|
|
301
|
-
|
|
302
|
-
expect(
|
|
303
|
-
await findByText("Choose to filter by specific test titles or tags"),
|
|
304
|
-
).toBeInTheConsole();
|
|
305
|
-
expect(await findByText("Test titles")).toBeInTheConsole();
|
|
306
|
-
expect(await findByText("Test tags")).toBeInTheConsole();
|
|
307
|
-
|
|
308
|
-
userEvent.keyboard("[ArrowDown]");
|
|
309
|
-
userEvent.keyboard("[Enter]");
|
|
310
|
-
|
|
311
|
-
expect(await findByText("Select tags to run")).toBeInTheConsole();
|
|
312
|
-
expect(await findByText("@p3")).toBeInTheConsole();
|
|
313
|
-
|
|
314
|
-
userEvent.keyboard("[ArrowDown]");
|
|
315
|
-
userEvent.keyboard("[Enter]");
|
|
316
|
-
|
|
317
|
-
expect(await findByText("Tag(s) selected:")).toBeInTheConsole();
|
|
318
|
-
expect(await findByText("@p3")).toBeInTheConsole();
|
|
319
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
320
|
-
});
|
|
321
|
-
});
|
|
322
|
-
|
|
323
|
-
describe("component: handles choose spec pattern prompt", () => {
|
|
324
|
-
it("handles spec pattern", async () => {
|
|
325
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
326
|
-
resolve(__dirname, "../index.js"),
|
|
327
|
-
["--submit-focused"],
|
|
328
|
-
["--component"],
|
|
329
|
-
["--choose-spec-pattern"],
|
|
330
|
-
]);
|
|
331
|
-
|
|
332
|
-
expect(
|
|
333
|
-
await findByText(
|
|
334
|
-
"Choose to filter by specs, specific test titles or tags",
|
|
335
|
-
),
|
|
336
|
-
).toBeInTheConsole();
|
|
337
|
-
|
|
338
|
-
expect(await findByText("Specs")).toBeInTheConsole();
|
|
339
|
-
expect(
|
|
340
|
-
await findByText("Test titles or tags (requires cy-grep) (disabled)"),
|
|
341
|
-
).toBeInTheConsole();
|
|
342
|
-
|
|
343
|
-
userEvent.keyboard("[Enter]");
|
|
344
|
-
|
|
345
|
-
expect(await findByText("Select specs to run")).toBeInTheConsole();
|
|
346
|
-
expect(await findByText("src/components/Clock.cy.js")).toBeInTheConsole();
|
|
347
|
-
expect(await findByText("src/components/Stepper.cy.js")).toBeInTheConsole();
|
|
348
|
-
|
|
349
|
-
userEvent.keyboard("[Enter]");
|
|
350
|
-
|
|
351
|
-
expect(
|
|
352
|
-
await findByText("Reorder the specs in desired run order:"),
|
|
353
|
-
).toBeInTheConsole();
|
|
354
|
-
expect(await findByText("> src/components/Clock.cy.js")).toBeInTheConsole();
|
|
355
|
-
|
|
356
|
-
userEvent.keyboard("[Enter]");
|
|
357
|
-
expect(
|
|
358
|
-
await findByText(
|
|
359
|
-
"Reorder the specs in desired run order: src/components/Clock.cy.js",
|
|
360
|
-
),
|
|
361
|
-
).toBeInTheConsole();
|
|
362
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
363
|
-
});
|
|
364
|
-
});
|
|
365
|
-
|
|
366
|
-
describe("component: handles prompt searching", () => {
|
|
367
|
-
it("handles searching", async () => {
|
|
368
|
-
const { findByText, userEvent } = await render("cd ../../../ && node", [
|
|
369
|
-
resolve(__dirname, "../index.js"),
|
|
370
|
-
["--submit-focused"],
|
|
371
|
-
["--component"],
|
|
372
|
-
]);
|
|
373
|
-
|
|
374
|
-
expect(
|
|
375
|
-
await findByText(
|
|
376
|
-
"Choose to filter by specs, specific test titles or tags",
|
|
377
|
-
),
|
|
378
|
-
).toBeInTheConsole();
|
|
379
|
-
|
|
380
|
-
expect(await findByText("Specs")).toBeInTheConsole();
|
|
381
|
-
expect(
|
|
382
|
-
await findByText("Test titles or tags (requires cy-grep)"),
|
|
383
|
-
).toBeInTheConsole();
|
|
384
|
-
|
|
385
|
-
userEvent.keyboard("[Enter]");
|
|
386
|
-
|
|
387
|
-
expect(await findByText("Select specs to run")).toBeInTheConsole();
|
|
388
|
-
expect(await findByText("src/components/Clock.cy.js")).toBeInTheConsole();
|
|
389
|
-
expect(await findByText("src/components/Stepper.cy.js")).toBeInTheConsole();
|
|
390
|
-
await userEvent.keyboard("Clock[Enter]", { delay: 300 });
|
|
391
|
-
|
|
392
|
-
expect(
|
|
393
|
-
await findByText("? Select specs to run: src/components/Clock.cy.js"),
|
|
394
|
-
).toBeInTheConsole();
|
|
395
|
-
|
|
396
|
-
expect(await findByText("Running Cypress")).toBeInTheConsole();
|
|
397
|
-
});
|
|
398
|
-
});
|
|
399
|
-
|
|
400
|
-
describe("component: accepts custom cypress config", () => {
|
|
401
|
-
it("specs: passing --config-file and --component reads component specPattern", async () => {
|
|
402
|
-
const { findByText, queryByText, userEvent } = await render(
|
|
403
|
-
"cd ../../../ && node",
|
|
404
|
-
[
|
|
405
|
-
resolve(__dirname, "../index.js"),
|
|
406
|
-
["--submit-focused"],
|
|
407
|
-
["--component"],
|
|
408
|
-
["--config-file"],
|
|
409
|
-
["cypress.new.config.js"],
|
|
410
|
-
],
|
|
411
|
-
);
|
|
412
|
-
|
|
413
|
-
expect(
|
|
414
|
-
await findByText(
|
|
415
|
-
"Choose to filter by specs, specific test titles or tags",
|
|
416
|
-
),
|
|
417
|
-
).toBeInTheConsole();
|
|
418
|
-
|
|
419
|
-
expect(await findByText("Specs")).toBeInTheConsole();
|
|
420
|
-
expect(
|
|
421
|
-
await findByText("Test titles or tags (requires cy-grep)"),
|
|
422
|
-
).toBeInTheConsole();
|
|
423
|
-
|
|
424
|
-
userEvent.keyboard("[Enter]");
|
|
425
|
-
|
|
426
|
-
expect(await findByText("Select specs to run")).toBeInTheConsole();
|
|
427
|
-
expect(await findByText("src/components/Clock.cy.js")).toBeInTheConsole();
|
|
428
|
-
expect(await findByText("src/components/Stepper.cy.js")).toBeInTheConsole();
|
|
429
|
-
|
|
430
|
-
expect(await queryByText("cypress/e2e")).not.toBeInTheConsole();
|
|
431
|
-
|
|
432
|
-
userEvent.keyboard("[Enter]");
|
|
433
|
-
|
|
434
|
-
expect(await findByText("Running Cypress:")).toBeInTheConsole();
|
|
435
|
-
});
|
|
436
|
-
|
|
437
|
-
it("titles: passing --config-file and --component reads component specPattern", async () => {
|
|
438
|
-
const { findByText, queryByText, userEvent } = await render(
|
|
439
|
-
"cd ../../../ && node",
|
|
440
|
-
[
|
|
441
|
-
resolve(__dirname, "../index.js"),
|
|
442
|
-
["--submit-focused"],
|
|
443
|
-
["--component"],
|
|
444
|
-
["--config-file"],
|
|
445
|
-
["cypress.new.config.js"],
|
|
446
|
-
],
|
|
447
|
-
);
|
|
448
|
-
|
|
449
|
-
expect(
|
|
450
|
-
await findByText(
|
|
451
|
-
"Choose to filter by specs, specific test titles or tags",
|
|
452
|
-
),
|
|
453
|
-
).toBeInTheConsole();
|
|
454
|
-
|
|
455
|
-
expect(await findByText("Specs")).toBeInTheConsole();
|
|
456
|
-
expect(
|
|
457
|
-
await findByText("Test titles or tags (requires cy-grep)"),
|
|
458
|
-
).toBeInTheConsole();
|
|
459
|
-
|
|
460
|
-
userEvent.keyboard("[ArrowDown]");
|
|
461
|
-
userEvent.keyboard("[Enter]");
|
|
462
|
-
|
|
463
|
-
expect(
|
|
464
|
-
await findByText("Choose to filter by specific test titles or tags"),
|
|
465
|
-
).toBeInTheConsole();
|
|
466
|
-
expect(await findByText("Test titles")).toBeInTheConsole();
|
|
467
|
-
expect(await findByText("Tags")).toBeInTheConsole();
|
|
468
|
-
|
|
469
|
-
userEvent.keyboard("[Enter]");
|
|
470
|
-
|
|
471
|
-
expect(await findByText("Select tests to run")).toBeInTheConsole();
|
|
472
|
-
expect(
|
|
473
|
-
await findByText("Clock.cy.js > <Clock> > mounts"),
|
|
474
|
-
).toBeInTheConsole();
|
|
475
|
-
expect(
|
|
476
|
-
await findByText("Stepper.cy.js > <Stepper> > mounts"),
|
|
477
|
-
).toBeInTheConsole();
|
|
478
|
-
|
|
479
|
-
expect(await queryByText("cypress/e2e")).not.toBeInTheConsole();
|
|
480
|
-
|
|
481
|
-
userEvent.keyboard("[Enter]");
|
|
482
|
-
|
|
483
|
-
expect(await findByText("Running Cypress:")).toBeInTheConsole();
|
|
484
|
-
});
|
|
485
|
-
});
|