Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.config = {
- framework: 'jasmine',
- seleniumAddress: 'http://localhost:4444/wd/hub',
- specs: ['spec.js'],
- multiCapabilities: {
- browserName: 'firefox'
- }
- }
- describe('myApp', function() {
- /*----- Global variables used for executing test scripts -----*/
- var username = "abc";
- var password = "xyz";
- var loginForm = element(by.id('loginForm'));
- var loginBtn = element.all(by.css('.form-control > input[type=submit]')).get(0);
- var usernameInputField = element(by.name('inputName'));
- var passwordInputField = element(by.name('inputPass'));
- var navMenu = element(by.id('nav-container'));
- var pagesMenuBtn = element(by.id('.nav-container > model[type=href] > value["#/pages"]'));
- /*----- End of Global variables -----*/
- /*----- Global functions required for use within test scripts -----*/
- /*Define a function to log in to myApp automatically */
- function loginAsUser(username, password) {
- usernameInputField.sendKeys(username);
- passwordInputField.sendKeys(password);
- loginBtn.click();
- }
- /*----- End of Global functions -----*/
- /*----- TESTS -----*/
- //Test to get app title:
- it('should hit the VM hosted site', function() {
- browser.get('ip address');
- expect(browser.getTitle()).toEqual('myApp');
- });
- // Debug the tests using browser.pause();
- browser.pause();
- /*Test to log in- call 'loginAsUser()' from within test */
- it('should log the user in to Ultimetrics', function() {
- loginAsUser(username, password);
- });
- /*Tests for Navigation Bar */
- it('should display the Pages menu', function() {
- //Write test for testing mouseover menu element here
- browser.actions().
- pagesMenuButton.mouseEnter().
- perform();
- expect(browser.menu.pages.isDisplayed().toBeTruthy());
- });
- browser.pause();
- /*----- END OF TESTS -----*/
- });
- pagesMenuBtn.mouseEnter().
- var pagesMenuBtn = element(by.id('.nav-container > model[type=href] > value["#/pages"]'));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement