Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting an errors while executing protractor e2e tests

This is my refenceConf.js file i gave the testapp_spec,js in specs i gave both of them at same place

exports.config = {
  seleniumServerJar: './selenium/selenium-server-standalone-2.35.0.jar',
  seleniumPort: null,

  chromeDriver: './selenium/chromedriver',

  seleniumArgs: [],

  sauceUser: null,
  sauceKey: null,

  seleniumAddress: null,

  specs: [
    'testapp_spec.js'
  ],

  capabilities: {
    'browserName': 'chrome'
  },

  baseUrl: 'http://localhost:8000',

  rootElement: 'body',

  onPrepare: function() {

  },

  jasmineNodeOpts: {

    onComplete: null,

    isVerbose: false,

    showColors: true,

    includeStackTrace: true,

    defaultTimeoutInterval: 30000
  }
};

and this is my testapp_spec.js and i am writing a single test case to display home page

var util = require('util');

describe('longer example', function() {
  var ptor = protractor.getInstance();
  beforeEach(function() {
    ptor.get('../testapp/app/index.html')
  })

  it('should load the home page', function() {
    body = ptor.findElement(protractor.By.tagName('body'));
    body.isDisplayed().then(function() {
      expect(body).toBeDefined()
    })
  })
})

when i execute this i am getting an error like angular is not defined help me to get out from this error

like image 980
user2733090 Avatar asked Feb 13 '26 06:02

user2733090


1 Answers

browser.driver.get('../testapp/app/index.html')
browser.driver.findElement() 
like image 61
Sakshi Singla Avatar answered Feb 15 '26 21:02

Sakshi Singla



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!