Skip to content

Commit 3825bbe

Browse files
committed
Fix play tests
1 parent 555f915 commit 3825bbe

11 files changed

Lines changed: 3901 additions & 3896 deletions

File tree

cypress/e2e/actions/play.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ context ('Play', function () {
147147
cy.get ('text-box').contains ('Zero');
148148

149149
cy.proceed ();
150-
cy.wait(100); // Add a small delay to ensure async operations complete
151150

152151
cy.wrap (this.monogatari).invoke ('state', 'music').should ('deep.equal', [{ statement: 'play music theme loop', paused: false }, { statement: 'play music subspace loop', paused: false }]);
153152
cy.wrap (this.monogatari).invoke ('history', 'music').should ('deep.equal', ['play music theme loop', 'play music subspace loop']);
@@ -256,7 +255,7 @@ context ('Play', function () {
256255

257256
it ('Sets player volume correctly', function () {
258257
this.monogatari.setting ('TypeAnimation', false);
259-
this.monogatari.preference('Volume').Music = 0.25;
258+
this.monogatari.preference('Volume', { ...this.monogatari.preference('Volume'), Music: 0.25 });
260259

261260
this.monogatari.script ({
262261
'Start': [
@@ -277,7 +276,7 @@ context ('Play', function () {
277276

278277
it ('Handles volume change correctly', function () {
279278
this.monogatari.setting ('TypeAnimation', false);
280-
this.monogatari.preference('Volume').Music = 0.25;
279+
this.monogatari.preference('Volume', { ...this.monogatari.preference('Volume'), Music: 0.25 });
281280

282281
this.monogatari.script ({
283282
'Start': [

cypress/support/commands.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,19 @@ Cypress.Commands.add ('loadTestAssets', function (args) {
565565
}
566566
});
567567

568+
this.monogatari.action ('Preload').blocks({
569+
'default': {
570+
'music': ['theme.mp3', 'subspace.mp3'],
571+
'sounds': ['beep.mp3', 'coin.mp3'],
572+
'voices': ['sample.mp3'],
573+
'scenes': ['christmas.png'],
574+
'images': ['polaroid.jpg', 'christmas.png'],
575+
'characters': {
576+
'y': ['angry.png', 'happy.png', 'normal.png', 'sad.png', 'surprised.png'],
577+
}
578+
}
579+
});
580+
568581
// We'll add for a while to ensure all assets have been loaded
569582
// cy.wait (5000);
570583
});

dist/engine/core/monogatari.js

Lines changed: 48 additions & 48 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/engine/core/monogatari.js.map

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/monogatari.module.js

Lines changed: 39 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/monogatari.module.js.map

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)