From 71fa842dc64d4fd77135aae1104ad098cea2d633 Mon Sep 17 00:00:00 2001 From: zepumph Date: Fri, 14 Feb 2020 13:47:49 -0900 Subject: [PATCH] add studio, state, and mirror-input wrapper fuzzing to CT, including Client postMessageToParent parameter, https://github.com/phetsims/aqua/issues/76 --- js/continuous-server.js | 22 +++++++++++++++++++++- js/sim-test.js | 3 ++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/js/continuous-server.js b/js/continuous-server.js index b6207e2..f26d343 100644 --- a/js/continuous-server.js +++ b/js/continuous-server.js @@ -680,10 +680,30 @@ function createSnapshot( callback, errorCallback ) { url: 'sim-test.html?url=' + encodeURIComponent( '../../' + snapshotName + '/' + phetioRepo + '/' + phetioRepo + '_en.html' ) + '&simQueryParameters=' + encodeURIComponent( 'brand=phet-io&phetioStandalone&ea' + validatedParam + '&fuzz&memoryLimit=1000' ) } ); + + // fuzz test important wrappers + snapshot.testQueue.push( { + count: 0, + snapshotName: snapshotName, + test: [ phetioRepo, 'phet-io-studio-fuzz', 'require.js' ], + url: 'sim-test.html?url=' + encodeURIComponent( `../../${snapshotName}/studio/?sim=${phetioRepo}&phetioDebug&fuzz&postMessageToParent` ) + } ); + snapshot.testQueue.push( { + count: 0, + snapshotName: snapshotName, + test: [ phetioRepo, 'phet-io-state-fuzz', 'require.js' ], + url: 'sim-test.html?url=' + encodeURIComponent( `../../${snapshotName}/phet-io-wrappers/state/?sim=${phetioRepo}&phetioDebug&fuzz&postMessageToParent` ) + } ); + snapshot.testQueue.push( { + count: 0, + snapshotName: snapshotName, + test: [ phetioRepo, 'phet-io-mirror-inputs-fuzz', 'require.js' ], + url: 'sim-test.html?url=' + encodeURIComponent( `../../${snapshotName}/phet-io-wrappers/mirror-inputs/?sim=${phetioRepo}&phetioDebug&fuzz&postMessageToParent` ) + } ); } ); // accessible tests - snapshot.accessibleRepos.forEach( function( accessibleRepo ) { + snapshot.accessibleRepos.forEach( accessibleRepo => { snapshot.testQueue.push( { count: 0, snapshotName: snapshotName, diff --git a/js/sim-test.js b/js/sim-test.js index 97bb585..c4416c9 100644 --- a/js/sim-test.js +++ b/js/sim-test.js @@ -31,7 +31,8 @@ iframe.setAttribute( 'height', '384' ); document.body.appendChild( iframe ); // Add those two to our query parameters, so we get load/error messages -iframe.src = options.url + '?postMessageOnLoad&postMessageOnError&postMessageOnBeforeUnload' + ( options.simQueryParameters ? '&' + options.simQueryParameters : '' ); +iframe.src = QueryStringMachine.appendQueryStringArray( options.url, + [ '?postMessageOnLoad&postMessageOnError&postMessageOnBeforeUnload', options.simQueryParameters ] ); let hasErrored = false; let hasLoaded = false;