Commit c5a76ebfc6ec5ed8c43e879614a132d06f798821

Authored by Guilherme Rojas V. de Lima
Committed by Guilherme Rojas
1 parent 6f067305

Acceptance test for graphic of metric results

Signed-off By: Renan Fichberg <rfichberg@gmail.com>
app/assets/javascripts/module/graphic.js.coffee
... ... @@ -16,4 +16,4 @@ class Module.Graphic
16 16 display(data,container)
17 17  
18 18 display: (data, container) ->
19   - $('div#'+container).html('<img src="data:image/png;base64,' + data + '" />')
  19 + $('div#'+container).html('<img id="' + container + '" src="data:image/png;base64,' + data + '" />')
20 20 \ No newline at end of file
... ...
features/repository/show.feature
... ... @@ -91,7 +91,7 @@ Feature: Show Repository
91 91 And I click on the sample child's name
92 92 Then I should see a sample child's name
93 93  
94   - @kalibro_restart @javascript @wip
  94 + @kalibro_restart @javascript
95 95 Scenario: Should show the graphic of a given metric
96 96 Given I am a regular user
97 97 And I am signed in
... ... @@ -106,3 +106,5 @@ Feature: Show Repository
106 106 When I visit the repository show page
107 107 And I see a sample metric's name
108 108 When I click on the sample metric's name
  109 + Then I should see "Loading data. Please, wait."
  110 + Then I should see a loaded graphic for the sample metric
109 111 \ No newline at end of file
... ...
features/step_definitions/repository_steps.rb
... ... @@ -91,4 +91,11 @@ end
91 91  
92 92 Then(/^I should see a sample child's name$/) do
93 93 page.should have_content(@module_result.children.first.module.name)
  94 +end
  95 +
  96 +Then(/^I should see a loaded graphic for the sample metric$/) do
  97 + while (page.driver.network_traffic.last.response_parts.empty?) do
  98 + sleep(10)
  99 + end
  100 + page.all("img#container" + @metric_results.first.id.to_s).first.should_not be_nil
94 101 end
95 102 \ No newline at end of file
... ...