Skip to content

Commit 3c56ebb

Browse files
author
pgilmorepf
committed
Minor JS updates.
Summary: fixes T2211 But not really. We've decided that the JS testing is broken beyond repair, and the cost/benefit has exceeded usefulness. The example uses the CDN which is slightly better practice than adding the script files, and we report slightly better info about when tests finish in the example. Test Plan: none, because we removed it :( Reviewers: #devtools_in-progress, zac-playfab Reviewed By: #devtools_in-progress, zac-playfab Subscribers: zac-playfab Maniphest Tasks: T2211 Differential Revision: https://phab.playfabdev.com/D2460
1 parent 46048b4 commit 3c56ebb

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

targets/javascript/source/PlayFabApiTest.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
<div id="qunit-fixture"></div>
1111
<script src="https://code.jquery.com/jquery-1.7.1.min.js"></script><!-- HTTP vs HTTPS here should match where this file is hosted (This file is not strictly meant to be hosted, but rather run locally) -->
1212
<script src="code.jquery.com/qunit/qunit-1.19.0.js"></script>
13-
<script src="PlayFabSDK/PlayFabAdminApi.js"></script>
14-
<script src="PlayFabSDK/PlayFabClientApi.js"></script>
15-
<script src="PlayFabSDK/PlayFabMatchmakerApi.js"></script>
16-
<script src="PlayFabSDK/PlayFabServerApi.js"></script>
13+
<script src="https://download.playfab.com/PlayFabAdminApi.js"></script>
14+
<script src="https://download.playfab.com/PlayFabClientApi.js"></script>
15+
<script src="https://download.playfab.com/PlayFabMatchmakerApi.js"></script>
16+
<script src="https://download.playfab.com/PlayFabServerApi.js"></script>
1717
<script src="PlayFabApiTest.js"></script>
1818
</body>
1919
</html>

targets/javascript/source/PlayFabApiTest.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,11 +588,17 @@ QUnit.done(function (details) {
588588
FunctionParameter: { customId: PlayFab._internalSettings.buildIdentifier, testReport: PfTestReport },
589589
GeneratePlayStreamEvent: true
590590
};
591+
var onSaveResultsFinal = function (result, error) {
592+
if (result && !error) {
593+
console.log(PlayFabApiTests.testData.playFabId, ", Test report saved to CloudScript: ", PlayFab._internalSettings.buildIdentifier, "\n", JSON.stringify(PfTestReport, null, 4));
594+
} else {
595+
console.log(PlayFabApiTests.testData.playFabId, ", Failed to save test report to CloudScript (CS Error): ", PlayFab._internalSettings.buildIdentifier, "\n", JSON.stringify(PfTestReport, null, 4));
596+
}
597+
};
591598
if (PlayFabClientSDK.IsClientLoggedIn()) {
592-
PlayFabClientSDK.ExecuteCloudScript(saveResultsRequest, null);
593-
console.log(PlayFabApiTests.testData.playFabId, ", Test report saved to CloudScript: ", PlayFab._internalSettings.buildIdentifier, "\n", JSON.stringify(PfTestReport, null, 4));
599+
PlayFabClientSDK.ExecuteCloudScript(saveResultsRequest, onSaveResultsFinal);
594600
} else {
595-
console.log(PlayFabApiTests.testData.playFabId, ", Failed to save test report to CloudScript: ", PlayFab._internalSettings.buildIdentifier, "\n", JSON.stringify(PfTestReport, null, 4));
601+
console.log(PlayFabApiTests.testData.playFabId, ", Failed to save test report to CloudScript (Login): ", PlayFab._internalSettings.buildIdentifier, "\n", JSON.stringify(PfTestReport, null, 4));
596602
}
597603
});
598604

0 commit comments

Comments
 (0)