Skip to content

Commit

Permalink
Fix automated test now that the old SMS interface was removed.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcav committed Sep 22, 2014
1 parent 1149331 commit d8eae34
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
1 change: 1 addition & 0 deletions midp/sms.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function receiveSms(text, addr) {
function promptForMessageText() {
var el = document.getElementById('sms-listener-prompt').cloneNode(true);
el.style.display = 'block';
el.classList.add('visible');

var input = el.querySelector('input');
var btnCancel = el.querySelector('button.cancel');
Expand Down
19 changes: 8 additions & 11 deletions tests/automation.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,14 @@ casper.test.begin("unit tests", 5 + gfxTests.length, function(test) {
casper
.thenOpen("http://localhost:8000/index.html?midletClassName=tests.sms.SMSMIDlet&main=com/sun/midp/main/MIDletSuiteLoader", function() {
this.waitForText("START", function() {
this.waitForSelector("#sms_text", function() {
this.waitForSelector("#sms_addr", function() {
this.waitForSelector("#sms_receive", function() {
this.sendKeys("#sms_text", "Prova SMS", { reset: true });
this.sendKeys("#sms_addr", "+77777777777", { reset: true });
this.click("#sms_receive");

this.waitForText("DONE", function() {
test.assertTextDoesntExist("FAIL");
});
});
this.evaluate(function() {
promptForMessageText();
});
this.waitUntilVisible(".sms-listener-prompt", function() {
this.sendKeys(".sms-listener-prompt.visible input", "Prova SMS", { reset: true });
this.click(".sms-listener-prompt.visible button.recommend");
this.waitForText("DONE", function() {
test.assertTextDoesntExist("FAIL");
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion tests/midlets/sms/SMSMIDlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void run() {
System.out.println("FAIL - Wrong SMS text: " + message.getPayloadText());
}

if (!message.getAddress().equals("sms://+77777777777:5000")) {
if (!message.getAddress().equals("sms://unknown:5000")) {
System.out.println("FAIL - Wrong SMS address: " + message.getAddress());
}
} catch (Exception e) {
Expand Down

0 comments on commit d8eae34

Please sign in to comment.