Disable test cases depending on environment
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Disable test cases depending on environment
In my project I have several test suites and several test cases in the each test suite. Quite normal.
All test cases have the same test steps, the differences are the payload. Something like this:
- generate access token
- Initiate
- signing
- execute
- get status
All these test steps are valid for our test environment. But for our sand box, which is more simple, we just need the following test steps:
- initiate
- execute
- get status
To be able to use the same test cases in both environments I would like to disable two test steps when executing my test cases against our sand box.
I have tried several methods but failed.
The optimal situation would be that all those test steps get disabled in all test cases when I change to the sandbox environment and get enabled when I change back to our test environment.
Could that be done on "Function Test-level", using SetUp Script/TearDown Script or using the Event Handler or are there any other methods for this?
Someone that knows?
Solved! Go to Solution.
- Labels:
-
Function Tests
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @TonnyLi ,
In your project setup script, you could try something like this:
//given your environment config name is = "sandbox"
project.testSuiteList.each { suite ->
suite.testCaseList.each { kase ->
kase.testStepList.each { step ->
if (step.name == "generate access token") {
if (project.activeEnvironment.name.contains("sandbox")){
step.setDisabled(true)
}else{
step.setDisabled(false)
}
}
}
}
}
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
WoW! It worked! Thanks alot JoostDG!
/Tonny
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There is another way to achieve the same provided if you tag the tests using the feature "Tag" (or Tags)
https://support.smartbear.com/readyapi/docs/functional/ui/project.html#tags-panel
And one can run the tests linked to specific Tag.
Regards,
Rao.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hm...no, not really. It is some test steps I would like to disable in every test case. Not test cases.
