Пример #1
0
    def verify(self,window,refrenceid,objectidentifier,texttoenter):
        commonFns.pcorMacVerification(window,refrenceid,objectidentifier,texttoenter)

    def reporting(self):
        print "Executing %s" % testcaseName, ":" + testcaseDescription

    def quit(self,Appbundleid ):
        commonFns.quitApplication(Appbundleid)

if __name__ == "__main__":
    testcaseobj = TestCase()
    testcaseobj.reporting()
    testcaseobj.launch(constants.Data["bundleid"])
    reference = testcaseobj.appRef(constants.Data["bundleid"])
    window = testcaseobj.appwindow(reference)
    buttons = testcaseobj.appButtons(window)
    commonFns.atomacclick(buttons[7])
    testcaseobj.verify(window,reference,constants.Data["icon"], constants.Data["email"])
    childwindows = commonFns.getApplicationwindowId(reference)
    protectdevicewindowbuttons = commonFns.getAppButtons(childwindows)
    commonFns.atomacclick(protectdevicewindowbuttons[0])
    ldtp.wait(10)
    newbuttons = commonFns.getAppButtons(childwindows)
    commonFns.atomacclick(newbuttons[0])
    ldtp.wait(5)
    filename = testcaseDescription + "pass" + strftime("%Y-%m-%d %H:%M:%S", gmtime())
    commonFns.Resultsupdate(constants.Data['testresult'], filename)
    testcaseobj.quit(constants.Data["bundleid"])

Пример #2
0
if __name__ == "__main__":
    testcaseobj = TestCase()
    testcaseobj.reporting()
    testcaseobj.launch(constants.Data["bundleid"])
    reference = testcaseobj.appRef(constants.Data["bundleid"])
    window = testcaseobj.appwindow(reference)
    buttons = testcaseobj.appButtons(window)
    testcaseobj.verify(buttons, window, reference, constants.Data["icon"],
                       constants.Data["email"])
    filename = testcaseDescription + "pass" + strftime("%Y-%m-%d %H:%M:%S",
                                                       gmtime())
    commonFns.screenshot(filename)
    childwindows = commonFns.getApplicationwindowId(reference)
    protectdevicewindowbuttons = commonFns.getAppButtons(childwindows)
    commonFns.atomacclick(protectdevicewindowbuttons[0])
    filename = testcaseDescription + "pass" + strftime("%Y-%m-%d %H:%M:%S",
                                                       gmtime())
    commonFns.screenshot(filename)
    newbuttons = commonFns.getAppButtons(childwindows)
    ldtp.wait(8)
    if commonFns.atomacclick(newbuttons[0]):
        filename = testcaseDescription + "pass" + strftime(
            "%Y-%m-%d %H:%M:%S", gmtime())
        commonFns.Resultsupdate(constants.Data["testresult"], filename)
        commonFns.screenshot(filename)
    else:
        fileupdate = testcaseDescription + "fail" + strftime(
            "%Y-%m-%d %H:%M:%S", gmtime())
        commonFns.Resultsupdate(constants.Data["testresult"], fileupdate)
    testcaseobj.quit(constants.Data["bundleid"])
Пример #3
0
 def verify(self,Appbundleid):
     if commonFns.launchApplication(Appbundleid):
         commonFns.Resultsupdate(constants.Data["testresult"], filename)
     else:
         commonFns.Resultsupdate(constants.Data["testresult"], filename)