Skip to content

Commit f6de2ce

Browse files
committed
TEST : Delete a picture from a document (see #187)
Co-Authored-By: Fabien Petit<petifa1@users.noreply.github.com>
1 parent 7c3c21e commit f6de2ce

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

features/step_definitions/context.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,3 +134,7 @@
134134
Soit("un document que l'on consulte") do
135135
visit '/146e6e8442f0405b721b79357d00d0a1'
136136
end
137+
138+
Soit ("une image {string} dans une glose") do |image_name|
139+
attach_file("image-input", File.expand_path("./docs/#{image_name}"), make_visible: true)
140+
end

features/step_definitions/event.rb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,3 +90,12 @@
9090
click_on_icon('typeIcon')
9191
fill_element('#searchType', type)
9292
end
93+
94+
Quand("j'essaye de supprimer l'image {string} d'une glose") do |image_name|
95+
image = find('img[alt="' + image_name + '"]')
96+
delete_button = image.find(:xpath, 'following-sibling::button[contains(@class, "delete-image")]')
97+
delete_button.click
98+
popup = find('#confirmation-popup', visible: true)
99+
yes_button = popup.find('button.confirm-yes')
100+
yes_button.click
101+
end

features/step_definitions/outcome.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,6 @@
106106
expect(find('.list-group')).not_to have_content "Ethnography/Interview"
107107
end
108108

109+
Alors("je ne vois pas l'image {string}") do |image_name|
110+
expect(page)
111+
end

0 commit comments

Comments
 (0)