From 3ed44f781bde747919e5aa017e5e863a1f03bcae Mon Sep 17 00:00:00 2001 From: Quentin Hainos Date: Thu, 24 Jun 2021 09:20:17 +0200 Subject: [PATCH] TEST: Browse items while moving in a physical space Co-authored-by: Benoit Savornin --- features/step_definitions/event.rb | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/features/step_definitions/event.rb b/features/step_definitions/event.rb index 49ede144..0d6ff6bb 100644 --- a/features/step_definitions/event.rb +++ b/features/step_definitions/event.rb @@ -57,3 +57,32 @@ end end +Alors("l'item {string} est au dessus du plan") do |item| + within('.Spatial') do + find(:xpath, "//div[@class='item' and contains(., '#{item}')]/../following-sibling::div/div[@id='plan']") + end +end + +Alors("l'item {string} est au dessus de l'item {string}") do |itemHaut, itemBas| + within('.Spatial') do + find(:xpath, "//div[@class='item' and contains(., '#{itemHaut}')]/../following-sibling::div/div[contains(.,'#{itemBas}')]") + end +end + +Alors("l'item {string} est à droite du plan") do |item| + within('.Spatial') do + find(:xpath, "//div[@id='plan']/following-sibling::div[@class='item' and contains(., '#{item}')]") + end +end + +Alors("l'item {string} est à droite de l'item {string}") do |itemDroite, itemGauche| + within('.Spatial') do + find(:xpath, "//div[@class='item' and contains(., '#{itemGauche}')]/following-sibling::div[@class='item' and contains(., '#{itemDroite}')]") + end +end + +Alors("l'item {string} est à gauche du plan") do |item| + within('.Spatial') do + find(:xpath, "//div[@id='plan']/preceding-sibling::div[@class='item' and contains(., '#{item}')]") + end +end \ No newline at end of file