{"size": 1416, "ext": "js", "max_stars_repo_path": "client/test/e2e/create-account.e2espec.js", "max_stars_repo_name": "johnkingzy/DocumentManagementSys", "max_stars_repo_stars_event_min_datetime": "2019-06-14T02:00:08.000Z", "max_stars_repo_stars_event_max_datetime": "2020-12-09T19:43:38.000Z", "max_issues_repo_path": "client/test/e2e/create-account.e2espec.js", "max_issues_repo_name": "johnkingzy/DocumentManagementSys", "max_issues_repo_issues_event_min_datetime": "2017-05-30T17:28:20.000Z", "max_issues_repo_issues_event_max_datetime": "2017-06-14T12:17:29.000Z", "max_forks_repo_path": "client/test/e2e/create-account.e2espec.js", "max_forks_repo_name": "johnkingzy/DocumentManagementSys", "max_forks_repo_forks_event_min_datetime": "2017-08-29T19:15:37.000Z", "max_forks_repo_forks_event_max_datetime": "2017-11-11T17:51:15.000Z"}
{"max_stars_count": 4, "max_issues_count": 4, "max_forks_count": 2, "avg_line_length": 34.5365853659, "max_line_length": 67, "alphanum_fraction": 0.6264124294}
/* eslint func-names: "off"*/
/* eslint no-unused-vars: "off"*/
const config = require('../../../nightwatch.conf');
const faker = require('faker');
const { url, timeout } = require('../setup');

module.exports = {
  Signup: browser =>
    browser
      .url(url)
      .waitForElementVisible('body')
      .assert.urlEquals('http://localhost:4000/login')
      .assert.title('DataHub')
      .setValue('input[id=firstname-signup]', 'adewale')
      .setValue('input[id=lastname-signup]', 'david')
      .setValue('input[id=username-signup]', faker.name.findName())
      .setValue('input[id=password-signup]', 'maximuf123')
      .setValue('input[id=email-signup]', faker.internet.email())
      .setValue('input[id=confirm-signup]', 'maximuf123')
      .click('#signup-btn')
      .waitForElementVisible('#dashboard', timeout)
      .saveScreenshot('datahub-login.png')
      .end(),

  'Logout': function (browser) { //eslint-disable-line
    browser
      .url(url)
      .waitForElementVisible('body', timeout)
      .click('#login')
      .waitForElementVisible('.modal', timeout)
      .setValue('input[id=username-login]', 'maximuf')
      .setValue('input[id=password-login]', 'maximuf123')
      .click('#login-btn')
      .click('button.waves-effect')
      .waitForElementVisible('#dashboard', timeout)
      .click('.logout')
      .waitForElementVisible('#authentication', timeout)
      .end();
  }
};
