Introduction
This section contains detailed instructions for writing and executing tests for the XGP Test Environment.
Test scripts are stored as Scenarios within projects, which are essentially collections of scenarios. Scenarios can be saved as Executions individually or combined with other scenarios where they can later be run together successively. The progress of all Execution Runs are recorded in detail for future analysis. Any File Assets, such as those required by test scripts, can be uploaded to the platform after which the URL of the file can be used within the test script to access that file.
Writing a Test Scenario
Once the test scenario has been created from the portal, using our in-built code editor you can write test scenarios according to your test flow. The following are some of the common test scenarios used.
Making a Voice call
Example Scenario - Caller A makes a Call to Receiver B. B answers the call. Caller A checks if the call has been answered. Caller A hangs up.
Caller A Script - Using VoLTE & CS (Python)
import sys
import os
from xgdriver.module_driver import ModuleDriver
import sequential_runner
ModuleDriver.set_scenario_name('Caller A')
xg = ModuleDriver(sys.argv[1])
msisdn = os.environ.get('MSISDN')
sequential_runner.execute("XG-041-0312","m1_s1","Telcom CS and VoLTE ","Receiver B")
xg.dial(str(msisdn))
xg.check_call_active()
xg.hang_call()
Receiver B Script - Using VoLTE & CS (Python)
import sys
import os
from xgdriver.module_driver import ModuleDriver
ModuleDriver.set_scenario_name('Receiver B')
xg = ModuleDriver(sys.argv[1])
xg.answer_call()
Caller A Script - Using VoWiFi (Gherkin)
Scenario: Caller A
Given I execute scenario on "XG-069-0420" with "m1_s1" "Telcom VoWiFi" "Receiver B"
Then I call the number
Then I check that call has been answered
Then I cut the call
Given I prep RF radio
Then I revert settings Using VoWiFi
Then I check that Using VoWiFi is disabled
Receiver B Script - Using VoWiFi (Gherkin)
Scenario: Receiver B
Then I check for receiving call
Then I answer call
Then I check that call has been cut
Given I prep RF radio
Then I revert settings VoWifi
Then I check that VoWiFi is disabled
Sending an SMS
Example scenario: Sender A sends a SMS to Receiver B. B checks for an incoming SMS for a given period of time. B reads the recieved SMS.
Sender A Script - Using VoLTE & CS (Python)
import sys
import os
from xgdriver.module_driver import ModuleDriver
import sequential_runner
ModuleDriver.set_scenario_name('SMS Sender A')
xg = ModuleDriver(sys.argv[1])
msisdn = os.environ.get('MSISDN')
msg = os.environ.get('MSG')
sequential_runner.execute("XG-041-0312","m1_s1","Telcom CS and VoLTE ","SMS Receiver B")
xg.send_sms(str(msisdn),str(msg))
Receiver B Script - Using VoLTE & CS (Python)
import sys
import os
from xgdriver.module_driver import ModuleDriver
ModuleDriver.set_scenario_name('SMS Receiver B')
xg = ModuleDriver(sys.argv[1])
xg.wait_for_sms()
Sender A Script - Using VoWiFi (Gherkin)
Scenario: SMS Sender A
Given I execute scenario on "XG-069-0420" with "m1_s1" "Telcom VoWiFi" "SMS Receiver B"
Then I send sms to number
Then I click send button
Then I check that SMS has been sent
Given I prep RF radio
Then I revert settings VoWifi
Then I check that VoWiFi is disabled
Receiver B Script - Using VoWiFi (Gherkin)
Scenario: Receiver B
Given I have opened notifications
Then I check for receiving SMS
Then I click on the SMS
Given I prep RF radio
Then I revert settings VoWifi
Then I check that VoWiFi is disabled
Checking balance via USSD
Example scenario: The user wants to check their remaining balance in their account.
Using VoLTE & CS (Via Python)
import sys
import os
from xgdriver.module_driver import ModuleDriver
import sequential_runner
ModuleDriver.set_scenario_name(' User A USSD Balance Check')
xg = ModuleDriver(sys.argv[1])
ussd_balance = os.environ.get('USSD_BALANCE')
xg.run_ussd(str(ussd_balance))
xg.read_notification()
xg.ussd_close()
Using VoWiFi (Via Gherkin)
N/a: USSD Commands are not supported via Using VoWiFi
Check the current network attach status
Example scenario: Check the current operator and the network status in-terms of Access Technology ( GSM, UTRAN, E-UTRAN).
Using VoLTE & CS (Via Python)
import sys
import os
from xgdriver.module_driver import ModuleDriver
import sequential_runner
ModuleDriver.set_scenario_name('Check the current network attach status')
xg = ModuleDriver(sys.argv[1])
xg.check_operator()
xg.check_network_status()
Using VoWiFi (Via Gherkin)
N/a: Network attach status checking is not supported via Using VoWiFi
Check Serving cell information
Example scenario: Check cellular information such as IMSI of the SIM, signal strength, Check if a sim is inserted.
Using VoLTE & CS (Via Python)
import sys
import os
from xgdriver.module_driver import ModuleDriver
import sequential_runner
ModuleDriver.set_scenario_name('Check Serving cell information')
xg = ModuleDriver(sys.argv[1])
xg.get_imsi()
xg.get_signal_strength()
xg.check_sim()
Using VoWiFi (Via Gherkin)
N/a: Serving cell information checking is not supported via Using VoWiFi
NEXT > What are Test Scenarios