src/extensions/appscript-extension.js
/**
   * beforeRun - Convert location name to id based on location tab.
   * @param {object} context
   */
Convert location name to id based on location tab.
@param {object} context
Convert location name to id based on location tab . @param { object } context
beforeRun(context, options) {
    let test = context.test;
    if (test.webpagetest && test.webpagetest.settings) {
      this.locations = this.locations || this.connector.getList('locationsTab');
      this.locations.forEach(location => {
        if (test.webpagetest.settings.location === location.name) {
          test.webpagetest.settings.locationId = location.id;
        }
      });
    }
  }
beforeRun ( context , options ) { let test = context . test ; if ( test . webpagetest && test . webpagetest . settings ) { this . locations = this . locations || this . connector . getList ( 'locationsTab' ) ; this . locations . forEach ( location => { if ( test . webpagetest . settings . location === location . name ) { test . webpagetest . settings . locationId = location . id ; } } ) ; } }
beforeRun - Convert location name to id based on location tab.
beforeRun - Convert location name to id based on location tab .
// Update locations if there's WPT settings.