Test-Suite and Test-Case regex combinations for running a subset of tests.
A wide variety of selection of test cases is possible. An example usage of the regex is listed below.
Sr. | Regex Pattern | Outcome |
---|---|---|
1 | -s 'Id:[GET /accounts]' -r Id:'[.*]' | Execute all test cases from the GET /accounts test suite only. |
2 | -s 'Id:[GET /accounts]' -r Id:'[AIS_A001]' | Execute only the test case AIS_A001 from the GET /accounts test suite. |
3 | -s 'Id:[GET /accounts]' -r Id:'[00.]' | Execute all the tests from the GET /accounts test suite which have the testId among one of 000, 001, 002, 003, 004, 005, 006, 007, 008, 009. Test cases from other suites will not be attempted for execution. |
4 | -s 'Id:[GET /accounts,GET /accounts/{accountId}/direct-debits,GET /customers]' -r Id:'[.*]' | Execute all the test case from the 3 test-suites.
Test cases from other suites will not be attempted for execution. |
5 | -s 'Id:[GET /accounts/{accountId}/customer,GET /accounts/{accountId},GET /accounts,GET /accounts/{accountId}/balances,GET /accounts/{accountId}/beneficiaries,GET /customer,GET /accounts/{accountId}/direct-debits,GET /accounts/{accountId}/products,GET /accounts/{accountId}/scheduled-payments,GET /accounts/{accountId}/standing-orders,GET /accounts/{accountId}/transactions,POST /customers/action/cop-query,Combined Future Dated Payment with Fixed Defined Schedule,Combined Future Dated Payments with Fixed On Demand,Combined Future Dated Payments with Fixed Periodic Schedule,Combined Future Dated Payment with Variable Defined Schedule,Combined Future Dated Payments with Variable On Demand,Combined Future Dated Payments with Variable Periodic Schedule,Combined Single Instant Payments with Fixed Defined Schedule,Combined Single Instant Payments with Fixed On Demand,Combined Single Instant Payments with Fixed Periodic Schedule,Combined Single Instant Payments with Variable Defined Schedule,Combined Single Instant Payments with Variable On Demand,Combined Single Instant Payments with Variable Periodic Schedule,Payment consent and file payments,Fixed Defined Schedule,Fixed On Demand,Fixed Periodic Schedule,future-dated-payments,get-report-file-payments,header-validations-tests,International Payments,Payment Consent Refund,single-instant-payments,Variable Defined Schedule,Variable On Demand,Variable Periodic Schedule,Consent/action/augment post request,Consent/action/validate post request,Insurance]' -r Id:'[.*]' | Run all the test cases in all the test suites. |
Not providing regex flag '-r' will execute all the test cases for given suite Ids.
There are two keys which can be used to target specific test cases.
Id : - Id belongs to test Id , any pattern matching testId will get executed. For exclusion of any test case you can use '!' before test case id
Example regex values are :
‘Id:[AIS_A001]'
‘Id:[!AIS_A001]' → to exclude test case Id AIS_A001
'Id:[AIS_A001,AIS_A002]'
'Id:[AIS_A.*]'
'Id:[AIS_A.*,AIS_B.*]'
'Id:[AIS_A009,AIS_A001,AIS_A005]'
keyword (case insensitive): ‘keyword’ is any keyword which will match with string pattern in tests name. For exclusion of any test case you can use '!' before test case name.
Example regex values are :
‘keyword:[happy]'
'keyword:[!happy, header]' → here we are taking test cases which are negative (as happy have ‘!' before it) and which have word ‘header’ in it. Similarly we can exclude header just by adding '!’ before it. e.g, 'keyword:[!happy, !header]'
We can use keyword and Id in combination.
'Id:[AIS_A.*], keyword: [!happy, header]'
'keyword: [retail]' → to target test cases having retail in there tests name.