From 9cc28192eb43cf956cd430afbab5425adf685c90 Mon Sep 17 00:00:00 2001 From: Heitor Reis Date: Fri, 6 Nov 2015 14:17:00 -0200 Subject: [PATCH] Add acceptance test to check for ruby metric results on repository show --- features/repository/show/metric_results.feature | 19 +++++++++++++++++-- features/step_definitions/repository_steps.rb | 2 +- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/features/repository/show/metric_results.feature b/features/repository/show/metric_results.feature index d550edd..a235056 100644 --- a/features/repository/show/metric_results.feature +++ b/features/repository/show/metric_results.feature @@ -17,7 +17,7 @@ Feature: Repository metric results And I ask for the metric results of the given module result When I visit the repository show page And I click the "Tree Metric Results" h3 - And I see a sample metric's name + And I should see the sample metric's name And I click on the sample metric's name Then I should see "Loading data. Please, wait." @@ -35,7 +35,7 @@ Feature: Repository metric results And I ask for the metric results of the given module result When I visit the repository show page And I click the "Tree Metric Results" h3 - And I see a sample metric's name + And I should see the sample metric's name Then I should see "Missing range" @kalibro_configuration_restart @kalibro_processor_restart @javascript @@ -51,6 +51,21 @@ Feature: Repository metric results And I click the "Tree Metric Results" h3 Then I should see "Repository process returned with error. There are no tree metric results." + @kalibro_processor_restart @kalibro_configuration_restart @javascript + Scenario: Should show the metric results after processing with a ruby metric configuration + Given I am a regular user + And I am signed in + And I have a sample configuration with ruby native metrics + And I have a sample repository + And I start to process that repository + And I wait up for a ready processing + And I ask for the last ready processing of the given repository + And I ask for the module result of the given processing + And I ask for the metric results of the given module result + When I visit the repository show page + And I click the "Tree Metric Results" h3 + Then I should see the sample metric's name + # TODO: Scenario: Should show the graphic of a given metric # It was getting really difficult to test this because of Poltergeist's timeouts # so we gave up on this for now diff --git a/features/step_definitions/repository_steps.rb b/features/step_definitions/repository_steps.rb index 397ca59..4308867 100644 --- a/features/step_definitions/repository_steps.rb +++ b/features/step_definitions/repository_steps.rb @@ -103,7 +103,7 @@ Given(/^I ask for the hotspot metric results of the given module result$/) do @metric_results = @module_result.hotspot_metric_results end -Given(/^I see a sample metric's name$/) do +Given(/^I should see the sample metric's name$/) do expect(page).to have_content(@metric_results.first.metric_configuration.metric.name) end -- libgit2 0.21.2