Commit 520d772cb2751e89dff54e1257ba9754523e8547

Authored by Beatriz Rezener
Committed by Diego Camarinha
1 parent 5dd9ee46

Substituting icon on range. Closes issue #57.

Signed-off-by: João Gabriel <joaogabrieldebrittoesilva@gmail.com>
Signed-off-by: Beatriz Rezener <beatrizrezener@gmail.com>
app/assets/images/magnifying_glass.png

1.23 KB

app/views/metric_configurations/_ranges.html.erb
1 1 <tr>
2 2 <td>
3 3 <div>
4   - <a class="popover_element" rel="popover" data-placement="left" data-original-title="Comments" data-content="<%= mezuro_range.comments %>"><%= image_tag "magnifying_glass.png" %></a>
  4 + <a class="popover_element" rel="popover" data-placement="left" data-original-title="Comments" data-content="<%= mezuro_range.comments %>"><span id="comment-icon" class="fa fa-comment"></span></a>
5 5 <span style="color: #<%= mezuro_range.color %>"><%= mezuro_range.label %></span>
6 6 </div>
7 7 </td>
... ...
features/metric_configuration/show.feature
... ... @@ -23,6 +23,6 @@ Feature: Show Metric Configuration
23 23 And I have a sample metric configuration within the given mezuro configuration
24 24 And I have a sample range within the sample metric configuration
25 25 And I am at the sample metric configuration page
26   - When I click the Magnifying glass image
  26 + When I click the "comment-icon" icon
27 27 Then I should see "Comment"
28 28  
... ...
features/step_definitions/user_steps.rb
... ... @@ -2,11 +2,6 @@ When(/^I click the (.+) link$/) do |text|
2 2 click_link text
3 3 end
4 4  
5   -When(/^I click the (.+) image$/) do |image|
6   - find(:xpath, "//a/img[@alt='#{image}']/..").click
7   - sleep(1) #This sleep is essential to make the popup visible when we take a picture of the page
8   -end
9   -
10 5 When(/^I press the (.+) button$/) do |text|
11 6 click_button text
12 7 end
... ... @@ -27,3 +22,8 @@ end
27 22 When(/^I take a picture of the page$/) do
28 23 page.save_screenshot("/tmp/picture.png")
29 24 end
  25 +
  26 +When(/^I click the "(.*?)" icon$/) do |icon|
  27 + find('#' + icon).click # the hashtag symbol is necessary to find the id of a HTML element
  28 + sleep(1) #This sleep is essential to make the popup visible when we take a picture of the page
  29 +end
30 30 \ No newline at end of file
... ...