gradio/.config/playwright.config.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

52 lines
1.5 KiB
JavaScript
Raw Normal View History

import { defineConfig } 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: [
"--disable-web-security",
"--use-fake-device-for-media-stream",
"--use-fake-ui-for-media-stream",
"--use-file-for-fake-audio-capture=../gradio/test_data/test_audio.wav"
]
}
},
2024-02-01 22:23:59 +08:00
expect: { timeout: 15000 },
timeout: 30000,
testMatch: /.*.spec.ts/,
testDir: "..",
workers: process.env.CI ? 1 : undefined,
retries: 3
});
const normal = defineConfig(base, {
globalSetup: process.env.CUSTOM_TEST ? undefined : "./playwright-setup.js"
});
fix-tests (#7345) * fix-tests * [tmp] Comment-out * Fix the URL constructor calls in `resolve_wasm_src()`, `should_proxy_wasm_src()`, and `<DownloadLink />` to handle relative URLs * Remove a circular dependency between lite/index.ts and lite/custom-element/index.ts to solve a bug that the dev app is mounted twice sometimes * Fix js/app/test/image_component_events.spec.ts * Set the `testIgnore` in `.config/playwright.config.js` * Fix the Lite dev mode only to create an app and expose the controller for Playwright, without editors etc. * add changeset * Set the mocked ruff version as 0.2.2 * Extend timeout * Fix to use the built lite files instead of the dev server * add changeset * comment out failed tests * Revert "comment out failed tests" This reverts commit 3580d7988714f49a21e221fe230b26ee86b66a68. * Fix the Gellery component to work in Wasm * Fix js/app/test/file_explorer_component_events.spec.ts to run on Wasm * Ignore queue_full_e2e_test.spec.ts * Revert "[tmp] Comment-out" This reverts commit c775c0cc298ac7e1f49545042e1dc7b6615d179d. * Revert "Extend timeout" This reverts commit 742d1e1e83fc99bd0ac6107a589b75905b7ed593. * Remove a commented out line * Refactor file_explorer_component_events.spec.ts * Revert "fix-tests", restoring the original test-functional.yml content This reverts commit 9ff2a7ddc5b00e1f41b4d7e9c4a64223934cf268. * Set CI step names * [tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content" This reverts commit de2dbe33173de39304294e6b46151ef1e07f6806. * Revert "[tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content"" This reverts commit 32154f3bb18d83bad5bce14e254d635dfbe847af. * [tmp] Revert "Revert "[tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content""" This reverts commit 204075e190eb755a99d2bb449fc339b1f1b5c29b. * Fix vite.config.js removing unnecessary code * Revert "Set the `testIgnore` in `.config/playwright.config.js`" This reverts commit 98dccc5be94ea9c77e69a58f50db577922fe2d67. * Add gallery_component_events.spec.ts * Revert js/app/test * tweak * tweak * revert workflow changes * add changeset --------- Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-04 22:03:46 +08:00
normal.projects = undefined; // Explicitly unset this field due to https://github.com/microsoft/playwright/issues/28795
const lite = defineConfig(base, {
webServer: {
fix-tests (#7345) * fix-tests * [tmp] Comment-out * Fix the URL constructor calls in `resolve_wasm_src()`, `should_proxy_wasm_src()`, and `<DownloadLink />` to handle relative URLs * Remove a circular dependency between lite/index.ts and lite/custom-element/index.ts to solve a bug that the dev app is mounted twice sometimes * Fix js/app/test/image_component_events.spec.ts * Set the `testIgnore` in `.config/playwright.config.js` * Fix the Lite dev mode only to create an app and expose the controller for Playwright, without editors etc. * add changeset * Set the mocked ruff version as 0.2.2 * Extend timeout * Fix to use the built lite files instead of the dev server * add changeset * comment out failed tests * Revert "comment out failed tests" This reverts commit 3580d7988714f49a21e221fe230b26ee86b66a68. * Fix the Gellery component to work in Wasm * Fix js/app/test/file_explorer_component_events.spec.ts to run on Wasm * Ignore queue_full_e2e_test.spec.ts * Revert "[tmp] Comment-out" This reverts commit c775c0cc298ac7e1f49545042e1dc7b6615d179d. * Revert "Extend timeout" This reverts commit 742d1e1e83fc99bd0ac6107a589b75905b7ed593. * Remove a commented out line * Refactor file_explorer_component_events.spec.ts * Revert "fix-tests", restoring the original test-functional.yml content This reverts commit 9ff2a7ddc5b00e1f41b4d7e9c4a64223934cf268. * Set CI step names * [tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content" This reverts commit de2dbe33173de39304294e6b46151ef1e07f6806. * Revert "[tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content"" This reverts commit 32154f3bb18d83bad5bce14e254d635dfbe847af. * [tmp] Revert "Revert "[tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content""" This reverts commit 204075e190eb755a99d2bb449fc339b1f1b5c29b. * Fix vite.config.js removing unnecessary code * Revert "Set the `testIgnore` in `.config/playwright.config.js`" This reverts commit 98dccc5be94ea9c77e69a58f50db577922fe2d67. * Add gallery_component_events.spec.ts * Revert js/app/test * tweak * tweak * revert workflow changes * add changeset --------- Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-04 22:03:46 +08:00
command: "python -m http.server 8000 --directory ../js/lite",
url: "http://localhost:8000/",
reuseExistingServer: !process.env.CI
},
testMatch: [
"**/file_component_events.spec.ts",
"**/chatbot_multimodal.spec.ts",
"**/kitchen_sink.spec.ts",
"**/gallery_component_events.spec.ts",
"**/image_remote_url.spec.ts" // To detect the bugs on Lite fixed in https://github.com/gradio-app/gradio/pull/8011 and https://github.com/gradio-app/gradio/pull/8026
],
workers: 1,
retries: 3
});
fix-tests (#7345) * fix-tests * [tmp] Comment-out * Fix the URL constructor calls in `resolve_wasm_src()`, `should_proxy_wasm_src()`, and `<DownloadLink />` to handle relative URLs * Remove a circular dependency between lite/index.ts and lite/custom-element/index.ts to solve a bug that the dev app is mounted twice sometimes * Fix js/app/test/image_component_events.spec.ts * Set the `testIgnore` in `.config/playwright.config.js` * Fix the Lite dev mode only to create an app and expose the controller for Playwright, without editors etc. * add changeset * Set the mocked ruff version as 0.2.2 * Extend timeout * Fix to use the built lite files instead of the dev server * add changeset * comment out failed tests * Revert "comment out failed tests" This reverts commit 3580d7988714f49a21e221fe230b26ee86b66a68. * Fix the Gellery component to work in Wasm * Fix js/app/test/file_explorer_component_events.spec.ts to run on Wasm * Ignore queue_full_e2e_test.spec.ts * Revert "[tmp] Comment-out" This reverts commit c775c0cc298ac7e1f49545042e1dc7b6615d179d. * Revert "Extend timeout" This reverts commit 742d1e1e83fc99bd0ac6107a589b75905b7ed593. * Remove a commented out line * Refactor file_explorer_component_events.spec.ts * Revert "fix-tests", restoring the original test-functional.yml content This reverts commit 9ff2a7ddc5b00e1f41b4d7e9c4a64223934cf268. * Set CI step names * [tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content" This reverts commit de2dbe33173de39304294e6b46151ef1e07f6806. * Revert "[tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content"" This reverts commit 32154f3bb18d83bad5bce14e254d635dfbe847af. * [tmp] Revert "Revert "[tmp] Revert "Revert "fix-tests", restoring the original test-functional.yml content""" This reverts commit 204075e190eb755a99d2bb449fc339b1f1b5c29b. * Fix vite.config.js removing unnecessary code * Revert "Set the `testIgnore` in `.config/playwright.config.js`" This reverts commit 98dccc5be94ea9c77e69a58f50db577922fe2d67. * Add gallery_component_events.spec.ts * Revert js/app/test * tweak * tweak * revert workflow changes * add changeset --------- Co-authored-by: Yuichiro Tachibana (Tsuchiya) <t.yic.yt@gmail.com> Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
2024-03-04 22:03:46 +08:00
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;