2
0
mirror of https://github.com/gradio-app/gradio.git synced 2025-03-31 12:20:26 +08:00

Run streaming e2e tests on firefox ()

* Add code

* devices import

* Add requirements

* Fix config
This commit is contained in:
Freddy Boulton 2024-07-29 16:15:25 -04:00 committed by GitHub
parent 4b14ea860d
commit 7928c6edaa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 8 deletions
.config
.github/workflows
demo/stream_video_out

@ -1,10 +1,9 @@
import { defineConfig } from "@playwright/test";
import { defineConfig, devices } from "@playwright/test";
const base = defineConfig({
use: {
screenshot: "only-on-failure",
trace: "retain-on-failure",
permissions: ["clipboard-read", "clipboard-write", "microphone"],
bypassCSP: true,
launchOptions: {
args: [
@ -24,11 +23,24 @@ const base = defineConfig({
});
const normal = defineConfig(base, {
globalSetup: process.env.CUSTOM_TEST ? undefined : "./playwright-setup.js"
globalSetup: process.env.CUSTOM_TEST ? undefined : "./playwright-setup.js",
projects: [
{
name: "firefox",
use: { ...devices["Desktop Firefox"] },
testMatch: /.stream_(audio|video)_out\.spec\.ts/
},
{
name: "chrome",
use: {
...devices["Desktop Chrome"],
permissions: ["clipboard-read", "clipboard-write", "microphone"]
},
testIgnore: /.stream_(audio|video)_out\.spec\.ts/
}
]
});
normal.projects = undefined; // Explicitly unset this field due to https://github.com/microsoft/playwright/issues/28795
const lite = defineConfig(base, {
webServer: {
command: "python -m http.server 8000 --directory ../js/lite",
@ -46,6 +58,4 @@ const lite = defineConfig(base, {
timeout: 60000
});
lite.projects = undefined; // Explicitly unset this field due to https://github.com/microsoft/playwright/issues/28795
export default !!process.env.GRADIO_E2E_TEST_LITE ? lite : normal;

@ -56,7 +56,7 @@ jobs:
. venv/bin/activate
python -m pip install -r demo/outbreak_forecast/requirements.txt
python -m pip install -r demo/gradio_pdf_demo/requirements.txt
- run: pnpm exec playwright install chromium
- run: pnpm exec playwright install chromium firefox
- name: run browser tests
run: |
. venv/bin/activate

@ -0,0 +1 @@
opencv-python