コード例 #1
0
ファイル: startrunner.py プロジェクト: huangcheong/PyGAT
def create_testproject():
    projectpath=RunnerSettings.get_rootdir()+GlobalConfig.get_slash()+RunnerSettings.TESTPROJECTNAME
    if os.path.exists(projectpath):
        shutil.rmtree(projectpath)
    os.makedirs(projectpath)
    package_init_file=file(projectpath+GlobalConfig.get_slash()+"__init__.py","w")
    package_init_file.close()
    os.makedirs(projectpath+GlobalConfig.get_slash()+"generation")
    package_init_file=file(projectpath+GlobalConfig.get_slash()+"generation"+GlobalConfig.get_slash()+"__init__.py","w")
    package_init_file.close()
コード例 #2
0
ファイル: startrunner.py プロジェクト: skyzhang2006/PyGAT
def create_testproject():
    projectpath = RunnerSettings.get_rootdir() + GlobalConfig.get_slash(
    ) + RunnerSettings.TESTPROJECTNAME
    if os.path.exists(projectpath):
        shutil.rmtree(projectpath)
    os.makedirs(projectpath)
    package_init_file = file(
        projectpath + GlobalConfig.get_slash() + "__init__.py", "w")
    package_init_file.close()
    os.makedirs(projectpath + GlobalConfig.get_slash() + "generation")
    package_init_file = file(
        projectpath + GlobalConfig.get_slash() + "generation" +
        GlobalConfig.get_slash() + "__init__.py", "w")
    package_init_file.close()
コード例 #3
0
 def __init__(self, casefilename, caseid):
     '''
     Constructor
     '''
     GlobalConfig.TestCaseFilePath = GlobalConfig.get_testcase_filepath(
         casefilename)
     self.testcaseid = caseid
コード例 #4
0
ファイル: startrunner.py プロジェクト: huangcheong/PyGAT
def genreate_testcase():
    testcasefilefolder=RunnerSettings.get_rootdir()+GlobalConfig.get_slash()+RunnerSettings.TESTPROJECTNAME+GlobalConfig.get_slash()+"generation"
    print(testcasefilefolder)
    for xmlfile in os.listdir(RunnerSettings.get_xml_folder()):
        if xmlfile.endswith("testcase.xml"):
            testcaselist=get_testcaselist(RunnerSettings.get_xml_folder()+GlobalConfig.get_slash()+xmlfile)
            testmethodcontent=""
            print(len(testcaselist))
            for testcase in testcaselist:
                print(create_testmethod_content(testcase,xmlfile))
                testmethodcontent=testmethodcontent+create_testmethod_content(testcase,xmlfile)+"\n"
            print(testmethodcontent)
            testclass_content=create_testclass_content(testcase.StepGroup,testmethodcontent)
            testcasefile=file(testcasefilefolder+GlobalConfig.get_slash()+xmlfile.split(".")[0]+".py","w")
            testcasefile.write(testclass_content)
            testcasefile.close()
コード例 #5
0
 def call_step_method(self, teststep):
     GlobalConfig.StepParameterFilePath = GlobalConfig.get_parameter_filepath(
         teststep.StepParametersFilePath)
     instance = MethodInvoker.get_instance(teststep.StepPackage,
                                           teststep.StepGroup,
                                           teststep.StepPackage.split('.'))
     method = MethodInvoker.get_method(instance, teststep.StepName)
     arglist = list()
     arglist.append(teststep.StepParameterID)
     method(arglist)
コード例 #6
0
ファイル: startrunner.py プロジェクト: skyzhang2006/PyGAT
def genreate_testcase():
    testcasefilefolder = RunnerSettings.get_rootdir() + GlobalConfig.get_slash(
    ) + RunnerSettings.TESTPROJECTNAME + GlobalConfig.get_slash(
    ) + "generation"
    print(testcasefilefolder)
    for xmlfile in os.listdir(RunnerSettings.get_xml_folder()):
        if xmlfile.endswith("testcase.xml"):
            testcaselist = get_testcaselist(RunnerSettings.get_xml_folder() +
                                            GlobalConfig.get_slash() + xmlfile)
            testmethodcontent = ""
            print(len(testcaselist))
            for testcase in testcaselist:
                print(create_testmethod_content(testcase, xmlfile))
                testmethodcontent = testmethodcontent + create_testmethod_content(
                    testcase, xmlfile) + "\n"
            print(testmethodcontent)
            testclass_content = create_testclass_content(
                testcase.StepGroup, testmethodcontent)
            testcasefile = file(
                testcasefilefolder + GlobalConfig.get_slash() +
                xmlfile.split(".")[0] + ".py", "w")
            testcasefile.write(testclass_content)
            testcasefile.close()
コード例 #7
0
 def testName(self):
     GlobalConfig.StepParameterFilePath=GlobalConfig.get_parameter_filepath("ComponetParameters.xml")
     instance=MethodInvoker.get_instance("gateside.autotesting.iat_stepgroups.teststep","TestStep","gateside.autotesting.iat_stepgroups.teststep".split("."))
     method=MethodInvoker.get_method(instance,"setpmethod")
     args=list()
     MethodInvoker.invoke_method(method,args)
コード例 #8
0
 def testName(self):
     print(GlobalConfig.get_rootdir())
コード例 #9
0
 def get_testclass_tempatepath():
     return RunnerSettings.get_template_folder() + GlobalConfig.get_slash(
     ) + "testclass.txt"
コード例 #10
0
 def get_xml_folder():
     return RunnerSettings.get_rootdir() + GlobalConfig.get_slash(
     ) + "datafiles" + GlobalConfig.get_slash() + "xmls"
コード例 #11
0
 def get_template_folder():
     if RunnerSettings.ROOTDIR == None:
         return RunnerSettings.get_rootdir() + GlobalConfig.get_slash(
         ) + "gatrunner" + GlobalConfig.get_slash() + "templates"
     else:
         return RunnerSettings.ROOTDIR
コード例 #12
0
 def testName(self):
     print(GlobalConfig.get_rootdir())
コード例 #13
0
ファイル: runnersettings.py プロジェクト: huangcheong/PyGAT
 def get_testclass_tempatepath():
     return RunnerSettings.get_template_folder()+GlobalConfig.get_slash()+"testclass.txt"
 
 
     
     
コード例 #14
0
ファイル: runnersettings.py プロジェクト: huangcheong/PyGAT
 def get_xml_folder():
     return RunnerSettings.get_rootdir()+GlobalConfig.get_slash()+"datafiles"+GlobalConfig.get_slash()+"xmls"
コード例 #15
0
ファイル: runnersettings.py プロジェクト: huangcheong/PyGAT
 def get_template_folder():
     if RunnerSettings.ROOTDIR==None:
         return RunnerSettings.get_rootdir()+GlobalConfig.get_slash()+"gatrunner"+GlobalConfig.get_slash()+"templates"
     else:
         return RunnerSettings.ROOTDIR