Ce trebuie să verificați în testarea api

Exemple de cod

1
0

cum faceți testarea api pozitivă

    How I do positive testing in api, 
	- I send valid path and query parameters, 
	- valid headers, 
	- valid request body to valid url and verify that 
	- response status code is correct and 
	- response body is as expected
    
How I do negative testing in api,
	- I send invalid request parameters
	- or invalid headers
	- or invalid request json body and verify 
    that response status code is not 200 
	- and response body contains error message 
    (for example there are 100 employees numbered
    from 1 to 100 I send 101 as a parameter and I
    should be able see 404 Not Found 
    The requested resource was not found.)  
0
0

ce trebuie să verificați în testarea api

We will verify the accuracy of the data
Will see the HTTP status code
We will see the response time
Error codes in case API returns any error
Authorization would be check
Non-Functional testing such as 
performance testing, security testing.
0
0

ce testați în API-ul de răspuns

Basicall we are checking response body
to verify if request matches with response.
In the response we are verifying
(body, status code, header, response time,
 test structure of json against the given jsonSchema)
 
 
If file not under resources: 
File schemaFile = new File("src/test/resources/postSuccessResponseSchema.json");

     given()
        .spec(adminReqSpec)
        .contentType(ContentType.JSON)
        .body(abcUtil.getRandomHeroPOJO_Payload()).
     when()
        .post("/HEROS").
     then()
        .body(matchesJsonSchema( schemaFile )  ) 
        
        
If schema file under resources:
  given()
      .spec(adminReqSpec)
      .queryParam("nameContains","a")
      .queryParam("gender","Female").
  when()
      .get("/abc/search").
 then()
 	  .time( lessThan(2000L));	
      .body(matchesJsonSchemaInClasspath("searchSpartanSchema.json") )
-1
0

ce să testați în api

Basicall we are checking response body
to verify if request matches with response.
After that we are writing SQL query
to double check if database matches.
We can say happy path if all pass

În alte limbi

Această pagină este în alte limbi

Русский
..................................................................................................................
English
..................................................................................................................
Italiano
..................................................................................................................
Polski
..................................................................................................................
한국어
..................................................................................................................
हिन्दी
..................................................................................................................
Français
..................................................................................................................
Türk
..................................................................................................................
Česk
..................................................................................................................
Português
..................................................................................................................
ไทย
..................................................................................................................
中文
..................................................................................................................
Español
..................................................................................................................
Slovenský
..................................................................................................................
Балгарскі
..................................................................................................................
Íslensk
..................................................................................................................