simpleworks-gmbh / staf

Apache License 2.0
4 stars 0 forks source link

Failing API test case results in artifact type "Screenshot" instead of "CsvFile" #192

Closed LukaszKosc closed 2 years ago

LukaszKosc commented 2 years ago

There is an error now - when API test case is failing - it happens that artifact is configured like below: "artefact": { "classname": "de.simpleworks.staf.commons.report.artefact.Screenshot", "instance": { "type": "SCREENSHOT" } instead of:
"artefact": { "classname": "de.simpleworks.staf.commons.report.artefact.CsvFile", "instance": { "type": "CSVFILE" } } If I want to use method: executeTestcase() within test step with conditions: testcase.create_artefact=EVERYTIME

And I got error message in result.json { "description": "Compare data some test data", "order": 6, "startTime": 351561154695700, "stopTime": 351561191735800, "result": "FAILURE", "error": { "detailMessage": "... expected:<[-1]> but was:<[]>", "cause": { "fExpected": "-1", "fActual": "", "detailMessage": "Value ...", "stackTrace": [], "suppressedExceptions": [] }, "stackTrace": [], "suppressedExceptions": [] }, "artefact": { "classname": "de.simpleworks.staf.commons.report.artefact.Screenshot", "instance": { "type": "SCREENSHOT" } } }

staf.properties:

staf settings

testcase.create_artefact=EVERYTIME

Reporter settings

reporter.manager.class=de.simpleworks.staf.module.jsonreporter.JsonReporter reporter.manager.report.directory=results reporter.manager.override.report=false reporter.manager.report.name=result.json

Proxy

proxy.enabled=false proxy.port=8892

WebDriver settings

browser=CHROME webdriver.screenshot=true webdriver.headless=false webdriver.chrome.driver=PATH_TO_CHROMEDRIVER webdriver.window-position=0,0 webdriver.window-size=1920,1080

dustinbaer commented 2 years ago

I created a fix in v0.120.9

LukaszKosc commented 2 years ago

Problem is solved. For API test case HARFILE is created.

Important is to set: proxy.enabled=true proxy.api.port=8893 in staf.properties file.

Please see screenshot: image