Пример #1
0
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
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
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
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
 def get_testclass_tempatepath():
     return RunnerSettings.get_template_folder()+GlobalConfig.get_slash()+"testclass.txt"
 
 
     
     
Пример #14
0
 def get_xml_folder():
     return RunnerSettings.get_rootdir()+GlobalConfig.get_slash()+"datafiles"+GlobalConfig.get_slash()+"xmls"
Пример #15
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