Overview
Here are described the steps to connect TestRail with karate integration tests.
...
To prepare running karate tests you need to setup TestRail before by creation Test Suite and Sections
- Open Test Suites & Cases by testRail top menu and choose + Add Test Suite button
- Set any name. (For our example it is "acquisitionsmod-orders")
- Select your Suite and Crate Sections for test runs by + Add Section (For our setup see image below)
...
- and create default section (mod-orders for our case)
Project Setup
- Copy all related files from package org.folio.testrail of acquisitions to your project path
Create jUnit test file and extend from AbstractTestRailIntegrationTest like FinanceApiTest
Code Block language java title FinanceApiTest Example public class FinanceApiTestOrdersApiTest extends AbstractTestRailIntegrationTest { // default module settings private static final String TEST_BASE_PATH = "classpath:domain/mod-orders/features/"; private static final String TEST_SUITE_NAME = public FinanceApiTest"mod-orders"; private static final long TEST_SECTION_ID = 3337L; private static final long TEST_SUITE_ID = 159L; public OrdersApiTest() { super(new TestRailIntegrationService( new TestRailIntegrationHelper(FINANCE_CONFIGURATIONTestModuleConfiguration(TEST_BASE_PATH, TEST_SUITE_NAME, TEST_SUITE_ID, TEST_SECTION_ID))); } @Test void budgetExpenseClassesdeleteOpenedOrderAndOrderLines() { runFeatureTest("budget-expense-classesdelete-opened-order-and-lines.feature"); } }
Add constructor with your own configuration see FinanceApiTest
Add test method that will run your feature file like budget-expense-classes via runFeatureTest method that located in order to FINANCE_CONFIGURATION see budgetExpenseClasses
- Add your suite Configuration see Integrate TestRail with Karate setup 50299221 section. For FinanceApiTest we use FINANCE_CONFIGURATION
Add two setup mehtods into your test file like financeApiTestBeforeAll (to setup tenant, users and setup data for module run) and financeApiTestAfterAll (to destroy tenant and all related data for module run)
Note: finance-junit.feature and destroy-data.feature should contain logic to setup and destory data for tenant.
...