{"size": 1214, "ext": "js", "max_stars_repo_path": "Tests/Casper/Pages/join_page.js", "max_stars_repo_name": "joejcollins/bob-mathias", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "Tests/Casper/Pages/join_page.js", "max_issues_repo_name": "joejcollins/bob-mathias", "max_issues_repo_issues_event_min_datetime": "2015-02-05T08:12:03.000Z", "max_issues_repo_issues_event_max_datetime": "2016-02-05T15:16:06.000Z", "max_forks_repo_path": "Tests/Casper/Pages/join_page.js", "max_forks_repo_name": "blackradley/nesscliffe", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 43, "max_forks_count": null, "avg_line_length": 28.2325581395, "max_line_length": 94, "alphanum_fraction": 0.528830313}
﻿
function JoinPage() {
    this.casper = casper;

    this.startOnJoinPage = function () {
        casper.echo("base url is : " + casper.cli.options.baseUrl);
        casper.start(casper.cli.options.baseUrl + 'Account/Register');
    };

    this.checkPage = function () {
        casper.then(function () {
            casper.test.assertUrlMatch('Account/Register', 'Is on join page');
            casper.test.assertExists('form[id="register"]', 'Login page form has been found');
        });
    };

    this.fillForm = function (email, password) {
        casper.then(function () {
            this.fill('form[id="register"]', {
                '#Email': email,
                '#Password': password,
                '#agree': true
            }, false);
        });
    };

    this.typeForm = function (email, password) {
        casper.then(function () {
            this.sendKeys('#Email', email);
            this.sendKeys('#Password', password);
            this.click('#agree');
        });
    };

    this.submitForm = function () {
        casper.then(function () {
            this.click('form[id="register"] #submit', 'Join submit button clicked');
        });
    };

};

module.exports = JoinPage;