Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.
 

Automation integration with multiple assertion

Hi there,
I’m trying to add TestRail to legacy project. My goal is integrate it with the smallest amount of refactoring. And I have an issue with next pice of code.

Our stack is: Java, TestNG, Selenium. We are using Page model for tests with multiply assertions in test method. The code looks like:

@Test( groups = {"testproject", "regression"})
public void Test_page_loaded() {

	softAssert.assertEquals(pageTestPage.getTextOfElement(), "ExpectedText", "ErrorMessage");
	softAssert.assertEquals(pageTestPage.isSomeTextVisible(), false, "ErrorMessage");
	softAssert.assertEquals(pageTestPage.selectSomething(), true, "ErrorMessage");
	softAssert.assertEquals(pageTestPage.isAnElementVisible(), true, "ErrorMessage");

Test method has multiple assertion and each assertion in fact is one test case. Can you point me to solution, how to add test_case_id in such case to send it to TestRail API?