MitocGroup / recink

REciNK - Rethink Continuous Integration for JavaScript Applications
https://www.npmjs.org/package/recink
Mozilla Public License 2.0
14 stars 5 forks source link

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

Open avozicov opened 6 years ago

avozicov commented 6 years ago

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:

VS

recink run e2e component

Screen Shot 2018-03-19 at 15.21.08.png

We have an unexpected results here:

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 commented 6 years ago

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

avozicov commented 6 years ago

@ddimitrioglo cool! thank you ;)