mirror of
https://github.com/galacean/engine.git
synced 2026-06-05 19:27:46 +08:00
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:
6
.github/workflows/ci.yml
vendored
6
.github/workflows/ci.yml
vendored
@@ -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/
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user