<commit_before>import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'mobx-react';
import { hashHistory, browserHistory, createMemoryHistory, Router, useRouterHistory } from 'react-router';
import { createHistory } from 'history'
import { RouterStore, syncHistoryWithStore  } from 'mobx-react-router';
import ExtendedRoutingStore from './shared/lib/ExtendedRouterStore';
import {
    fetchServerConfig,
    initializeAPIClients,
    initializeAppStore,
    initializeConfiguration,
    setServerConfig,
    setConfigDefaults
} from './config/config';

import './shared/lib/ajaxQuiet';
import {computed, extendObservable} from 'mobx';
import makeRoutes from './routes';
import * as _ from 'lodash';
import $ from 'jquery';
import URL from 'url';
import * as superagent from 'superagent';
import { getHost } from './shared/api/urls';
import { validateParametersPatientView } from './shared/lib/validateParameters';
import AppConfig from "appConfig";
import browser from 'bowser';
import { setNetworkListener } from './shared/lib/ajaxQuiet';
import {initializeTracking} from "shared/lib/tracking";
import {CancerStudyQueryUrlParams} from "shared/components/query/QueryStore";
import {MolecularProfile} from "shared/api/generated/CBioPortalAPI";
import {molecularProfileParams} from "shared/components/query/QueryStoreUtils";
import ExtendedRouterStore from "shared/lib/ExtendedRouterStore";
import superagentCache from 'superagent-cache';
import getBrowserWindow from "shared/lib/getBrowserWindow";
import {getConfigurationServiceApiUrl} from "shared/api/urls";
import {AppStore} from "./AppStore";

superagentCache(superagent);

// YOU MUST RUN THESE initialize and then set the public path after
initializeConfiguration();
// THIS TELLS WEBPACK BUNDLE LOADER WHERE TO LOAD SPLIT BUNDLES
__webpack_public_path__ = AppConfig.frontendUrl;

if (!window.hasOwnProperty("$")) {
    window.$ = $;
}

if (!window.hasOwnProperty("jQuery")) {
    window.jQuery = $;
}

// write browser name, version to brody tag
if (browser) {
    $(document).ready(()=>{
        $("body").addClass(browser.name);
    });
}

if (localStorage.e2etest) {
    $(document).ready(()=>{
        $("body").addClass("e2etest");
        window.e2etest = true;
    });
}

if (getBrowserWindow().navigator.webdriver) {
    setNetworkListener();
}

// expose version on window
window.FRONTEND_VERSION = VERSION;
window.FRONTEND_COMMIT = COMMIT;

// this is special function allowing MSKCC CIS to hide login UI in
// portal header
window.postLoadForMskCIS = function(){
    AppConfig.hide_login = true;
}

// make sure lodash doesn't overwrite (or set) global underscore
_.noConflict();<commit_msg>e2etest: use navigator.webdriver flag to detect e2e context<commit_after>import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'mobx-react';
import { hashHistory, browserHistory, createMemoryHistory, Router, useRouterHistory } from 'react-router';
import { createHistory } from 'history'
import { RouterStore, syncHistoryWithStore  } from 'mobx-react-router';
import ExtendedRoutingStore from './shared/lib/ExtendedRouterStore';
import {
    fetchServerConfig,
    initializeAPIClients,
    initializeAppStore,
    initializeConfiguration,
    setServerConfig,
    setConfigDefaults
} from './config/config';

import './shared/lib/ajaxQuiet';
import {computed, extendObservable} from 'mobx';
import makeRoutes from './routes';
import * as _ from 'lodash';
import $ from 'jquery';
import URL from 'url';
import * as superagent from 'superagent';
import { getHost } from './shared/api/urls';
import { validateParametersPatientView } from './shared/lib/validateParameters';
import AppConfig from "appConfig";
import browser from 'bowser';
import { setNetworkListener } from './shared/lib/ajaxQuiet';
import {initializeTracking} from "shared/lib/tracking";
import {CancerStudyQueryUrlParams} from "shared/components/query/QueryStore";
import {MolecularProfile} from "shared/api/generated/CBioPortalAPI";
import {molecularProfileParams} from "shared/components/query/QueryStoreUtils";
import ExtendedRouterStore from "shared/lib/ExtendedRouterStore";
import superagentCache from 'superagent-cache';
import getBrowserWindow from "shared/lib/getBrowserWindow";
import {getConfigurationServiceApiUrl} from "shared/api/urls";
import {AppStore} from "./AppStore";

superagentCache(superagent);

// YOU MUST RUN THESE initialize and then set the public path after
initializeConfiguration();
// THIS TELLS WEBPACK BUNDLE LOADER WHERE TO LOAD SPLIT BUNDLES
__webpack_public_path__ = AppConfig.frontendUrl;

if (!window.hasOwnProperty("$")) {
    window.$ = $;
}

if (!window.hasOwnProperty("jQuery")) {
    window.jQuery = $;
}

// write browser name, version to brody tag
if (browser) {
    $(document).ready(()=>{
        $("body").addClass(browser.name);
    });
}

// e2e test specific stuff
if (getBrowserWindow().navigator.webdriver) {

    $(document).ready(()=>{
        $("body").addClass("e2etest");
        window.e2etest = true;
    });

    setNetworkListener();
}

// expose version on window
window.FRONTEND_VERSION = VERSION;
window.FRONTEND_COMMIT = COMMIT;

// this is special function allowing MSKCC CIS to hide login UI in
// portal header
window.postLoadForMskCIS = function(){
    AppConfig.hide_login = true;
}

// make sure lodash doesn't overwrite (or set) global underscore
_.noConflict();
{'fraction_non_alphanumeric': 0.12112831858407079, 'fraction_numerical': 0.0014749262536873156, 'mean_word_length': 5.123024830699774, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5289634', 'n_tokens_mistral': 1585, 'n_tokens_neox': 1568, 'n_words': 434}