Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

187 - Delete a picture from a document #210

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions features/delete_image_in_document.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#language: fr

Fonctionnalité: Supprimer une image d'une glose

Scénario: dont on est l'auteur

Soit un document dont je suis l'auteur affiché comme glose
Et une session active avec mon compte
Et une image "architecture.png" dans une glose
Quand j'essaye de supprimer l'image "architecture.png" d'une glose
Alors je ne vois pas l'image "architecture.png"

4 changes: 4 additions & 0 deletions features/step_definitions/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,3 +134,7 @@
Soit("un document que l'on consulte") do
visit '/146e6e8442f0405b721b79357d00d0a1'
end

Soit ("une image {string} dans une glose") do |image_name|
attach_file("image-input", File.expand_path("./docs/#{image_name}"), make_visible: true)
end
9 changes: 9 additions & 0 deletions features/step_definitions/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,12 @@
click_on_icon('typeIcon')
fill_element('#searchType', type)
end

Quand("j'essaye de supprimer l'image {string} d'une glose") do |image_name|
image = find('img[alt="' + image_name + '"]')
delete_button = image.find(:xpath, 'following-sibling::button[contains(@class, "delete-image")]')
delete_button.click
popup = find('#confirmation-popup', visible: true)
yes_button = popup.find('button.confirm-yes')
yes_button.click
end
3 changes: 3 additions & 0 deletions features/step_definitions/outcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,6 @@
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
Loading