import { SpecReporter } from 'jasmine-spec-reporter' ; import { browser , Config } from 'protractor' ; const globalAny = global ; const token = '' ; function validate_config ( ) { process . env . NODE_ENV = '' ; process . env . SPACE_NAME || new Error ( 'SPACE_NAME variable not set' ) ; process . env . SPACE_NAME_SCRUM || new Error ( 'SPACE_NAME_SCRUM variable not set' ) ; process . env . USER_NAME || new Error ( 'USER_NAME variable not set' ) ; process . env . USER_FULLNAME || new Error ( 'USER_FULLNAME variable not set' ) ; process . env . AUTH_TOKEN || new Error ( 'TOKEN (Auth token) variable not set' ) ; process . env . REFRESH_TOKEN || new Error ( 'OFFLINE_TOKEN (Refresh token) variable not set' ) ; } let conf = { framework : 'jasmine2' , jasmineNodeOpts : { showColors : true , silent : true , isVerbose : true , defaultTimeoutInterval : 3 * 60 * 1000 , } , directConnect : process . env . DIRECT_CONNECTION === 'true' , useAllAngular2AppRoots : true , getPageTimeout : 3 * 60 * 1000 , seleniumAddress : 'http://localhost:4444/wd/hub' , SELENIUM_PROMISE_MANAGER : false , specs : [ 'specs/smoke/smokeTest.spec.js' , 'specs/*.js' ] , suites : { smokeTest : [ 'specs/smoke/smokeTest.spec.js' ] , quickPreviewTest : [ 'specs/**/quickPreview.spec.js' ] , workItemTableTest : [ 'specs/**/workItemTableTest.spec.js' ] , fullTest : [ 'specs/**/*.spec.js' ] , } , capabilities : { browserName : 'chrome' , chromeOptions : { args : process . env . HEADLESS_MODE === 'true' ? [ '--no-sandbox' , '--headless' ] : [ '--no-sandbox' ] , } , name : 'browserAgile' , } , onPrepare : function ( ) { validate_config ( ) ; jasmine . getEnv ( ) . addReporter ( new SpecReporter ( { spec : { displayStacktrace : true , displayDuration : true , } , summary : { displayDuration : true , } , } ) ) ; browser . ignoreSynchronization = true ; browser . baseUrl = browser . baseUrl + '/' + process . env . USER_NAME + '/' + process . env . SPACE_NAME_SCRUM + '/plan' ; browser . token = encodeURIComponent ( JSON . stringify ( { access_token : process . env . AUTH_TOKEN , expires_in : 1800 , refresh_token : process . env . REFRESH_TOKEN , token_type : 'bearer' , } ) ) ; } , } ; exports . config = conf ;