Advertisement
Guest User

Untitled

a guest
Aug 27th, 2013
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var casper = require('casper').create();
  2.  
  3. casper.test.begin("Test ad 2/2 (simple question)", 2, function suite(test) {
  4.     casper.start('http://localhost:2441/examples/simple-demo.html', function() {
  5.         this.waitForSelector("[data-zone='2'] form", function then() {
  6.             this.fillSelectors("[data-zone='2'] form", {
  7.                 "input[data-correct='tywin']": "wrong answer"
  8.             }, true);
  9.         });
  10.     });
  11.  
  12.     casper.then(function() {
  13.         test.assertVisible("[data-zone='2'] formd",
  14.             "The wrong answer was correctly rejected");
  15.         this.fillSelectors("[data-zone='2'] form", {
  16.             "input[data-correct='tywin']": "tywin"
  17.         }, true);
  18.     });
  19.  
  20.     casper.then(function() {
  21.         test.assertNotVisible("[data-zone='2'] form",
  22.             "The correct answer was correctly accepted");
  23.     });
  24.  
  25.  
  26.     casper.run(function() {
  27.         test.done();
  28.     });
  29.  
  30. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement