1
###############################################################################
3
# OERPScenario, OpenERP Functional Tests
4
# Author Joel Grand-Guillaume 2009
5
# Copyright Camptocamp SA
7
# This program is free software: you can redistribute it and/or modify
8
# it under the terms of the GNU General Public License as published by
9
# the Free Software Foundation, either version 3 Afero of the License, or
10
# (at your option) any later version.
12
# This program is distributed in the hope that it will be useful,
13
# but WITHOUT ANY WARRANTY; without even the implied warranty of
14
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
# GNU General Public License for more details.
17
# You should have received a copy of the GNU General Public License
18
# along with this program. If not, see <http://www.gnu.org/licenses/>.
20
##############################################################################
25
# # Initiate vars used to stored object used trought the tests
29
##############################################################################
30
# Scenario: install_and_run_base_module_quality
31
##############################################################################
33
##############################################################################
34
Given /^I want to run the quality tests provided by base_module_quality on installed module$/ do
35
@modules=IrModuleModule.find(:all,:domain=>[['name','=','base_module_quality']])
36
@modules.should be_true
38
##############################################################################
39
When /^I insall the base_module_quality$/ do
40
res = IrModuleModule.install_modules(@modules)
43
##############################################################################
44
And /^run the quality check on every installed module$/ do
45
@modules=IrModuleModule.find(:all,:domain=>[['state','=','installed']])
46
@modules.should be_true
47
@test_result=IrModuleModule.run_base_quality_test(@modules)
48
@test_result.should be_true
50
##############################################################################
51
Then /^I should have a report on every module$/ do
52
@modules.count.should == @test_result.count
54
##############################################################################
55
Then /^all module, except (\w+), should have a final score greater than (.*) percent$/ do |except_module,percent|
56
@test_result.each do |test_case|
57
if not test_case.name == except_module:
58
test_case.final_score.to_f.should > percent.to_f/100
62
##############################################################################
63
And /^here is a summary \(Not implemented yet\.\.\)$/ do
64
@test_result.each do |test_case|
65
output= ModuleQualityCheck.get_formatted_results(test_case)
66
# TODO Improve the output to appear into the test result...
67
# Don't find how to do it