Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. // test.js
  2.  
  3. var webdriverio = require('webdriverio');
  4.  
  5. var options = {
  6. desiredCapabilities: {
  7. browserName: 'chrome'
  8. }
  9. };
  10.  
  11. webdriverio
  12. .remote(options)
  13. .init()
  14. .url('http://www.google.com')
  15. .title(function(err, res) {
  16. console.log('Title was: ' + res.value);
  17. })
  18. .end();
  19.  
  20. // test-mocha.js
  21.  
  22. var expect = require('expect.js');
  23. var webdriverio = require('webdriverio');
  24.  
  25. var options = {
  26. desiredCapabilities: {
  27. browserName: 'chrome'
  28. }
  29. };
  30.  
  31. describe('WebdriverIO Sample Test', function () {
  32. it('should return "Google"', function () {
  33. webdriverio
  34. .remote(options)
  35. .init()
  36. .url('http://www.google.com')
  37. .title(function(err, res) {
  38. var title = res.value;
  39. expect(title).to.be('Google');
  40. })
  41. .end();
  42. })
  43. });
  44.  
  45. WebdriverIO Sample Test
  46. ✓ should return "Google"
  47.  
  48. 1 passing (4ms)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement