src/extensions/appscript-extension.js
/**
   * afterAllRuns - create a trigger for retrieving results if not exists.
   * @param {object} context Context object that contains all processed Tests
   *     and Result objects.
   */
create a trigger for retrieving results if not exists.
@param {object} context Context object that contains all processed Tests
and Result objects.
create a trigger for retrieving results if not exists . @param { object } context Context object that contains all processed Tests and Result objects .
afterAllRuns(context, options) {
    let tests = context.tests || [];
    let results = context.results || [];
    options = options || {};
    let pendingResults = results.filter(result => {
      return result.status === Status.SUBMITTED;
    });
    if (pendingResults.length > 0) {
      let triggerId = this.connector.getSystemVar(SystemVars.RETRIEVE_TRIGGER_ID);
      if (options.verbose) console.log(`${SystemVars.RETRIEVE_TRIGGER_ID} = ${triggerId}`);
      if (!triggerId) {
        triggerId = AppScriptHelper.createTimeBasedTrigger(
            RETRIEVE_PENDING_RESULTS_FUNC, 10 );
        this.connector.setSystemVar(SystemVars.RETRIEVE_TRIGGER_ID, triggerId);
        if (options.verbose) console.log(
            `Time-based Trigger created for RETRIEVE_PENDING_RESULTS_FUNC: ${triggerId}`);
      }
    }
  }
afterAllRuns ( context , options ) { let tests = context . tests || [ ] ; let results = context . results || [ ] ; options = options || { } ; let pendingResults = results . filter ( result => { return result . status === Status . SUBMITTED ; } ) ; if ( pendingResults . length > 0 ) { let triggerId = this . connector . getSystemVar ( SystemVars . RETRIEVE_TRIGGER_ID ) ; if ( options . verbose ) console . log ( ` ${ SystemVars . RETRIEVE_TRIGGER_ID } ${ triggerId } ` ) ; if ( ! triggerId ) { triggerId = AppScriptHelper . createTimeBasedTrigger ( RETRIEVE_PENDING_RESULTS_FUNC , 10 ) ; this . connector . setSystemVar ( SystemVars . RETRIEVE_TRIGGER_ID , triggerId ) ; if ( options . verbose ) console . log ( ` ${ triggerId } ` ) ; } } }
afterAllRuns - create a trigger for retrieving results if not exists.
afterAllRuns - create a trigger for retrieving results if not exists .
/* minutes */