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

Html report is reporting wrong number of test cases #351

Open
jainhitesh3 opened this issue Feb 28, 2019 · 2 comments
Open

Html report is reporting wrong number of test cases #351

jainhitesh3 opened this issue Feb 28, 2019 · 2 comments

Comments

@jainhitesh3
Copy link

I'm trying to get HTML report using xcpretty for my iOS app tests (using Earlgrey framework).
Whenever the test cases fails it gives exception and fails the test case. The xcpretty report takes failure as 1 count and exception as another count, which doubles the number of failed test cases for me.

eg :

1 ===> Exception: NoMatchingElementException
func swipeToProducts() { EarlGrey.selectElement(with: grey_text(FileReader_UITests.objFileReader.dict_Object["scrollLabel"]!)).perform(grey_swipeSlowInDirection(GREYDirection.up)) }

2 ===> failed: caught "EarlGreyInternalTestInterruptException", "Immediately halt execution of testcase"
@discardableResult public func perform(_ action: GREYAction!) -> Self { return self.__perform(action) }

Here both of these failures are related (since element was not found perform operation failed) but xcpretty is taking them as 2 separate test case thus resulting in doubling the failed test case count.

In commandline it showed exact no of test case :
"Executed 10 tests, with 16 failures (16 unexpected) in 82.666 (82.782) seconds"

but in html report it is showing 18 test cases (8*2 fail + 2 pass)

@silverhammermba
Copy link

silverhammermba commented Mar 5, 2019

Try https://github.com/xcpretty/trainer instead. It parses the the test plist report rather than the test output, so it should be more accurate.

@hiteshjain4
Copy link

@silverhammermba : Right now my plist file has 2 failures for single test case, so will that be handled with trainer ? And also my requirement is for HTML file, but as per the README.md document it seems like it doesn't support HTML output.

Anyways i have found a temporary solution for this problem ( #352 ) and it seems to be working absolutely fine for me.

Thanks for the suggestion though, may be if my requirement changes than i will try "trainer".

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

No branches or pull requests

3 participants