Skip to content

Commit 3ed44f7

Browse files
committed
TEST: Browse items while moving in a physical space
Co-authored-by: Benoit Savornin <benoit.savornin@outlook.fr>
1 parent 82fd5b3 commit 3ed44f7

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

features/step_definitions/event.rb

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,32 @@
5757
end
5858
end
5959

60+
Alors("l'item {string} est au dessus du plan") do |item|
61+
within('.Spatial') do
62+
find(:xpath, "//div[@class='item' and contains(., '#{item}')]/../following-sibling::div/div[@id='plan']")
63+
end
64+
end
65+
66+
Alors("l'item {string} est au dessus de l'item {string}") do |itemHaut, itemBas|
67+
within('.Spatial') do
68+
find(:xpath, "//div[@class='item' and contains(., '#{itemHaut}')]/../following-sibling::div/div[contains(.,'#{itemBas}')]")
69+
end
70+
end
71+
72+
Alors("l'item {string} est à droite du plan") do |item|
73+
within('.Spatial') do
74+
find(:xpath, "//div[@id='plan']/following-sibling::div[@class='item' and contains(., '#{item}')]")
75+
end
76+
end
77+
78+
Alors("l'item {string} est à droite de l'item {string}") do |itemDroite, itemGauche|
79+
within('.Spatial') do
80+
find(:xpath, "//div[@class='item' and contains(., '#{itemGauche}')]/following-sibling::div[@class='item' and contains(., '#{itemDroite}')]")
81+
end
82+
end
83+
84+
Alors("l'item {string} est à gauche du plan") do |item|
85+
within('.Spatial') do
86+
find(:xpath, "//div[@id='plan']/preceding-sibling::div[@class='item' and contains(., '#{item}')]")
87+
end
88+
end

0 commit comments

Comments
 (0)