Skip to content

Commit

Permalink
TEST : Delete a picture from a document (see #187)
Browse files Browse the repository at this point in the history
Co-Authored-By: Martin GANDOM<[email protected]>
  • Loading branch information
petitfa1 committed Jun 19, 2024
1 parent 396f31f commit b50dc55
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 5 deletions.
4 changes: 4 additions & 0 deletions features/step_definitions/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,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
11 changes: 8 additions & 3 deletions features/step_definitions/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@
attach_file("image-input", File.expand_path("./docs/#{image_name}"), make_visible: true)
end

Quand("j'essaye de supprimer une image d'une glose") do
pending # Write code here that turns the phrase above into concrete actions
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
4 changes: 2 additions & 2 deletions features/step_definitions/outcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@
expect(page).not_to have_content(title)
end

Alors("l'image disparait dans la glose") do
pending
Alors("je ne vois pas l'image {string}") do |image_name|
expect(page)
end

1 comment on commit b50dc55

@nitram35
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit is not associated to a branch because we add some serious troubles on git history. Here is the initial commit of @petitfa1 f6de2ce that we copied (that's why i'm the comitter)

Please sign in to comment.