When testing an interface, assertions are sometimes made to the interface, and the apipost provides assertions later in the execution script

Apt. Assert (‘ response. Raw. The responseText = = “test”);

Apt. Assert (‘ response. Raw. Status = = 200 ‘);

Apt. Assert (‘ response. Raw. Type = = “json”);

Apt. Assert (‘ response. Raw. ResponseTime > = 100 ‘);

Apt. Assert (‘ response. Json. Errcode = = 1 “);

Apt. Assert (‘ response. Json. Errcode! = 1 “);

Apt. Assert (‘ response. Json. Errcode > = 1 “);

Apt. Assert (‘ response. Json. Errcode = = null “);

Apt. Assert (‘ response. Json. Errcode! = null “);

Apt. Assert (. ‘the response headers (” server “) = = “nginx” “);

Apt. Assert (‘ response. Headers [” content – encoding “] = = ‘” gzip “);

Apipost also supports custom assertions, where we can customize a value in the response as an assertion

The value of message is used as an assertion

You can also customize other values before setting data to assert