src/extensions/appscript-extension.js
/**
   * afterAllRetrieves - Collect all latest retrieved Results for each label,
   *     and delete the trigger for retrieving results if all results are done.
   * @param {object} context Context object that contains all processed Tests
   *     and Result objects.
   */
Collect all latest retrieved Results for each label,
and delete the trigger for retrieving results if all results are done.
@param {object} context Context object that contains all processed Tests
and Result objects.
Collect all latest retrieved Results for each label and delete the trigger for retrieving results if all results are done . @param { object } context Context object that contains all processed Tests and Result objects .
afterAllRetrieves(context, options) {
    let appscript = (options || {}).appscript || {};
    if (!context.results || context.results.length === 0) return;
    let resultsTabIds = Object.keys(this.connector.tabConfigs).filter(tabId => {
      return this.connector.tabConfigs[tabId].tabRole === 'results';
    });
    let pendingResults = [];
    resultsTabIds.forEach(tabId => {
      let tabConfig = this.connector.tabConfigs[tabId];
      let results = this.connector.getResultList({
        appscript: {resultsTab: tabId},
        filters: [`status==="${Status.SUBMITTED}"`],
      });
      pendingResults = pendingResults.concat(results);
    });
    if (pendingResults.length === 0) {
      if (options.verbose) {
        console.log('Deleting Trigger for RETRIEVE_PENDING_RESULTS_FUNC...');
      }
      AppScriptHelper.deleteTriggerByFunction(RETRIEVE_PENDING_RESULTS_FUNC);
      this.connector.setSystemVar(SystemVars.RETRIEVE_TRIGGER_ID, '');
    }
  }
afterAllRetrieves ( context , options ) { let appscript = ( options || { } ) . appscript || { } ; if ( ! context . results || context . results . length === 0 ) return ; let resultsTabIds = Object . keys ( this . connector . tabConfigs ) . filter ( tabId => { return this . connector . tabConfigs [ tabId ] . tabRole === 'results' ; } ) ; let pendingResults = [ ] ; resultsTabIds . forEach ( tabId => { let tabConfig = this . connector . tabConfigs [ tabId ] ; let results = this . connector . getResultList ( { appscript : { resultsTab : tabId } , filters : [ ` ${ Status . SUBMITTED } ` ] , } ) ; pendingResults = pendingResults . concat ( results ) ; } ) ; if ( pendingResults . length === 0 ) { if ( options . verbose ) { console . log ( 'Deleting Trigger for RETRIEVE_PENDING_RESULTS_FUNC...' ) ; } AppScriptHelper . deleteTriggerByFunction ( RETRIEVE_PENDING_RESULTS_FUNC ) ; this . connector . setSystemVar ( SystemVars . RETRIEVE_TRIGGER_ID , '' ) ; } }
afterAllRetrieves - Collect all latest retrieved Results for each label,
     and delete the trigger for retrieving results if all results are done.
afterAllRetrieves - Collect all latest retrieved Results for each label and delete the trigger for retrieving results if all results are done .
// Skip when there's no newly updated results from the context. // Get all tabIds of results tabs. // Get results from all Results tab.