forked from cypress-io/cypress
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstudio_spec.ts
More file actions
76 lines (67 loc) · 2.29 KB
/
studio_spec.ts
File metadata and controls
76 lines (67 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import path from 'path'
import systemTests from '../lib/system-tests'
import { projectPath } from '../lib/fixtures'
import { promises as fs } from 'fs'
const snapshotFile = (project, file, folder = 'integration') => {
const filePath = path.join(projectPath(project), 'cypress', folder, file)
return fs.readFile(filePath).then((content) => {
systemTests.snapshot(`${project} ${file}`, content.toString())
})
}
// NOTE: all output snapshots will display the root spec suite twice
// this is intentional and indicates how the studio "restarts" the runner
// TODO: fix these after system tests PR
// @see https://github.com/cypress-io/cypress/issues/18498
describe.skip('e2e studio', function () {
systemTests.setup()
systemTests.it('extends test', {
project: projectPath('studio'),
spec: 'extend.spec.js',
snapshot: true,
browser: 'electron',
onRun (exec) {
return exec().then(() => snapshotFile('studio', 'extend.spec.js'))
},
})
// includes "New Test" in snapshot
// this is the blank new test that's being created
systemTests.it('creates new test', {
project: projectPath('studio'),
spec: 'new.spec.js',
browser: 'electron',
snapshot: true,
onRun (exec) {
return exec().then(() => snapshotFile('studio', 'new.spec.js'))
},
})
systemTests.it('can write to imported files', {
project: projectPath('studio'),
spec: 'external.spec.js',
snapshot: true,
browser: 'electron',
onRun (exec) {
return exec()
// we snapshot the original spec to make sure it does NOT get written there
.then(() => snapshotFile('studio', 'external.spec.js'))
.then(() => snapshotFile('studio', 'external.js', 'support'))
},
})
systemTests.it('extends test without source maps', {
project: projectPath('studio-no-source-maps'),
spec: 'extend.spec.js',
snapshot: true,
browser: 'electron',
onRun (exec) {
return exec().then(() => snapshotFile('studio-no-source-maps', 'extend.spec.js'))
},
})
systemTests.it('creates new test without source maps', {
project: projectPath('studio-no-source-maps'),
spec: 'new.spec.js',
browser: 'electron',
snapshot: true,
onRun (exec) {
return exec().then(() => snapshotFile('studio-no-source-maps', 'new.spec.js'))
},
})
})