Forum Discussion

indraniria's avatar
indraniria
Contributor
2 years ago

How to run specific test case in particular environment?

I have 2 environments setup : Dev & QA.

There are certain test cases which are intended for Dev env only. How I avoid running those when I select QA environment?

or when I select Dev env, only dev environment specific test cases run?

    • ignaciodea's avatar
      ignaciodea
      Occasional Contributor

      I'm starting experimenting with this. We use Azure Repos and receive error 'failed to create tag. Tag on repository without Head currently not supported'. Any idea what the reasons is?

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Tags?  Never heard of them!  I'm going to try and find those.

  • nmrao's avatar
    nmrao
    Champion Level 3

    Another simplest would be to use Tags feature.

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    You have a few ways you can do this.

     

    Use Test Suites : You could arrange your tests into two different test suites.  One suite called 'Dev' and the other called 'QA'.  This doesn't stop you running the Dev test suite against the QA environment though!  The other downside is that you might actually have tests you want to run against both environments.  It's not ideal to have two copies of the same test, so maybe a third test suite called 'All Environments'?

     

    At a test case level, you could also use a Groovy script to check the env and then decide whether to run or skip.

     

    I'd be interested to hear other suggestions.