BaymaxSky / postman-api

0 stars 0 forks source link

Add test case to test execution #5

Open Jacobvu84 opened 1 year ago

Jacobvu84 commented 1 year ago
        TestOutcome testOutcome = getLastOutcome();
        String testId = getTestCaseId(testOutcome);
        JSONArray testcases = new JSONArray();
        testcases.add(testId);

        JSONObject addTestCase = new JSONObject()
                .element("add",testcases);

        String testExecId = getTestExecution();

        SerenityRest.given()
                .header("Authorization", JIRA_TOKEN)
                .contentType(ContentType.JSON)
                .pathParam("testExecId", testExecId)
                .body(addTestCase)
                .post(JIRA_BASE+"/rest/raven/1.0/api/testexec/{testExecId}/test");