Esempio n. 1
0
def invalidFilePathTestPlan():
    try:
        metadata1 = publisher_common.setupValidMetadata(TBTAFMetadataType.TEST_CODE,"TestCase1",["UnitTest", "Release1.0", "ModuleX"],1,"Test Module X")
        metadata2 = publisher_common.setupValidMetadata(TBTAFMetadataType.PRODUCT_CODE,"TestCase2",["UnitTest", "Release1.0", "ModuleY"],2,"Test Module Y")
        testCase1 = publisher_common.createTestCase(metadata1,15)
        testCase2 = publisher_common.createTestCase(metadata2,7)
        testSuite = publisher_common.createTestSuite(TBTAFTestSuiteType.NORMAL,"TestSuite1")
        publisher_common.addTestCase(testSuite,testCase1)
        publisher_common.addTestCase(testSuite,testCase2)
        publisher = publisher_common.createPublisher()
        publisher.PublishTestPlan(testSuite, "../invalid/test_plan.html", "html")
        print "Invalid File Path Test Plan exception expected but not thrown : FAILED"
    except IllegalArgumentException as e:
        print "Invalid File Path Test Plan : PASSED"
Esempio n. 2
0
def invalidFormatFlagResultReport():
    try:
        metadata1 = publisher_common.setupValidMetadata(TBTAFMetadataType.TEST_CODE,"TestCase1",["UnitTest", "Release1.0", "ModuleX"],1,"Test Module X")
        metadata2 = publisher_common.setupValidMetadata(TBTAFMetadataType.PRODUCT_CODE,"TestCase2",["UnitTest", "Release1.0", "ModuleY"],2,"Test Module Y")
        testCase1 = publisher_common.createTestCase(metadata1,15)
        testCase2 = publisher_common.createTestCase(metadata2,7)
        testSuite = publisher_common.createTestSuite(TBTAFTestSuiteType.NORMAL,"TestSuite1")
        publisher_common.addTestCase(testSuite,testCase1)
        publisher_common.addTestCase(testSuite,testCase2)
        publisher = publisher_common.createPublisher()
        publisher.PublishResultReport(testSuite, "test_report.pdf", "pdf")
        print "Invalid Format Flag Test Plan exception expected but not thrown : FAILED"
    except NonSupportedFormatException as e:
        print "Invalid Format Flag Test Plan : PASSED"
Esempio n. 3
0
def validResultReport():
    try:
        metadata1 = publisher_common.setupValidMetadata(TBTAFMetadataType.TEST_CODE,"TestCase1",["UnitTest", "Release1.0", "ModuleX"],1,"Test Module X")
        metadata2 = publisher_common.setupValidMetadata(TBTAFMetadataType.PRODUCT_CODE,"TestCase2",["UnitTest", "Release1.0", "ModuleY"],2,"Test Module Y")
        testCase1 = publisher_common.createTestCase(metadata1,15)
        testCase2 = publisher_common.createTestCase(metadata2,7)
        testSuite = publisher_common.createTestSuite(TBTAFTestSuiteType.NORMAL,"TestSuite1")
        publisher_common.addTestCase(testSuite,testCase1)
        publisher_common.addTestCase(testSuite,testCase2)
        publisher = publisher_common.createPublisher()
        publisher.PublishResultReport(testSuite, "result_report.html", "html")
        print "Valid Result Report : PASSED"
    except Exception as e:
        print "Valid Result Report exception not expected but thrown: " + str(e) + " : FAILED"