Patch Description
cover Patch Description
Phonesim is most of time a convenient way to test oFono. For example, it can be used to test MO call, as well as MT call.
And talking about test area, test automation is quite important regarding to both efficiency and effectiveness. In the test of MO call, scripts can be used to interact with oFono via D-Bus to make test automation possible. However, in the test of MT call, currently we have to enter the caller number and click some button in Phonesim GUI to simulate an incoming call, which makes test automation unrealistic. This patch is to enable Qt script (JavaScript following ECMAScript spec) in Phonesim, so that we can have some script control its GUI conveniently, and satisfy the test automation.
With this patch, Phonesim can work in the following way:
1. It observes some specific directory (/tmp/scripts) to see if there is some test scripts added.
2. Once Phonesim finds a new test script is added, it will parse and execute the script.
3. You may add more and more test scripts to the specific directory with your test goes on.
Below are two examples:
# call.js (Simulate a MT call) tabRegistration.gbIncomingCall.leCaller.text = "12345"; tabRegistration.gbIncomingCall.pbIncomingCall.click();
This script will help you enter the caller number as "12345", and click "Call" button in Phonesim GUI. Once this script is copied to the observed directory, oFono will get an incoming call.
# sms.js (Simulate a MT sms)
tabSMS.gbMessage1.leMessageSender.text = "Yang";
tabSMS.gbMessage1.leSMSClass.text = "1";
tabSMS.gbMessage1.teSMSText.setPlainText("This message is sent automatically from Phonesim");
tabSMS.gbMessage1.pbSendSMSMessage.click();This script will help you fill the sms sender, class, text, and then click the "Send Message" button for you. Once it's added into the specific directory, oFono will get an incoming message.
Don't know if this is the best way to make Phonesim support test automation. So comments are welcome:)
-----
Yang Gu (1):
Enable Qt Script
configure.ac | 2 +- src/control.cpp | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletions(-)
PATCH 1/1 Enable Qt Script
From: Yang Gu <[email protected]>
--- configure.ac | 2 +- src/control.cpp | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletions(-)
configure.ac +1 -1
@@ -21,7 +21,7 @@ AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization], fi ]) -PKG_CHECK_MODULES(QT, QtCore QtGui QtXml QtNetwork, dummy=yes, +PKG_CHECK_MODULES(QT, QtCore QtGui QtXml QtNetwork QtScript, dummy=yes, AC_MSG_ERROR(Qt is required)) AC_SUBST(QT_CFLAGS) AC_SUBST(QT_LIBS)
src/control.cpp +60 -0
87 lines not on this page · raw message
Signature · 1 line
1.7.0.4
Zhang
Hi,
Quoted 36 lines · Yang Gu
Phonesim is most of time a convenient way to test oFono. For example, it can be used to test MO call, as well as MT call.
And talking about test area, test automation is quite important regarding to both efficiency and effectiveness. In the test of MO call, scripts can be used to interact with oFono via D-Bus to make test automation possible. However, in the test of MT call, currently we have to enter the caller number and click some button in Phonesim GUI to simulate an incoming call, which makes test automation unrealistic. This patch is to enable Qt script (JavaScript following ECMAScript spec) in Phonesim, so that we can have some script control its GUI conveniently, and satisfy the test automation.With this patch, Phonesim can work in the following way:
1. It observes some specific directory (/tmp/scripts) to see if there is some test scripts added.
2. Once Phonesim finds a new test script is added, it will parse and execute the script.
3. You may add more and more test scripts to the specific directory with your test goes on.Below are two examples:
# call.js (Simulate a MT call) tabRegistration.gbIncomingCall.leCaller.text = "12345"; tabRegistration.gbIncomingCall.pbIncomingCall.click();This script will help you enter the caller number as "12345", and click "Call" button in Phonesim GUI. Once this script is copied to the observed directory, oFono will get an incoming call.
# sms.js (Simulate a MT sms) tabSMS.gbMessage1.leMessageSender.text = "Yang"; tabSMS.gbMessage1.leSMSClass.text = "1"; tabSMS.gbMessage1.teSMSText.setPlainText("This message is sent automatically from Phonesim"); tabSMS.gbMessage1.pbSendSMSMessage.click();
Quoted 6 lines
This script will help you fill the sms sender, class, text, and then click the "Send Message" button for you. Once it's added into the specific directory, oFono will get an incoming message.
Don't know if this is the best way to make Phonesim support test automation. So comments are welcome:)
It's awesome! I tried the patch and simply copy call.js to /tmp/scripts and it makes a call to oFono like a magic. ;-)
Quoted 6 lines
-----
Yang Gu (1):
Enable Qt Scriptconfigure.ac | 2 +- src/control.cpp | 60
Quoted 7 lines
+++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files
changed, 61 insertions(+), 1 deletions(-)_______________________________________________
ofono mailing list
ofono(a)ofono.org
http://lists.ofono.org/listinfo/ofono
Regards,
Zhenhua
Hi Yang,
Quoted 4 lines · Yang Gu
Phonesim is most of time a convenient way to test oFono. For example, it can be used to test MO call, as well as MT call.
And talking about test area, test automation is quite important regarding to both efficiency and effectiveness. In the test of MO call, scripts can be used to interact with oFono via D-Bus to make test automation possible. However, in the test of MT call, currently we have to enter the caller number and click some button in Phonesim GUI to simulate an incoming call, which makes test automation unrealistic. This patch is to enable Qt script (JavaScript following ECMAScript spec) in Phonesim, so that we can have some script control its GUI conveniently, and satisfy the test automation.
I like this idea
Quoted 5 lines
With this patch, Phonesim can work in the following way:
1. It observes some specific directory (/tmp/scripts) to see if there is some test scripts added.
2. Once Phonesim finds a new test script is added, it will parse and execute the script.
3. You may add more and more test scripts to the specific directory with your test goes on.
However, using cp to run scripts seems a bit un-intuitive. Perhaps a simple D-Bus interface which can run the scripts would be better?
E.g. something like
org.ofono.Phonesim:
string Run(string script)
where the script contains the script to run and the return value might return whatever is printed from the script.
Regards,
-Denis