jeudi 14 avril 2016

Decision point for the user in CasperJS

Test is waiting while page will load text: 'SomeText', which is working fine. However now on the other hand when page won't find the text user should be able to decide whether to continue with testing or not.

casper.then(function() {
    casper.waitForText("SomeText", function() {
    this.echo('Found the result :)');
}, function(){
    casper.echo('Result not found! :( Would you like to continue testing? (Y/N)');
    ...
   }, 15000);
});

I found many general answers, but nothing for Casper/Phantom

Aucun commentaire:

Enregistrer un commentaire