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

Wrong behavior for failed assertions in recink-e2e component #161

Open
avozicov opened this issue Mar 19, 2018 · 2 comments
Open

Wrong behavior for failed assertions in recink-e2e component #161

avozicov opened this issue Mar 19, 2018 · 2 comments
Labels

Comments

@avozicov
Copy link
Contributor

We have an unexpected behavior in our recink-e2e component for the case when assertion fails.
Issue can be reproduced by passing an non-existent dom element to the assertion class.

Bellow code can be used to debug and compare the behavior for recink-e2e component vs native testcafe assertion

class Assertion {
  constructor() { }
  async requiredArguments(selector, data, dir, msg) {
    console.log('BEFORE try');
    try {
      console.log('START try');
      const element = await Selector(selector, isVisible);
      console.log('BEFORE try await');
      await t
        .hover(element)
        .expect(element.innerText)
        .eql(data)
        .hover(element)
        .takeScreenshot(`${dir}/${data}`);
        console.log('AFTER try await')
    } catch (e) {
      console.log('CATCH ERROR');
      throw new Error(`${msg}`)
    }
  }
}

native testcafe runner

Screen Shot 2018-03-19 at 15.25.05.png
We have all the expected steps and results here:

  • browser is disconnected and closed when assertion failed
  • Throw Error step if dom element was not found on the page
  • custom error message is displayed

VS

recink run e2e component

Screen Shot 2018-03-19 at 15.21.08.png

We have an unexpected results here:

  • browser is not disconnected
  • Throw Error step was not executed
  • custom error message is not displayed

It is expected to extend all the native testcafe behavior for the assertions and recink e2e component should include all the debug and output information for the cases when test fails as well as closing browser connection in case of errors

Please let me know if any details are required ;)

@ddimitrioglo
Copy link
Contributor

@avozicov I'll check it if it's related to e2e component or recink itself

@avozicov
Copy link
Contributor Author

@ddimitrioglo cool! thank you ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants