-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathoutcome.rb
More file actions
111 lines (85 loc) · 3.6 KB
/
outcome.rb
File metadata and controls
111 lines (85 loc) · 3.6 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
Alors('{string} est le document principal') do |title|
expect(find('.main .work')).to have_content title
expect(page).to have_title title
end
Alors('{string} est une des sources') do |title|
expect(find('.sources')).to have_content title
end
Alors('{string} est une des gloses') do |title|
expect(find('.gloses')).to have_content title
end
Alors('{string} est la glose ouverte') do |title|
expect(find('.runningHead .scholium')).to have_content title
end
Alors('je peux lire {string}') do |text|
expect(page).to have_content text
end
Alors('je peux lire:') do |text|
expect(page).to have_content text
end
Alors('je ne peux pas lire {string}') do |text|
expect(page).not_to have_content text
end
Alors("je vois l'image {string} dans le document principal") do |alternative_text|
expect(find('.row:not(.runningHead)>.main')).to have_image(alternative_text)
end
Alors("je vois l'image {string} dans la glose") do |alternative_text|
expect(find('.row:not(.runningHead)>.scholium')).to have_image(alternative_text)
end
Alors("je ne vois pas l'image {string}") do |alternative_text|
expect(page).not_to have_image(alternative_text)
end
Alors("je vois que l'image de la licence du document principal est {string}") do |image|
expect(page).to have_image image
end
Alors("l'image intégrée dans la page {string} est légendée par son titre : {string}") do |image, image_caption|
expect(find('.lectern')).to have_content image_caption
end
Alors("l'image intégrée en source {string} est légendée par son titre : {string}") do |image, image_caption|
expect(find('.sources')).to have_content image_caption
end
Alors('le type {string} est le type de la glose ouverte') do |type|
expect(find('.typeBadge')).to have_content type
end
Alors('le document comporte la vidéo {string}') do |uri|
expect(page).to have_xpath("//iframe[contains(@src, '#{uri}')]")
end
Alors('la vidéo du document principal se lance de {string} secondes à {string} secondes') do |start, ending|
expect(page).to have_xpath("//iframe[contains(@src, 'start=#{start}&end=#{ending}')]")
end
Alors('le texte du premier passage de la glose est :') do |text|
expect(find('.editable.content', match: :first).text).to match /\A#{text}\z/
end
Alors('le créateur est {string}') do |string|
expect(find('.metadata > .work', match: :first)).to have_content string
end
Alors('l\'année de publication est {string}') do |string|
expect(find('.metadata > .edition', match: :first)).to have_content string
end
Alors('la glose est ouverte en mode édition') do
expect(page).to have_css(".scholium > form")
end
Alors('la glose est ouverte en mode édition et contient :') do |text|
expect(find('.scholium textarea')).to have_content text
end
Alors("le texte du document principal est en surbrillance :") do |highlighted_text|
highlighted_element = find('mark', text: highlighted_text.strip)
expect(highlighted_element).not_to be_nil
end
Alors('le document principal a le titre par défaut') do
expect(find('.main .work')).to have_content "<TITLE>"
end
Alors('je peux lire {string} dans la liste des types') do |text|
expect(find('.list-group')).to have_content text
end
Alors('je ne peux pas lire {string} ans la liste des types') do |text|
expect(find('.list-group')).not_to have_content text
end
Alors('je ne peux rien lire dans la liste des types') do
expect(find('.list-group')).not_to have_content "Ethnography/Report"
expect(find('.list-group')).not_to have_content "Ethnography/Analysis"
expect(find('.list-group')).not_to have_content "Ethnography/Interview"
end
Alors("je ne vois pas l'image {string}") do |image_name|
expect(page)
end