<commit_before>'use strict';

var expect = require('chai').expect;

module.exports = function() {
    this.World = require('../support/world.js').World;

    this.Given(/^I am an anonymous user$/, function (next) {
        //do nothing
        next();
    });

    this.When(/^I go to the home page$/, function (next) {

        this.driver.get(this.baseUrl+'/');

        next();
    });

    this.Then(/^I should see "(.*)" as the page title$/, function (title, next) {

        this.driver.getTitle().then(function(pageTitle) {

            expect(pageTitle).to.equal(title);

            next();
        });

    });

    this.Then(/^I should see "(.*)" as the main heading$/, function (heading, next) {

        this.driver.findElement({ css: 'h1' }).getText()
            .then(function(text) {<commit_msg>Fixed home bdd check to wait until the title is set.<commit_after>'use strict';

var expect = require('chai').expect;
var webdriver = require('selenium-webdriver');
var until = webdriver.until;

module.exports = function() {
    this.World = require('../support/world.js').World;

    this.Given(/^I am an anonymous user$/, function (next) {
        //do nothing
        next();
    });

    this.When(/^I go to the home page$/, function (next) {

        this.driver.get(this.baseUrl+'/');

        next();
    });

    this.Then(/^I should see "(.*)" as the page title$/, function (title, next) {

        this.driver.wait(until.titleIs(title), 1000).then(function(){
            next();
        });

    });

    this.Then(/^I should see "(.*)" as the main heading$/, function (heading, next) {

        this.driver.findElement({ css: 'h1' }).getText()
            .then(function(text) {
{'fraction_non_alphanumeric': 0.18213866039952997, 'fraction_numerical': 0.0035252643948296123, 'mean_word_length': 2.406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5419966', 'n_tokens_mistral': 540, 'n_tokens_neox': 512, 'n_words': 130}