<commit_before>beforeEach(function() {
  isAngularSite(false);
});

describe('midwestjs.com', function() {
  describe('home page', function() {
    it('should have a cow', function() {
        browser.get('http://midwestjs.com');
        
        var cheeseContainer = element(by.id('logo'));
        expect(cheeseContainer.isPresent()).toBe(true);
        var imageMooExists = cheeseContainer.isElementPresent(by.tagName('img'));
        expect(imageMooExists).toBe(true);
    });
  });  

  describe('speakers page', function() {    
    it('should have 39 speakers', function() {                
        browser.get('http://midwestjs.com/speakers');
        var speakers = element.all(by.css('div.col-md-4.speaker'));
        expect(speakers.count()).toBe(39);
    });
    it('should have a speaker named Will', function() {
        browser.get('http://midwestjs.com/speakers');
        var speakerNames = element.all(by.css('div.col-md-4.speaker div.media div.media-body h3'));
        var me = speakerNames.filter(function(elem, index) {
            return elem.getText().then(function(text) {
                return text == '<NAME>';
            });
        });
        expect(me.first().isPresent()).toBe(true);
    });
  });

});<commit_msg>Adds test of my talk content popup, refactors speaker tests to have a beforeEach<commit_after>(function(){
    beforeEach(function() {
      isAngularSite(false);
    });

    describe('midwestjs.com', function() {
      describe('home page', function() {
        it('should have a cow', function() {
            browser.get('http://midwestjs.com');
            
            var cheeseContainer = element(by.id('logo'));
            expect(cheeseContainer.isPresent()).toBe(true);
            var imageMooExists = cheeseContainer.isElementPresent(by.tagName('img'));
            expect(imageMooExists).toBe(true);
        });
      });  

      describe('speakers page', function() {    
        var speakers, me;

        beforeEach(function() {
            browser.get('http://midwestjs.com/speakers');
            speakers = element.all(by.css('div.col-md-4.speaker'));        
            var nameHeading;

            me = speakers.filter(function(elem, index) {                
                nameHeading = elem.element(by.css('div.media-body h3'));
                return nameHeading.getText().then(function(text) {
                    return text == '<NAME>';
                });
            }).first();
        });

        it('should have 39 speakers', function() {                            
            expect(speakers.count()).toBe(39);
        });
        it('should have a speaker named Will', function() {                
            expect(me.isPresent()).toBe(true);        
        });
        it('should show the content of my talk when you click on me', function() {                
            me.element(by.css('div.media-body p a')).click(); // should be title of my talk
            var popupModalBody = me.element(by.css('div.modal-body p'));

            expect(popupModalBody.isDisplayed()).toBe(true);
            expect(popupModalBody.getText()).toBe(getExpectedModalBody());
        });
      });

    });


    function getExpectedModalBody() {
        return 'Front-end functional testing got you down? Protractor.js can help by providing simple APIs to navigate and assert properties of any running html, js and css. If you are using Angular, however, things get even easier! Visit this talk to see how you can get up and running with Protractor';
    }
}());
{'fraction_non_alphanumeric': 0.1458803611738149, 'fraction_numerical': 0.003668171557562077, 'mean_word_length': 2.211050724637681, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4863973', 'n_tokens_mistral': 966, 'n_tokens_neox': 938, 'n_words': 211}