allure-framework / allure-js-commons

Deprecated, use https://github.com/allure-framework/allure-js instead
Other
27 stars 40 forks source link

stop and status not populated when searching for sub-elements #22

Closed jaysirju closed 1 year ago

jaysirju commented 7 years ago

Looks like the step stop and status are not reported properly when calling elementIdElements

I called it a couple times in my test, and noticed this in my testsuite.xml:

<step start="1478634228965" stop="" status="">
    <name>POST /wd/hub/session/2e793399-38da-44ba-8747-961bfc1259e7/element/30/element</name>
    <title>POST /wd/hub/session/2e793399-38da-44ba-8747-961bfc1259e7/element/30/element</title>
    <attachments>
        <attachment title="Request" source="942970ed-13a6-480c-b377-32aaec46ce19-attachment.json" type="application/json" size="79"/>
    </attachments>

This leads to a java.lang.NumberFormatException when I attempt to generate a report.

jaysirju commented 7 years ago

This looks to happen when elementIdElement cannot find an element.

just-boris commented 7 years ago

Could you elaborate more on your problem? As far as we don't have any specific logic regarding this webdriver.io method, everything should be fine as it is. An example project, that reproduces the bug, would be helpful.

Also look this issue as a relevant: https://github.com/webdriverio/wdio-allure-reporter/issues/29

jaysirju commented 7 years ago

Running something like this on the google homepage using wdio-selenium-standalone-service will repro the issue.
let parent = browser.element('.gstl_0.sbib_a').value.ELEMENT; let callback = browser.elementIdElement(parent, '.sbib_d').value; let noCallback = browser.elementIdElement(parent, '.jibberish').value;

There are instances when step.end are not guaranteed to be called. My PR was a guard against such cases, because we can't even generate a report in those cases.

bwanamaker commented 7 years ago

I'm experiencing the same problem as @jaysirju.

Exception in thread "main" java.lang.NumberFormatException: For input string: ""

netmajor commented 7 years ago

I had today same issue when run tests on jenkins with mocha. I don't have that problem with jasmine, but after change it with mocha it exists :/ Because of this page with allure report is blank :(

just-boris commented 7 years ago

@netmajor if you have a reproducible example, please report it to allure-mocha repo. I am using Allure+Mocha setup on everyday basis but do not have such issue.