Test Case Examples ¶
The following test cases provide a basic example of their structure. Reference material about writing test cases and intaQt's languages is available in the intaQt manual.
Basic Mobile to Mobile Call¶
Example
1 2 3 4 5 6 7 8 9 10 11 12 | Feature: Basic call control Scenario: Phone call Given an Android phone as A And an Android phone as B When A dials the number B.number And within 20 seconds, B detects an incoming call from A.number And after 5 seconds, B answers the incoming call And within 5 seconds, A connects And after 10 seconds, A ends the call and, within 15 seconds, he and B disconnect Then verify !A.isConnected() Then verify !B.isConnected() |
Basic Fix to Fixed Call¶
Example
1 2 3 4 5 6 7 8 9 10 11 12 | Feature: Basic call control Scenario: Phone call Given a Snom phone as A And a Snom phone as B When A dials the number B.number And within 20 seconds, B detects an incoming call from A.number And after 5 seconds, B answers the incoming call And within 5 seconds, A connects And after 10 seconds, A ends the call and, within 15 seconds, he and B disconnect Then verify !A.isConnected() Then verify !B.isConnected() |
Sending and Receiving SMS¶
Example
1 2 3 4 5 6 7 8 9 10 11 | Feature: Basic SMS Control Scenario: Send and Receive SMS Given an Android phone as A And an Android phone as B When A composes a short message And A types "Hello, world" And within 30 seconds, A sends the short message to B.number And within 30 seconds, B receives a short message from A.number as sms Then verify sms.text == "Hello, world" Then verify sms.text.length() == 12 Then verify sms.originatingNumber == A.number |
Sending and Receiving USSD¶
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | Feature: USSD Scenario Outline: USSD Given an Android phone as A And an Android phone as B And A sends the following ussd "*100#" And within 20 seconds, A receives an ussd response as RESP1 And extract data1 with ussdFirstAccEnq from RESP1.text When A dials the number B.number And within 50 seconds, B detects an incoming call from A.number And after 2 seconds, B answers the incoming call And within 5 seconds, A connects And after <dur> seconds, A ends the call and, within 10 seconds, he and B disconnect And A sends the following ussd "*100#" And within 20 seconds, A receives an ussd response as RESP2 And extract data2 with ussdFirstAccEnq from RESP2.text Then the charge for <charge>(<dur>) is (data1.bal - data2.bal) Examples: | dur | charge | | 5 | VoiceCharge | | 10 | VoiceNational | |