Changeset 3704
- Timestamp:
- 05/21/08 00:18:46 (4 months ago)
- Files:
-
- testcasemanagementplugin/branches/testManagmentPluginGenshi/make.bat (added)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/setup.py (modified) (3 diffs)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/pathManager.py (modified) (2 diffs)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/properties.py (modified) (9 diffs)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/choosePathForTestRun.cs (deleted)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/choosePathForTestRun.html (added)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/header.html (added)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/main.html (added)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/testManagement.cs (deleted)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/testrun.html (added)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/testRunNotConfigured.cs (deleted)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/testRunNotConfigured.html (added)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/testRuns.cs (deleted)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/validated1.xml (added)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/validated.cs (deleted)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/templates/validated.html (added)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/testManager.py (modified) (5 diffs)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/testResults.py (modified) (1 diff)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/testRuns.py (modified) (9 diffs)
- testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/testScriptValidator.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
testcasemanagementplugin/branches/testManagmentPluginGenshi/setup.py
r2370 r3704 1 from setuptools import setup, find_packages 2 #setup( 3 # name = "sprintReports", 4 # version = "0.1", 5 # packages = find_packages(), 6 #) 7 8 9 from setuptools import setup, find_packages 10 11 PACKAGE = 'testManagementPlugin' 12 VERSION = '0.4.0' 1 from setuptools import find_packages, setup 13 2 14 3 setup( 15 name=PACKAGE, version=VERSION, 16 description='test case management tool', 17 author="Eoin Dunne", author_email="eoin.dunne@divestco.com", 4 name='testManagementPlugin', version='0.11.1', 5 author="Eoin Dunne", author_email="edunnesoftwaretesting@hotmail.com", 18 6 license='BSD', url='http://www.trac-hacks.org/wiki/TestCaseManagementPlugin', 19 7 packages=['testManagementPlugin'], … … 21 9 'testManagementPlugin': [ 22 10 'htdocs/css/*.css', 23 'templates/*. cs',11 'templates/*.html', 24 12 'htdocs/img/*.png', 25 13 'htdocs/js/*.js' … … 30 18 'testManagement=testManagementPlugin.testManager', 31 19 'manageTestRuns=testManagementPlugin.testRuns', 20 'testRunResults=testManagementPlugin.testResults', 32 21 'setPathForTestcases=testManagementPlugin.pathManager', 33 'testRunResults=testManagementPlugin.testResults',34 22 'validateTestRun=testManagementPlugin.testScriptValidator' 35 23 ] 36 24 }, 37 25 ) 38 39 40 #package_data={41 # 'webadmin': [42 # 'htdocs/css/*.css',43 # 'htdocs/img/*.png',44 # 'htdocs/js/*.js',45 # 'templates/*.cs'46 # ]47 #},48 #entry_points = {49 # 'trac.plugins': [50 # 'webadmin.web_ui = webadmin.web_ui',51 # 'webadmin.basics = webadmin.basics',52 # 'webadmin.logging = webadmin.logging',53 # 'webadmin.perm = webadmin.perm',54 # 'webadmin.plugin = webadmin.plugin',55 # 'webadmin.ticket = webadmin.ticket'56 # ]57 26 testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/pathManager.py
r2283 r3704 23 23 properties = Properties() #get set up with with a properties instance... 24 24 25 def process_testmanager_request(self, req ):25 def process_testmanager_request(self, req, data=None ): 26 26 if req.method == "POST": 27 27 … … 29 29 30 30 if errors : 31 req.hdf['testcase.run.errormessage'] = errors 32 return "testRunNotConfigured.cs", None 31 data["errorMessage"] = "error fetching test case list" 32 data["errorsList"] = errors 33 return "testRunNotConfigured.html", data, None 33 34 else : 34 35 req.redirect( req.base_url + "/testmanagement/runs?pathConfiguration=" + self.properties.getTestCasePath( self, req) ) 35 36 36 37 else: 37 req.hdf['testcases.path.path'] = self.properties.getTestCasePath( self, req)38 return "choosePathForTestRun. cs", None38 data['pathManager_path'] = self.properties.getTestCasePath( self, req) 39 return "choosePathForTestRun.html", data, None 39 40 40 41 def get_path( self, req ): testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/properties.py
r2341 r3704 1 #Author: Eoin Dunne 2 #email: edunnesoftwaretesting@hotmail.com 3 #May 2008 4 # 5 # 6 #Thanks to the guys at TRAC and the author of the TRAC admin tool. The main controller is based on your design. 7 # 8 #Long live open source! 9 1 10 import re 2 11 … … 37 46 38 47 def hasTestCases(self, component, req ): 39 #check to see if the path to the testcases has been specified for this component in this project. 40 41 testcasePath = self.getTestCasePath( component, req ) 42 repository = self.getRepository( component, req ) 43 44 #return repository.has_node( testcasePath ), testcasePath 45 return True, testcasePath 46 48 try: 49 #check to see if the path to the testcases has been specified for this component in this project. 50 51 testcasePath = self.getTestCasePath( component, req ) 52 repository = self.getRepository( component, req ) 53 54 #return repository.has_node( testcasePath ), testcasePath 55 return True, testcasePath, None 56 57 except Exception, ex: 58 return FALSE, testcasePath, str( ex ) 59 47 60 def getTestCasePath(self, component, req): 48 61 #potentially a user wants to use the branch for testcases so check that first … … 89 102 try: 90 103 content = entry.get_content().read() 91 testcase = TestCase( entry.get_name(), str(content), component )104 testcase = TestCase( entry.get_name(), str(content), component, entry.get_name() ) 92 105 testcases[ testcase.getId().encode('ascii', 'ignore').strip() ] = testcase 106 93 107 except Exception, ex: 94 errors.append( "The testcsae :" + entry.get_name() + " is not well formed xml...a parse error occured " ) 95 component.env.log.debug( "The testcsae :" + entry.get_name() + " is not well formed xml...a parse error occured " ) 96 108 errors.append( "The testcase :" + entry.get_name() + " is not well formed xml...a parse error occured " ) 97 109 98 110 #first let's do some validation on the testcases... … … 100 112 currentTestcase = None 101 113 component.env.log.debug( "testcases length is : " + repr( len( testcases ) ) ) 102 try: 103 for key, value in testcases.iteritems(): 104 currentTestcase = value #incase we do toss an exception I'll want some information from this testcase 105 components.index( value.getComponent().encode('ascii', 'ignore').strip() ) #this will toss an exception if the component in the testcase doesn't exist in the trac project 106 except Exception, ex: 107 errors.append( "The component :" + currentTestcase.getComponent() + ", in the testcase : " + currentTestcase.getId() + ", does not exist in the trac project " ) 108 component.env.log.debug( "The component :" + currentTestcase.getComponent() + ", in the testcase : " + currentTestcase.getId() + ", does not exist in the trac project " ) 109 110 component.env.log.debug( "testcases length is : " + repr( len( testcases ) ) ) 111 114 for key, value in testcases.iteritems(): 115 try: 116 currentTestcase = value #in case we do toss an exception I'll want some information from this testcase 117 components.index( value.getComponent().encode('ascii', 'ignore').strip() ) #this will toss an exception if the component in the testcase doesn't exist in the trac project 118 119 except Exception, ex: 120 errors.append( "The component :" + currentTestcase.getComponent() + ", in the testcase : " + currentTestcase.getId() + " in the file : " + currentTestcase.getFileName() + ", does not exist in the trac project " ) 121 122 112 123 return testcases, errors #ok return the testcases 113 124 … … 172 183 173 184 #append the error message saying testtemplates.xml doesn't exist, then exit. 174 errors.append( "No file called testtemplates.xml file found. This is the file necessary for grouping testcases into predefined test scripts ...like a smoke test" )185 errors.append( "No file called testtemplates.xml file found. This is the file necessary for grouping testcases into predefined test scripts even if it is just a stub (i.e) one template name and one testid..." ) 175 186 176 187 except Exception, ex: … … 181 192 182 193 194 def trimOutAnyProblemStrings( self, input ): 195 #trim out any characters/strings that could cause issues in the sql statement. I should just escape them but for now this is a quick hack 196 #this method doesn't really belong here. But I jammed it in because I'm a little rushed. Probably should dump it into a seperate python util file. 197 198 #make sure input is a real string 199 if not (input) : 200 return input 201 input = input.replace('\'', '-') #replace anything that will cause issues in the sql statement 202 input = input.replace(',', '-') #replace anything that will cause issues in the sql statement 203 input = input.replace('"', '-') #replace anything that will cause issues in the sql statement 204 input = input.replace('&', '-') #replace anything that will cause issues in the sql statement 205 input = input.replace('%', '-') #replace anything that will cause issues in the sql statement 206 input = input.replace('delete', '-') #replace anything that will cause issues in the sql statement 207 input = input.replace('drop', '-') #replace anything that will cause issues in the sql statement 208 input = input.replace('insert', '-') #replace anything that will cause issues in the sql statement 209 210 return input 211 183 212 class Templates: 184 213 … … 220 249 class TestCase : 221 250 #accessor methods for private properties 251 def getFileName(self) : 252 return self.fileName 253 222 254 def getId(self) : 223 255 return self.id.encode('ascii', 'ignore').strip() … … 235 267 return self.expectedresult 236 268 237 def __init__(self, testcasename, testCaseContent, component ) :269 def __init__(self, testcasename, testCaseContent, component, fileName = None ) : 238 270 self.id = "" 239 271 self.summary = "" … … 241 273 self.expectedresult = "" 242 274 self.component = "" 275 self.fileName = "" 276 277 self.fileName = fileName 243 278 244 279 attributesList = ['id', 'summary','description','expectedresult', 'component'] testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/testManager.py
r2041 r3704 1 #!/usr/bin/env python 1 #Author: Eoin Dunne 2 #email: edunnesoftwaretesting@hotmail.com 3 #May 2008 4 # 5 # 6 #Thanks to the guys at TRAC and the author of the TRAC admin tool. The main controller is based on your design. 7 # 8 #Long live open source! 2 9 3 10 import re … … 11 18 from trac.core import * 12 19 from trac.ticket import Milestone, Ticket, TicketSystem 20 from trac.util.html import html 13 21 from trac.web import IRequestHandler 14 from trac.util import Markup 15 from trac.web.chrome import INavigationContributor 16 from trac.web.chrome import add_stylesheet, INavigationContributor, ITemplateProvider 17 #from trac.web.href import Href 18 #from trac.wiki import wiki_to_html 22 from trac.web.chrome import INavigationContributor, ITemplateProvider, add_stylesheet 19 23 20 #env: The environment, an instance of the trac.env.Environment class (see trac.env).21 #config: The configuration, an instance of the trac.config.Configuration class (see trac.config).22 #log: The configured logger, see the Python logging API for more information.23 24 #TRAC_PATH = _find_base_path(sys.modules['trac.core'].__file__, 'trac.core')25 26 def main( argv ) :27 """28 29 """30 print "main"31 24 32 25 … … 39 32 """ 40 33 41 def process_testmanager_request(self, req ):34 def process_testmanager_request(self, req, data=None ): 42 35 """ 43 36 """ … … 45 38 """ 46 39 """ 47 48 class TestManager (Component):49 implements(INavigationContributor, IRequestHandler, ITemplateProvider )40 41 class TestManager (Component): 42 implements(INavigationContributor, IRequestHandler, ITemplateProvider) 50 43 51 44 #class variable...a collection of objects that implement the ITestManagerRequestHandler interface. Makes it's super easty to extend... 52 45 page_providers = ExtensionPoint(ITestManagerRequestHandler) 46 47 def __init__(self) : 48 #in here we could do stuff. 49 pass 53 50 51 54 52 # INavigationContributor methods 55 53 def get_active_navigation_item(self, req): 56 54 return 'testmanagement' 57 55 58 #This is for trac to Add sprint to the tabbed header.59 56 def get_navigation_items(self, req): 60 yield ('mainnav', ' testmanagement', Markup('<a href="%s">TestManagement</a>', self.env.href.testmanagement() + '/' ) )61 57 yield ('mainnav', 'TestManagement', 58 html.A('TestManagement', href= req.href.testmanagement())) 62 59 63 60 # IRequestHandler methods 64 #let's figure out if we are the one that should care about this request.65 61 def match_request(self, req): 66 62 match = re.match('/testmanagement*', req.path_info) 67 63 return match 68 69 #main entry point into this class. This is a required method of the IRequestHandler interface, which is part of the trac framework. 64 70 65 def process_request(self, req): 71 66 72 add_stylesheet(req, 'testmanagement/css/testcase.css') 67 68 action = req.args.get('action', 'view') 69 pagename = req.args.get('page', 'WikiStart') 70 version = req.args.get('version') 71 data = { "testcase_page_content" : "select option from above list" } 72 73 if pagename.endswith('/'): 74 req.redirect(req.href.wiki(pagename.strip('/'))) 75 73 76 pageProvider = self.getPageProvider(req) 74 77 … … 77 80 page_providers_paths[ provider.get_path(req) ] = { 'name': provider.get_descriptive_name(), 'path': req.base_url + "/testmanagement/" + provider.get_path(req) } 78 81 79 req.hdf['testcase.page_providers_paths'] = page_providers_paths 82 data["handlers"] = page_providers_paths 83 84 if pageProvider : 85 template, data, content_type = pageProvider.process_testmanager_request( req, data ) 86 return template, data, content_type 87 #return 'testManagement.cs', content_type #content_type probably = none which is by default rendered as MIME type text/html 80 88 81 if pageProvider : 82 template, content_type = pageProvider.process_testmanager_request( req ) 83 req.hdf['testcase.page_template'] = template 84 return 'testManagement.cs', content_type #content_type probably = none which is by default rendered as MIME type text/html 85 else : 86 req.hdf['testcase.page_content'] = "select option from above list" #you could insert a message here if you wanted... 87 88 return 'testManagement.cs', None #content_type probably = none which is by default rendered as MIME type text/html 89 89 90 # This tuple is for Genshi (template_name, data, content_type) 91 # Without data the trac layout will not appear. 92 return 'main.html', data, None 90 93 94 # ITemplateProvider methods 95 # Used to add the plugin's templates and htdocs 96 def get_templates_dirs(self): 97 from pkg_resources import resource_filename 98 return [resource_filename(__name__, 'templates')] 99 100 def get_htdocs_dirs(self): 101 """Return a list of directories with static resources (such as style 102 sheets, images, etc.) 103 104 Each item in the list must be a `(prefix, abspath)` tuple. The 105 `prefix` part defines the path in the URL that requests to these 106 resources are prefixed with. 107 108 The `abspath` is the absolute path to the directory containing the 109 resources on the local file system. 110 """ 111 from pkg_resources import resource_filename 112 return [('hw', resource_filename(__name__, 'htdocs'))] 113 114 91 115 def getPageProvider(self, req): 92 116 """Find the page provider if any""" 93 117 118 self.env.log.info( "PATH INFO : " + repr( req.path_info ) ) 94 119 for provider in self.page_providers: 120 self.env.log.info( "Provider name : " + repr(provider) ) 95 121 if re.match('/testmanagement/' + provider.get_path(req), req.path_info) : 96 self.env.log. debug( "found provider : " + repr(provider.get_path(req) ) )122 self.env.log.info( "found provider : " + repr(provider.get_path(req) ) ) 97 123 return provider 98 124 99 125 return None 100 101 102 # ITemplateProvider103 104 def get_htdocs_dirs(self):105 """Return the absolute path of a directory containing additional106 static resources (such as images, style sheets, etc).107 """108 from pkg_resources import resource_filename109 return [('testmanagement', resource_filename(__name__, 'htdocs'))]110 111 def get_templates_dirs(self):112 """Return the absolute path of the directory containing the provided113 ClearSilver templates.114 """115 from pkg_resources import resource_filename116 return [resource_filename(__name__, 'templates')]117 118 if __name__ == '__main__':119 sys.exit( main( sys.argv ) )testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/testResults.py
r1982 r3704 21 21 implements(ITestManagerRequestHandler) 22 22 23 def process_testmanager_request(self, req ):23 def process_testmanager_request(self, req, data=None ): 24 24 #for now let's just re-direct to a query page that shows all open testcases grouped by owner and ordered by milestone 25 25 query_URL = req.base_url + "/query?status=new&status=assigned&status=reopened&testcase_result=&type=testcase&order=milestone&group=owner" testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/testRuns.py
r2283 r3704 1 #!/usr/bin/env python 1 #Author: Eoin Dunne 2 #email: edunnesoftwaretesting@hotmail.com 3 #May 2008 4 # 5 # 6 #Thanks to the guys at TRAC and the author of the TRAC admin tool. The main controller is based on your design. 7 # 8 #Long live open source! 9 2 10 3 11 import re … … 34 42 properties = Properties() #get set up with with a properties instance... 35 43 36 def process_testmanager_request(self, req): 37 38 req.hdf['testcase.run.basepath'] = req.base_url 39 40 hasTestCases, path = self.properties.hasTestCases( self, req ) 44 def process_testmanager_request(self, req, data ): 45 hasTestCases, testCaseSVNpath, errors = self.properties.hasTestCases( self, req ) 46 data["hasTestCases"] = hasTestCases 47 data["testrun_svn_path"] = testCaseSVNpath 41 48 42 49 if hasTestCases : … … 51 58 52 59 else: 53 req.hdf['testcase.run.errormessage'] = errorMessage_orQueryURL 54 req.hdf['testcase.run.pathConfiguration'] = self.properties.getTestCasePath(self, req) 55 req.hdf['testcase.run.urlPath'] = req.base_url + "/testmanagement/runs?pathConfiguration=" + self.properties.getTestCasePath(self, req) 56 return "testRunNotConfigured.cs", None 57 58 else : 60 61 data["errorMessage"] = errorMessage_orQueryURL 62 return "testRunNotConfigured.html", data, None 63 64 elif errors != None : 65 self.env.log.info( "ARG!") 66 data["errorMessage"] = errors 67 return template, data, content_type 68 69 else: 59 70 # Show Test Run Generation Form: allows a manager to assign testruns to QA staff. 60 return self.provideDefaultCreateTestRunPage( req ) 61 71 self.env.log.info( "it wasn't a post....so we know where we are....trying to generate the default page" ) 72 template, data, content_type = self.provideDefaultCreateTestRunPage( req, data ) 73 return template, data, content_type 74 62 75 else: 76 return "testRunNotConfigured.html", data, None 63 77 #handle when we don't have any test cases...for whatever reason.... 64 req.hdf['testcase.run.errormessage'] = "Path in config file is does not exist in subversion...resolved path was: " + path 65 return "testRunNotConfigured.cs", None 66 67 78 #req.hdf['testcase.run.errormessage'] = "Path in config file is does not exist in subversion...resolved path was: " + path 79 #return "testRunNotConfigured.cs", None 80 81 return "testrun.html", data, None 82 83 def get_path( self, req ): 84 return "runs" 85 86 def get_descriptive_name(self): 87 return "Create Test Run from main line" 88 89 90 def provideDefaultCreateTestRunPage( self, req, data ) : 91 """ 92 this method will retrive a list of users, milestones, versions, testcases, and test templates. 93 Test case information and test template information comes from subversion while version and user information comes from TRAC. 94 95 """ 96 testcaseNames = [] 97 testcaseTemplates = [] 98 99 #ok now let's extract out of testcases what we need which is mostly testcase ids and template names.. 100 101 testcases, errors = self.properties.getTestCases( self, req ) #fetch the testcases... 102 103 self.env.log.info( "TESTCASES" + repr(testcases) + " ERRORS : " + repr(errors) ) 104 105 if testcases == None or len(errors) > 0 : 106 data["errorMessage"] = "No test cases found or other error...see list below if any" 107 data["errorsList"] = errors 108 return "testRunNotConfigured.html", data, None 109 110 for key, testcase in testcases.iteritems(): 111 testcaseNames.append( testcase.getId() ) 112 testcaseNames.sort() 113 114 templates = self.properties.getTemplates(self, req ) 115 templateNames = [] 116 if templates != None : 117 templateNames = templates.getTemplateNames() 118 119 milestones = self.properties.getMilestones(self, req ) 120 milestones.append("") #this is so there is a blank in the drop down select...default is none... 121 versions = self.properties.getVersions(self, req ) 122 versions.append("") #ditto 123 124 self.env.log.info( "KNOWN USERS : " + repr ( self.properties.getKnownUserNamesOnly(self, req) ) ) 125 126 data['testrun_users'] = self.properties.getKnownUserNamesOnly(self, req) 127 data['testrun_testcases'] = testcaseNames 128 data['testrun_testtemplates'] = templateNames 129 data['testrun_versions'] = versions 130 data['testrun_milestones'] = milestones 131 data['testrun_validatePath'] = req.base_url + "/testmanagement/validate?pathConfiguration=" + self.properties.getTestCasePath(self, req) 132 133 return "testrun.html", data, None 134 68 135 def generateTracTickets( self, req ) : 69 136 """ … … 81 148 82 149 #grab the parameters that we care about out of the request object 83 testRun Description = str( req.args.get('testrundescription') )84 users = req.args.get(' users')85 testTemplates = req.args.get('test templates')86 testcases = req.args.get('test cases')87 version = str( req.args.get(' selectedversion'))88 milestone = str( req.args.get(' selectedmilestone'))89 testConfiguration = str( req.args.get('test configuration'))150 testRunKeyWord = str( req.args.get('testrun_keyword') ) 151 users = req.args.get('testrun_users') 152 testTemplates = req.args.get('testrun_selectedtemplates') 153 testcases = req.args.get('testrun_selectedtestcases') 154 version = str( req.args.get('testrun_selectedversion')) 155 milestone = str( req.args.get('testrun_selectedmilestone')) 156 testConfiguration = str( req.args.get('testrun_testconfiguration')) 90 157 91 158 #-----------------------------------ERROR CHECKING ON PARAMETERS-------------------------------------------- 92 159 #it might make sense to create a new method to validate the parameters passed in but for now we'll leave it. 160 161 if testRunKeyWord == None : 162 testRunKeyWord = "" 163 testRunKeyWord = self.properties.trimOutAnyProblemStrings(testRunKeyWord) #this is manually typed in...so it's probably to look for sqlInjection etc... 93 164 94 165 if version == None: … … 126 197 if testTemplates == None : 127 198 return False, "must select at least one testcase or test template to create a test run" 128 return 'errorCreatingTestRun.cs', None199 129 200 elif testTemplates == None : 130 201 testTemplates = [] … … 175 246 ticket.values['version'] = version 176 247 ticket.values['milestone'] = milestone 177 ticket.values['keywords'] = "Test_ver" + version + "_mile_" + milestone248 ticket.values['keywords'] = testRunKeyWord 178 249 #self._validate_ticket(req, ticket) #probably should validate the ticket here. 179 250 ticket.insert(db=db) … … 189 260 190 261 #redirect to a custom query report showing the created tickets 191 return True, req.base_url + "/query?status=new&status=assigned&status=reopened& testcase_result=&version=" + version + "&milestone=" + milestone + "&type=testcase&order=priority&group=owner"262 return True, req.base_url + "/query?status=new&status=assigned&status=reopened&status=accepted&testcase_result=&version=" + version + "&milestone=" + milestone + "&type=testcase&order=priority&group=owner" 192 263 193 264 def createCombinedTestCaseList( self, testTemplates, testcases, req ) : … … 200 271 for name in testTemplates : 201 272 name = name.encode('ascii', 'ignore') 273 name = self.properties.trimOutAnyProblemStrings(name ) 202 274 testIds = projTemplates.getTestsForTemplate( name ) 203 275 if testIds != None : … … 213 285 214 286 return tempTestCaseList 215 216 def provideDefaultCreateTestRunPage( self, req ) : 217 """ 218 this method will retrive a list of users, milestones, versions, testcases, and test templates. 219 Test case information and test template information comes from subversion while version and user information comes from TRAC. 220 221 """ 222 testcaseNames = [] 223 testcaseTemplates = [] 224 225 #ok now let's extract out of testcases what we need which is mostly testcase ids and template names.. 226 227 testcases, errors = self.properties.getTestCases( self, req ) #fetch the testcases... 228 229 if testcases == None or errors : 230 #there was an error of some kind fetching the testcases... 231 req.hdf['testcase.run.errormessage'] = errors 232 233 return "testRunNotConfigured.cs", None 234 235 for key, testcase in testcases.iteritems(): 236 testcaseNames.append( testcase.getId() ) 237 testcaseNames.sort() 238 239 templates = self.properties.getTemplates(self, req ) 240 templateNames = [] 241 if templates != None : 242 templateNames = templates.getTemplateNames() 243 244 sprints = self.properties.getMilestones(self, req ) 245 sprints.append("") #this is so there is a blank in the drop down select...default is none... 246 versions = self.properties.getVersions(self, req ) 247 versions.append("") #ditto 248 249 req.hdf['testcase.run.validatePath'] = req.base_url + "/testmanagement/validate?pathConfiguration=" + self.properties.getTestCasePath(self, req) 250 req.hdf['testcase.run.pathConfiguration'] = self.properties.getTestCasePath(self, req) 251 req.hdf['testcase.run.users']= self.properties.getKnownUserNamesOnly(self, req) 252 req.hdf['testcase.run.testcases']= testcaseNames 253 req.hdf['testcase.run.testtemplates']= templateNames 254 req.hdf['testcase.run.sprints']= sprints 255 req.hdf['testcase.run.versions']= versions 256 257 return 'testRuns.cs', None 258 259 260 def get_path( self, req ): 261 return "runs" 262 263 def get_descriptive_name(self): 264 return "Create Test Run from mainline" 287 testcasemanagementplugin/branches/testManagmentPluginGenshi/testManagementPlugin/testScriptValidator.py
r2325 r3704 1 #!/usr/bin/env python 1 #Author: Eoin Dunne 2 #email: edunnesoftwaretesting@hotmail.com 3 #May 2008 4 # 5 # 6 #Thanks to the guys at TRAC and the author of the TRAC admin tool. The main controller is based on your design. 7 # 8 #Long live open source! 2 9 3 10 import re … … 25 32 properties = Properties() #get set up with with a properties instance... 26 33 27 def process_testmanager_request(self, req ):34 def process_testmanager_request(self, req, data=None ): 28 35 #check for errors in the testcases and configuration, if there are no errors let the user know, and vice versa 29 36 try: … … 31 38 32 39 if errors : 33 req.hdf['testcase.run.errormessage'] = errors 34 return "testRunNotConfigured.cs", None 40 data["errorMessage"] = "error fetching test case list" 41 data["errorsList"] = errors 42 return "testRunNotConfigured.html", data, None 35 43 else: 36 req.hdf['testcase.validate.pathConfiguration'] = self.properties.getTestCasePath( self, req)37 req.hdf['testcase.validate.urlPath'] = req.base_url + "/testmanagement/runs?pathConfiguration=" + self.properties.getTestCasePath( self, req)38 return "validated. cs", None44 data['validate_pathConfiguration'] = self.properties.getTestCasePath( self, req) 45 data['validate_urlPath'] = req.base_url + "/testmanagement/runs?pathConfiguration=" + self.properties.getTestCasePath( self, req) 46 return "validated.html", data, None 39 47 except Exception, ex: 40 req.hdf['testcase.run.errormessage'] = str( ex ) 41 return "testRunNotConfigured.cs", None 48 data["errorMessage"] = "error fetching test case list" 49 data["errorsList"] = str( ex ) 50 return "testRunNotConfigured.html", data, None 42 51 43 52 def get_path( self, req ):
