skip to Main Content

When using XCTExpectFailure and run the test cases (Cmd + U) From "Show the Test navigator" it show’s grey cross (x) Other test cases shows in green Colour.

What is the Grey Indicator (x) In Test Cases ?

enter image description here

Do need to do anything here?

2

Answers


  1. Grey sign appears when test is run successfully and u can click on it to check the performance results in left bar

    Login or Signup to reply.
  2. Xcode has four indicators for the result of a test.

    Green Tick – The test passed

    screenshot of the green tick test passed indicator in Xcode

    Red Cross – The test failed

    screenshot of the red cross test failure indicator in Xcode2

    Gray Cross – The test failed, but it was expected to

    screenshot of the gray cross test failed as expected indicator in Xcode

    Xcode will show you this only if you already declared that a test was expected to fail using the XCTExpectFailure API.

    It’s Xcode way to tell you "hey this test failed but I’m not going to report it as a failure because you told me it was expected." This is useful to avoid blocking a build in CI if because when there’s an expected failure.

    I would encourage you to use XCTExpectFailure parsimoniously. It’s useful to avoid being blocked by a test failure that is unrelated to your work, but you should always take the time to go back and fix the failure, don’t leave the XCTExpectFailure call in your test suite for long.

    Gray Arrow – The test was skipped

    screenshot of the gray arrow test skipped indicator in Xcode

    Xcode will show this when a test was skipped using XCTSkipIf or XCTSkipUnless.

    Similarly to an expected failure, you don’t need to do anything about this because either you or someone else in your team added the API call to skip the test, meaning the behavior is expected. It’s useful to skip tests if they depend on certain runtime capabilities that might not be available on the device or Simulator executing a test run.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search