sudharsan-selvaraj / appium-dashboard-plugin

Appium plugin that provides complete test logs, video recording of test and device logs(logcat and syslogs) for easy debugging.
113 stars 28 forks source link

My test ran successfully though in appium dashboard that session test result is showing as failed #125

Closed Jyothishkumarav closed 1 year ago

Jyothishkumarav commented 1 year ago

How are you seeing a session execution test status as passed or failed. my test cases were passed in a single session. However in dashboard result it is showing as failed.

Jyothishkumarav commented 1 year ago
Screenshot 2023-03-09 at 11 48 02 PM Screenshot 2023-03-09 at 11 47 48 PM
sudharsan-selvaraj commented 1 year ago

Currently we don't have a concrete logic to determine if a test execution is pass/fail. We just check all appium commands except findElement and isDisplayed for any errors. if those commands result in error, we mark those tests as failed. We also provide an option to update the test status from the code.

Java client:

driver.executeScript("dashboard: updateStatus", ImmutableMap.of("status", "passed"));

Webdriver.IO:

driver.executeScript("dashboard: updateStatus", [{status: "passed"}]);
Jyothishkumarav commented 1 year ago

Thanks for the update

Jyothishkumarav commented 1 year ago

I have tried with above code, but getting below response from appium server. i am using python appium client driver.execute_script("dashboard: updateStatus", '''[{"status": "passed"}]''')

Calling AppiumDriver.execute() with args: ["dashboard: updateStatus",["[{\"status\": \"passed\"}]"],"2e7e7af9-bd05-40db-acf7-aba6ffa1ee95"] [AppiumDriver@20f6] Plugins which can handle cmd 'execute': appium-dashboard [AppiumDriver@20f6] Plugin appium-dashboard is now handling cmd 'execute' [AppiumDriver@20f6] Command 'execute' was *not* handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command *was* handled by these: ["appium-dashboard"]. [debug] [AndroidUiautomator2Driver@497f (2e7e7af9)] Responding to client with driver.execute() result: true

sudharsan-selvaraj commented 1 year ago

Can you try using driver.execute_script("dashboard: updateStatus", '''{"status": "passed"}''')?