Qytera-Gmbh / QTAF

QTAF is a Java test framework based on TestNG and offers easy setup of Selenium and fast extensibility.
https://qytera-gmbh.github.io
MIT License
10 stars 0 forks source link

Assertions statusCodeIsNotXXX() not working #255

Closed ValeriusSchmidt closed 7 months ago

ValeriusSchmidt commented 8 months ago
@Test
public void test3() {
  String body1 = "{\"name\": \"morpheus\",\"job\": \"leader\"}";
  apiTest(
    this,
    List.of(
      baseUri("https://reqres.in"),
      body(body1)
    ),
    postRequest("/api/users"),
    List.of(statusCodeIsNot3xx()) 
  );
}

When trying to run a test with a statusCodeIsNotXXX() Assertion the test will always fail. The Report shows the following entries:

"assertions": [
  {
    "type": "ASSERT_EQUALS",
    "condition": false,
    "actual": "UNKNOWN_ACTUAL_VALUE_forStatusCodeAssertion", 
    "expected": "not 3xx",
    "status": "UNDEFINED", 
    "uuid": "e804d2ba-0c30-4802-ac20-8117f3714bdf",
    "assertions": [],
    "level": "INFO",
    "message": "statusCodeIsNot3xx assertion",
    "featureId": "",
    "abstractScenarioId": "",
    "scenarioId": ""
  }
],
OliverHoenig commented 7 months ago

Thank you for reporting this issue. I will try to reproduce the error and investigate why this behaviour occurs.

OliverHoenig commented 7 months ago

I could not reproduce the error. As the API testing feature is currently being prepared for release, intensive work has been done on it over the last few days. It is likely that the bug has already been fixed. If in your opinion the current version still creates an unexpected LogMessage, please report this in a new issue. I will now close this issue. Thanks for your help