- Commenting Tear down to avoid testcase break

Signed-off-by: sushant <sushant.bawiskar@candelatech.com>
This commit is contained in:
sushant
2021-07-17 01:15:51 +05:30
parent a0eff62340
commit 9137436b0c

View File

@@ -113,48 +113,60 @@ def setup_perfectoMobile_android(request):
reporting_client.test_start(testCaseName, TestContext([], "Perforce")) reporting_client.test_start(testCaseName, TestContext([], "Perforce"))
def teardown(): def teardown():
reporting_client.test_stop(TestResultFactory.create_success())
driver.close()
print("\n------------")
print("Driver Closed")
try: try:
print("\n\n---------- Tear Down ----------") driver.quit()
testFailed = 0 print("Driver Quit")
testFailed = request.session.testsfailed print("------------")
print("Testcase Failure Count: ", str(testFailed))
if testFailed>0:
print ("Test Case Failure, please check report link: " + testCaseName)
try:
exceptionFailure = request.config.cache.get("SelectingWifiFailed", None)
reporting_client.test_stop(TestResultFactory.create_failure(exceptionFailure))
except Exception as e:
reporting_client.test_stop(TestResultFactory.create_failure("Test Case failed -- See perfecto reports"))
#seen = {None}
#session = request.node
#print(session)
elif testFailed<=0:
reporting_client.test_stop(TestResultFactory.create_success())
#amount = len(request.session.items)
#print("Test Session Items: ")
#print(amount)
#tests_count = request.session.testscollected
#print("Test Collected: ")
#print(tests_count)
print('Report-Url: ' + reporting_client.report_url())
print("----------------------------------------------------------")
driver.close()
except Exception as e: except Exception as e:
print(" -- Exception While Tear Down --") print(" -- Exception Not Able To Quit --")
reporting_client.test_stop(TestResultFactory.create_failure(e)) print(e)
print('Report-Url-Failure: ' + reporting_client.report_url() + '\n') # try:
driver.close() # # print("\n\n---------- Tear Down ----------")
print (e) # testFailed = 0
finally: # testFailed = request.session.testsfailed
try: # print("Testcase Failure Count: ", str(testFailed))
driver.quit() # if testFailed>0:
except Exception as e: # print ("Test Case Failure, please check report link: " + testCaseName)
print(" -- Exception Not Able To Quit --") # try:
print (e) # exceptionFailure = request.config.cache.get("SelectingWifiFailed", None)
# reporting_client.test_stop(TestResultFactory.create_failure(exceptionFailure))
# except Exception as e:
# reporting_client.test_stop(TestResultFactory.create_failure("Test Case failed -- See perfecto reports"))
#
# seen = {None}
# session = request.node
# print(session)
# elif testFailed<=0:
# reporting_client.test_stop(TestResultFactory.create_success())
#
# #amount = len(request.session.items)
# #print("Test Session Items: ")
# #print(amount)
#
# #tests_count = request.session.testscollected
# #print("Test Collected: ")
# #print(tests_count)
#
# # print('Report-Url: ' + reporting_client.report_url())
# # print("----------------------------------------------------------")
# # reporting_client.test_stop()
# driver.close()
# except Exception as e:
# print(" -- Exception While Tear Down --")
# reporting_client.test_stop(TestResultFactory.create_failure(e))
# print('Report-Url-Failure: ' + reporting_client.report_url() + '\n')
# driver.close()
# print (e)
# finally:
# try:
# driver.quit()
# except Exception as e:
# print(" -- Exception Not Able To Quit --")
# print (e)
request.addfinalizer(teardown) request.addfinalizer(teardown)