Advertisement
Guest User

Untitled

a guest
Mar 29th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. var url = 'http://c3605h5.saig.frd.global';
  2. testString = 'To Do List';
  3. testSuccess = 'Verify "To Do List" exists.'
  4.  
  5.  
  6. casper.test.begin('Login Tests', 4, function (test) {
  7. casper.start(url, function () {
  8.  
  9.  
  10. test.assertTitle("Compliance 360", "Verify homepage title is Compliance 360");
  11. test.assertExists('form[name="Default"]', "Verify main form exists");
  12. //fill in the 3 fields with login info
  13.  
  14. casper.fill('form[name="Default"]', {
  15. Organization: 'c3605h5',
  16. UserName: 'admin',
  17. Password: 'password'
  18. }, true);
  19.  
  20. var loginBtn = document.getElementById("Login");
  21.  
  22. test.assertExists(loginBtn, "Verify Login Button exists");
  23.  
  24. //Test for "to do" text on page
  25. test.assertTextExists(testString, testSuccess);
  26.  
  27. });
  28.  
  29. casper.then(function() {
  30. this.click('#Login');
  31. });
  32.  
  33. casper.then(function() {
  34. console.log('After attempting to click, url is now: ' + this.getCurrentUrl());
  35. });
  36.  
  37. casper.run(function () {
  38. test.done();
  39. });
  40. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement