0

We use Selenium webdriver + SpecFlow for testing our Web application.

For some functionality, everything is clear. But imagine the situation: some questions arrive to Web user from external system he may answer. The test should "test" if the user can see those questions in appropriate view and successfully submit some or all answers. If there are no questions for the given user - section "New questions" is not displayed on the Web site.

So I am stuck with the following: how to make the situation "There is nothing to test" NOT a failure or success, but to just stop the test and return "ignore" status? I may add, that there might be tons of tests for whole system and it looks very difficult to sort them manually somehow (marking as "ignore" in advance).

Mael
  • 2,305
  • 1
  • 13
  • 26
Alexander
  • 101
  • 3
  • The test should be setup so that the "new answers" does show – Ewan Feb 21 '18 at 15:38
  • Unfortunately, the questions are sent from external system - we cannot affect this. OK, so it's all sad - the test cannot be made as "smart" as i expected... – Alexander Feb 21 '18 at 16:49
  • 2
    mock the external system – Ewan Feb 21 '18 at 16:51
  • Agree, theoretically - could be. But in our case it's just another pretty big layer of complexity: the systems are not ready to mocking at all and no time will be allocated to this... So seems like this is the case where automatic web UI testing will give up in favor of manual testing... :) – Alexander Feb 21 '18 at 17:25
  • Test for "New questions" not being displayed. https://stackoverflow.com/questions/12270092 – Robert Harvey Feb 21 '18 at 18:56

2 Answers2

2

The preferred situation is that you mock the external system and then create two tests: one to verify the behavior when there are questions to be shown and another to verify the behavior when there are no questions.

If mocking the external system is not possible, then you might compromise and create one testcase that tests both scenarios. Just make it sure that it is clear what scenario was active when the test fails.

Bart van Ingen Schenau
  • 71,712
  • 20
  • 110
  • 179
0

Assert.Inconclusive is what I need.

Alexander
  • 101
  • 3