Skip to content

Commit

Permalink
TEST: The user interface should be localized in French (see #146)
Browse files Browse the repository at this point in the history
Co-authored-by: vernet-william <[email protected]>
  • Loading branch information
ToGoSleep and vernet-william committed Jun 4, 2024
1 parent 1edd129 commit def5665
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
16 changes: 16 additions & 0 deletions features/step_definitions/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,19 @@
Soit("un document que l'on consulte") do
visit '/146e6e8442f0405b721b79357d00d0a1'
end

Soit("{string} la langue préférée configurée dans le navigateur") do |language|
page.driver.add_headers("Accept-Language" => language)
end

Soit('un texte flottant avec la balise title {string} est présent') do |text|
expect(page).to have_selector("title", text: /#{text}/i, visible: false)
end

Soit('un texte flottant avec l’attribut title {string} est présent') do |text|
expect(page).to have_selector("[title='#{text}']")
end

Soit('un placeholder contenant {string} est présent') do |text|
expect(page).to have_selector("input[placeholder='#{text}']")
end
4 changes: 4 additions & 0 deletions features/step_definitions/event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@
click_on_icon('sources .create-document')
end

Quand("je choisis {string} comme langue préférée configurée dans le navigateur et que je rafraichisse la page") do |language|
page.driver.add_headers("Accept-Language" => language)
visit current_path
end
6 changes: 6 additions & 0 deletions features/step_definitions/outcome.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,10 @@

Alors("je ne vois pas le document intitulé {string}") do |title|
expect(page).not_to have_content(title)
end

Soit('la page contient') do |table|
table.raw.flatten.each do |localization|
expect(page).to have_content localization
end
end

0 comments on commit def5665

Please sign in to comment.