Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. exports.config = {
  2. framework: 'jasmine',
  3. seleniumAddress: 'http://localhost:4444/wd/hub',
  4. specs: ['spec.js'],
  5. multiCapabilities: {
  6. browserName: 'firefox'
  7. }
  8. }
  9.  
  10. describe('myApp', function() {
  11.  
  12. /*----- Global variables used for executing test scripts -----*/
  13. var username = "abc";
  14. var password = "xyz";
  15.  
  16. var loginForm = element(by.id('loginForm'));
  17. var loginBtn = element.all(by.css('.form-control > input[type=submit]')).get(0);
  18. var usernameInputField = element(by.name('inputName'));
  19. var passwordInputField = element(by.name('inputPass'));
  20.  
  21. var navMenu = element(by.id('nav-container'));
  22. var pagesMenuBtn = element(by.id('.nav-container > model[type=href] > value["#/pages"]'));
  23. /*----- End of Global variables -----*/
  24.  
  25. /*----- Global functions required for use within test scripts -----*/
  26.  
  27. /*Define a function to log in to myApp automatically */
  28. function loginAsUser(username, password) {
  29. usernameInputField.sendKeys(username);
  30. passwordInputField.sendKeys(password);
  31. loginBtn.click();
  32. }
  33.  
  34. /*----- End of Global functions -----*/
  35.  
  36. /*----- TESTS -----*/
  37. //Test to get app title:
  38. it('should hit the VM hosted site', function() {
  39. browser.get('ip address');
  40. expect(browser.getTitle()).toEqual('myApp');
  41. });
  42.  
  43. // Debug the tests using browser.pause();
  44. browser.pause();
  45.  
  46. /*Test to log in- call 'loginAsUser()' from within test */
  47. it('should log the user in to Ultimetrics', function() {
  48. loginAsUser(username, password);
  49. });
  50.  
  51. /*Tests for Navigation Bar */
  52. it('should display the Pages menu', function() {
  53. //Write test for testing mouseover menu element here
  54. browser.actions().
  55. pagesMenuButton.mouseEnter().
  56. perform();
  57. expect(browser.menu.pages.isDisplayed().toBeTruthy());
  58. });
  59.  
  60. browser.pause();
  61.  
  62. /*----- END OF TESTS -----*/
  63. });
  64.  
  65. pagesMenuBtn.mouseEnter().
  66.  
  67. var pagesMenuBtn = element(by.id('.nav-container > model[type=href] > value["#/pages"]'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement