Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin reports Test Passed if before hook fails #24

Open
igerasimov23 opened this issue Oct 24, 2018 · 7 comments · Fixed by #25
Open

Plugin reports Test Passed if before hook fails #24

igerasimov23 opened this issue Oct 24, 2018 · 7 comments · Fixed by #25
Labels
bug Something isn't working enhancement New feature or request wdiov4

Comments

@igerasimov23
Copy link

The problem

If test fails in Before hook plugin reports to RP as test passed

Environment

  • WebdriverIO version: 4.11
  • wdio-reportportal-version version: 0.0.15
  • Node.js version: 8.10
  • WDIO Testrunner and version(mocha\cucumber\jasmine):
  • Additional wdio packages used (if applicable):

Code To Reproduce Issue [ Good To Have ]

describe('test', function () {

  before( function () {
    browser.url('some url');
    assert.isTrue(false, 'test failed')
  })
  
  it('Verify test 1', () => {
    browser.url('some url');
    assert.isTrue(true, 'test passed')
  })
});
@BorisOsipov
Copy link
Owner

BorisOsipov commented Oct 24, 2018

Hi @igerasimov23,

I think there is no tests were reported if hook failed.
Do you mean suite reported as passed? In fact it always reported as passed

@igerasimov23
Copy link
Author

igerasimov23 commented Oct 24, 2018

you right there are no tests reported if Before hook fails. Is there way to fail suite if before hook fails?
screen shot 2018-10-24 at 2 06 09 pm
screen shot 2018-10-24 at 2 05 49 pm
screen shot 2018-10-24 at 2 09 48 pm

As I looked at API of reportportal we can fail suite as well

@BorisOsipov
Copy link
Owner

Is there way to fail suite if before hook fails?
As I looked at API of reportportal we can fail suite as well

yes, I will see

@BorisOsipov
Copy link
Owner

Fixed in 0.0.16

@igerasimov23
Copy link
Author

igerasimov23 commented Nov 1, 2018

I tested v 0.0.16 and have one question, you don't want to send failure message to suite? API supports it and your plugin can easily do it. Now it seems a little bit odd in RP logs: it has all logs of execution of before hook but not actual failure message. Any thoughts?

@BorisOsipov
Copy link
Owner

you don't want to send failure message to suite? API supports it and your plugin can easily do it.

I would like, but it is not easy. I will see more.

@BorisOsipov BorisOsipov reopened this Nov 1, 2018
@BorisOsipov BorisOsipov added the enhancement New feature or request label Nov 1, 2018
@BorisOsipov
Copy link
Owner

@igerasimov23 I've checked this. The problems is wdio reporters by design doesn't report before\after hooks as I now(let me know If you meet reporters that support it). So I don't have access in reporter to error stack trace from before hook.

I will go deeper and try to find some ways to handle this case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request wdiov4
Projects
None yet
2 participants