Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var casper = require('casper').create();
- casper.test.begin("Test ad 2/2 (simple question)", 2, function suite(test) {
- casper.start('http://localhost:2441/examples/simple-demo.html', function() {
- this.waitForSelector("[data-zone='2'] form", function then() {
- this.fillSelectors("[data-zone='2'] form", {
- "input[data-correct='tywin']": "wrong answer"
- }, true);
- });
- });
- casper.then(function() {
- test.assertVisible("[data-zone='2'] formd",
- "The wrong answer was correctly rejected");
- this.fillSelectors("[data-zone='2'] form", {
- "input[data-correct='tywin']": "tywin"
- }, true);
- });
- casper.then(function() {
- test.assertNotVisible("[data-zone='2'] form",
- "The correct answer was correctly accepted");
- });
- casper.run(function() {
- test.done();
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement