Fix audio test error in local env && Upgrade upload-artifact for e2e (#2539)

* fix: upgrade upload-artifact

* fix: audio test error in local env
This commit is contained in:
luzhuang
2025-02-06 17:53:14 +08:00
committed by GitHub
parent 494b7a16d8
commit ed9c82fa3f
2 changed files with 10 additions and 6 deletions

View File

@@ -105,19 +105,19 @@ jobs:
browser: chrome
- name: Upload Diff
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cypress-diff
path: e2e/diff/
- name: Upload Origin
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cypress-origin
path: e2e/fixtures/originImage
- name: Upload Screenshots
if: failure()
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: cypress-screenshots
path: e2e/downloads/

View File

@@ -1,4 +1,4 @@
import { AssetType, AudioClip, AudioSource, Engine } from "@galacean/engine-core";
import { AssetType, AudioClip, AudioManager, AudioSource, Engine } from "@galacean/engine-core";
import "@galacean/engine-loader";
import { WebGLEngine } from "@galacean/engine-rhi-webgl";
import { beforeAll, describe, expect, it } from "vitest";
@@ -54,7 +54,11 @@ describe("AudioSource", () => {
audioSource.stop();
audioSource.play();
// Because the audio play should interaction
expect(audioSource.isPlaying).to.be.false;
if (AudioManager.isAudioContextRunning()) {
expect(audioSource.isPlaying).to.be.true;
} else {
// Because the audio play should interaction
expect(audioSource.isPlaying).to.be.false;
}
});
});