3 title: Binding Test Functions
5 https://git.automotivelinux.org/apps/app-afb-test/plain/docs/Reference/0_BindingTestFunctions.md?h=master
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/app-afb-test-developer-guides-api-services-book.yml -->
10 # Binding Test functions
12 * **_AFT.testVerbStatusSuccess(testName, api, verb, args, setUp, tearDown)**
14 Simply test that the call of a verb successfully returns.
16 *setUp* and *tearDown* are functions that can be added to your context,
17 it works just like **_AFT.beforeEach()** and **_AFT.afterEach()**,
18 *setUp* will be ran before your *testFunction* and **_AFT.beforeEach()**
19 (if set) functions, *tearDown* will be ran after your *testFunction* and
20 **_AFT.afterEach()** (if set) functions.
22 * **_AFT.testVerbStatusError(testName, api, verb, args, setUp, tearDown)**
24 The inverse than above.
26 *setUp* and *tearDown* are functions that can be added to your context,
27 it works just like **_AFT.beforeEach()** and **_AFT.afterEach()**,
28 *setUp* will be ran before your *testFunction* and **_AFT.beforeEach()**
29 (if set) functions, *tearDown* will be ran after your *testFunction* and
30 **_AFT.afterEach()** (if set) functions.
32 * **_AFT.testVerbStatusSkipped(testName, api, verb, args, setUp, tearDown, msg)**
36 *msg* is a message to indicate the reason why the test is skip,
37 it must contain your test name if you want to parse the output.
38 *setUp* and *tearDown* are functions that can be added to your context,
39 it works just like **_AFT.beforeEach()** and **_AFT.afterEach()**,
40 *setUp* will be ran before your *testFunction* and **_AFT.beforeEach()**
41 (if set) functions, *tearDown* will be ran after your *testFunction* and
42 **_AFT.afterEach()** (if set) functions.
44 * **_AFT.testVerbResponseEquals(testName, api, verb, args, expectedResponse, setUp, tearDown)**
46 Test that the call of a verb successfully returns and that verb's response
47 is equals to the *expectedResponse*.
49 *setUp* and *tearDown* are functions that can be added to your context,
50 it works just like **_AFT.beforeEach()** and **_AFT.afterEach()**, *setUp*
51 will be ran before your *testFunction* and **_AFT.beforeEach()** (if set)
52 functions, *tearDown* will be ran after your *testFunction* and
53 **_AFT.afterEach()** (if set) functions.
55 * **_AFT.testVerbResponseEqualsError(testName, api, verb, args, expectedResponse, setUp, tearDown)**
57 The inverse than above.
59 *setUp* and *tearDown* are functions that can be added to your context, it works
60 just like **_AFT.beforeEach()** and **_AFT.afterEach()**, *setUp* will be ran
61 before your *testFunction* and **_AFT.beforeEach()** (if set) functions,
62 *tearDown* will be ran after your *testFunction* and **_AFT.afterEach()** (if
65 * **_AFT.testVerbCb(testName, api, verb, args, expectedResponse, callback, setUp, tearDown)**
67 Test the call of a verb with a custom callback. From this callback you
68 will need to make some assertions on what you need (verb JSON return object
71 If you don't need to test the response simply specify an empty LUA table.
73 *setUp* and *tearDown* are functions that can be added to your context, it works
74 just like **_AFT.beforeEach()** and **_AFT.afterEach()**, *setUp* will be ran
75 before your *testFunction* and **_AFT.beforeEach()** (if set) functions,
76 *tearDown* will be ran after your *testFunction* and **_AFT.afterEach()** (if
79 * **_AFT.testVerbCbError(testName, api, verb, args, expectedResponse, callback, setUp, tearDown)**
81 Should return success on failure.
83 *setUp* and *tearDown* are functions that can be added to your context, it works
84 just like **_AFT.beforeEach()** and **_AFT.afterEach()**, *setUp* will be ran
85 before your *testFunction* and **_AFT.beforeEach()** (if set) functions,
86 *tearDown* will be ran after your *testFunction* and **_AFT.afterEach()** (if
89 * **_AFT.testEvtReceived(testName, eventName, timeout, setUp, tearDown)**
91 Prior to be able to check that an event has been received, you have to
92 register the event with the test framework using **_AFT.addEventToMonitor**
95 Check if an event has been correctly received in time (timeout in µs). An event
96 name use the application framework naming scheme: **api/event_name**.
98 * **_AFT.testEvtNotReceived(testName, eventName, timeout, setUp, tearDown)**
100 Prior to be able to check that an event has not been received, you have to
101 register the event with the test framework using **_AFT.addEventToMonitor**
104 Check if an event has not been correctly received in time (timeout in µs). An
105 event name use the application framework naming scheme: **api/event_name**.
107 * **_AFT.testGrpEvtReceived(testName, eventGrp, timeout, setUp, tearDown)**
109 Prior to be able to check that a group of event (a table of event) has been
110 received, you have to register the event with the test framework using
111 **_AFT.addEventToMonitor** function.
113 The table has to have this format:
115 eventGrp = {["api/event_name_1"]=1,["api/event_name_2"]=2,["api/event_name_3"]=5}
117 As you can see, in the table, event names are table keys and the value stored are
118 the number of time that the events have to be received.
120 Check if events has been correctly received in time (timeout in µs). An
121 event name use the application framework naming scheme: **api/event_name**.