Code Monkey home page Code Monkey logo

Comments (5)

BorisOsipov avatar BorisOsipov commented on June 23, 2024

@pfyod

Failed assertions should always report test as failed.

Sounds good. We need more details. How is the reporter supposed to guess that this stacktrace is an assert error and not a regular error?
Keep in mind that your solution should work with any assert library, even if we don't have invented it yet 😊

from webdriverio.

pfyod avatar pfyod commented on June 23, 2024

@BorisOsipov I guess the problem is indeed hard to solve if you want to support any third party assert library (maybe some sort of extension point that allows the user to override getTestStatus?).

My point is that it should probably work in an "obvious" manner for first-party library combination of expect-webdriverio + @wdio/allure-reporter, or be somehow mentioned in docs.

from webdriverio.

wdio-bot avatar wdio-bot commented on June 23, 2024

Thanks for reporting!

We greatly appreciate any contributions that help resolve the bug. While we understand that active contributors have their own priorities, we kindly request your assistance if you rely on this bug being fixed. We encourage you to take a look at our contribution guidelines or join our friendly Discord development server, where you can ask any questions you may have. Thank you for your support, and cheers!

from webdriverio.

BorisOsipov avatar BorisOsipov commented on June 23, 2024

Probably the best solution is to port https://github.com/allure-framework/allure-js/blob/dc06dbc09c64a256a573a43dbb7cedf15f27fb2b/packages/allure-js-commons/src/sdk/utils.ts#L5 to reporter.

from webdriverio.

pfyod avatar pfyod commented on June 23, 2024

@BorisOsipov: I think that there's actually some sort of bug (or convention that does not work that great in this scenario) somewhere. Only the first line of error message ends up inside test.error.message that gets passed to getTestStatus (the rest is inside test.error.stack only), and since custom message gets prepended to the original expect result with a newline, the actual whole message never gets inspected by getTestStatus. Would get "solved" if one reorders if (test.error.message) { and if (test.error.stack) {, but I do not know further implications of that.

from webdriverio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.