-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy patharrow-spec.js
62 lines (56 loc) · 1.45 KB
/
arrow-spec.js
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
/// <reference types="cypress" />
describe('Arrows', () => {
beforeEach(() => {
cy.visit('/examples/react/').wait(1000) // let the site load
})
it('shows arrow pointing at the element (non-blocking)', function () {
cy.get('.new-todo')
.arrow({
duration: 3000,
strokeWidth: 3,
})
.type('See this arrow?')
})
it('shows arrow pointing at the element (blocking)', function () {
cy.get('.new-todo')
.arrow({
duration: 3000,
blocking: true,
})
.type('Did you see an arrow?!')
})
it('from different directions 🎥', function () {
cy.get('.new-todo')
.type('Write test{enter}')
.type('Render test as demo movie{enter}')
// .screenshot('before-arrows', { capture: 'viewport' })
cy.contains('.filters li', 'All').arrow({
duration: 1000,
offsetX: -10,
offsetY: 20,
blocking: true,
color: 'blue',
text: 'Show all todos',
})
cy.contains('.filters li', 'Active').arrow({
duration: 1000,
offsetX: -10,
offsetY: 20,
blocking: true,
color: 'green',
label: 'Unfinished todos only',
})
cy.contains('.filters li', 'Completed')
.arrow({
duration: 3000,
pointAt: 'bottomRight',
blocking: true,
offsetX: 50,
offsetY: 20,
color: '#ff00ff',
text: 'Completed todos only',
textSize: '5vh',
})
.wait(1000)
})
})