Skip to content

eggheadio/egghead-angularjs-protractor-console_errors

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

egghead-angularjs-protractor-console_errors

Code for the egghead.io video Detecting Console Errors in Protractor Tests

var IndexPage = require('./IndexPage');

describe('hello-protractor', function () {

  var page = new IndexPage();

  beforeEach(function() {
      page.get();
  });

  afterEach(function () {
    browser.manage().logs().get('browser').then(function (browserLog) {
      expect(browserLog.length).toEqual(0);
      if (browserLog.length) console.error('log: ' + JSON.stringify(browserLog));
    });
  });

  describe('index', function () {
    it('should display the correct title', function () {
      expect(page.getTitle()).toBe('hello protractor');
    });

    it('should display the message when button clicked', function () {
      page.clickButton();

      expect(page.getMessageText()).toBe('button 1 clicked');
    });
  });
});

About

Code for the egghead.io video Detecting Console Errors in Protractor Tests

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%