Advertisement
Guest User

Untitled

a guest
Mar 29th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var testString = 'To Do List';
  2. var testSuccess = 'Verify "To Do List" String exists';
  3.  
  4. casper.test.begin('Login Tests', 4, function (test) {
  5.    
  6.    
  7.     casper.start('http://c3605h5.saig.frd.global').then(function() {
  8.         test.assertTitle("Compliance 360", "Verify homepage title is Compliance 360");
  9.         test.assertExists('form[name="Default"]', "Verify main form exists");
  10.         test.assertExists('#Login', "Verify Login Button exists");
  11.         casper.fill('form[name="Default"]', {
  12.             Organization: 'c3605h5',
  13.             UserName: 'admin',
  14.             Password: 'password'
  15.         }, true);
  16.     });
  17.    
  18.    
  19.     casper.then(function() {
  20.         this.click('#Login');
  21.     });
  22.    
  23.     casper.then(function() {
  24.         test.assertTextExists(testString, testSuccess)
  25.         console.log('After clicking login button, URL is: ' + this.getCurrentUrl());
  26.     });
  27.    
  28.     casper.run(function () {
  29.     test.done();
  30.     });
  31. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement