<commit_before>import { protractor, browser, element, by, By, $, $$, ExpectedConditions as EC, ElementFinder } from 'protractor'
import {pages} from '../page-objects/page';
import auth from './auth';
import flows from './flows';
import create from './create';
import runFlows from './run';
import jobs from './jobs';
import runTraces from './traces';
import mappings from './mappings';
import uninstall from './uninstall';

import CUSTOM_MATCHERS from '../matchers'
import loginPage from '../page-objects/auth/login';
const request = require('request').defaults({ strictSSL: false })
const tmp = require('tmp');
const fs = require('fs-extra');
const path = require('path');
let tmpobj = tmp.dirSync({ unsafeCleanup: true });
fs.copySync('e2e/qa-data/data/input', path.join(tmpobj.name, 'input'));
console.log('DIR: ' + tmpobj.name);

describe('DataHub', function () {
  beforeAll(function (done) {
    //apply custom matchers
    jasmine.addMatchers(CUSTOM_MATCHERS)

    /*let yargs = require('yargs').argv
    let width = typeof yargs.width === 'number' ? yargs.width : 1920
    let height = typeof yargs.height === 'number' ? yargs.height : 1080*/

    request({
      url: `http://localhost:8080/api/projects/reset`
    }, function (error, response, body) {

      browser.driver.get(browser.baseUrl)
        .then(() => browser.driver.manage().deleteAllCookies())
        .then(() => $('body').isPresent())
        .then(() => {}, () => {})
        .then(() => browser.driver.getCapabilities())
        .then(caps => {
          console.log('browserName:' + caps.get('browserName'));
          console.log('baseUrl:'+browser.baseUrl);
        })
        .then(() => done())

      //.then(() => browser.driver.getCapabilities())
      //.then(caps => {
      //  console.log('browserName:' + caps.get('browserName'));
      //  pages.browserName =yargs.browserName
      //  pages.baseUrl =yargs.baseUrl
      //  console.log(`pages.baseUrl: ${pages.baseUrl}`);
      //})
      // our Jenkins machine runs with a pretty low resolution, and we also
      // have an app that's misbehaving in smaller windows, so this is a delicate
      // setting
      //.then(() => browser.driver.manage().window().maximize())
      //.then(() => done())
    });
  });

  afterAll(function(done) {
    tmpobj.removeCallback();
    done();
  });

  auth(tmpobj.name);
  //flows(tmpobj.name);
  //create(tmpobj.name);
  //runFlows(tmpobj.name);
  //jobs();
  //runTraces();
  //mappings();
  uninstall(tmpobj.name);
});<commit_msg>use specific qa-project dir and cleanup<commit_after>import { browser, $ } from 'protractor';
import auth from './auth';
import flows from './flows';
import create from './create';
import runFlows from './run';
import jobs from './jobs';
import runTraces from './traces';
import mappings from './mappings';
import uninstall from './uninstall';
import scenarios from './scenarios';

import CUSTOM_MATCHERS from '../matchers'
const request = require('request').defaults({ strictSSL: false })
const tmp = require('tmp');
const fs = require('fs-extra');
const path = require('path');
let currentDirectory = process.cwd();
console.log('Current Directory: ' + currentDirectory);
let qaProjectDirectory = path.join(currentDirectory, 'e2e/qa-project');
console.log('QA Project Directory: ' + qaProjectDirectory);

describe('DataHub', function () {
  beforeAll(function (done) {
    //apply custom matchers
    jasmine.addMatchers(CUSTOM_MATCHERS)

    request({
      url: `http://localhost:8080/api/projects/reset`
    }, function (error, response, body) {

      browser.driver.get(browser.baseUrl)
        .then(() => browser.driver.manage().deleteAllCookies())
        .then(() => $('body').isPresent())
        .then(() => {}, () => {})
        .then(() => browser.driver.getCapabilities())
        .then(caps => {
          console.log('browserName:' + caps.get('browserName'));
          console.log('baseUrl:'+browser.baseUrl);
        })
        .then(() => done())
    });
  });

  afterAll(function(done) {
    done();
  });

  auth(qaProjectDirectory);
  //flows(qaProjectDirectory);
  //create(qaProjectDirectory);
  //runFlows(qaProjectDirectory);
  scenarios(qaProjectDirectory);
  //jobs();
  //runTraces();
  //mappings();
  //uninstall(qaProjectDirectory);
});
{'fraction_non_alphanumeric': 0.18484848484848485, 'fraction_numerical': 0.004195804195804196, 'mean_word_length': 3.387525562372188, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 21, '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': '2606443', 'n_tokens_mistral': 1326, 'n_tokens_neox': 1277, 'n_words': 295}