-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance Lite E2E tests and fix a networking problem on Lite (#9333)
* Add Lite E2E test to check a matplotlib problem which was fixed in #9312 * Restore js/app/test/image_remote_url.spec.ts, which was deleted in #8716 * Fix tootils import * Format * Fix processing_utils.resolve_with_google_dns to use the HTTPX client instead of urllib so it works on Lite * add changeset * add changeset * Move js/app/test/image_remote_url.spec.ts -> js/spa/test/image_remote_url.spec.ts * Use pyodide.http in resolve_with_google_dns on Lite --------- Co-authored-by: gradio-pr-bot <[email protected]>
- Loading branch information
1 parent
960743c
commit 5b86e2f
Showing
4 changed files
with
47 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"gradio": minor | ||
--- | ||
|
||
feat:Enhance Lite E2E tests and fix a networking problem on Lite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { test, expect } from "@self/tootils"; | ||
|
||
test("Image displays remote image correctly", async ({ page }) => { | ||
const example_image = page.locator( | ||
'div.block:has(div.label:has-text("Examples")) img' | ||
); | ||
const input_image = page.locator( | ||
'div.block:has(label:has-text("InputImage")) img' | ||
); | ||
const loopback_image = page.locator( | ||
'div.block:has(label:has-text("Loopback")) img' | ||
); | ||
const remote_output_image = page.locator( | ||
'div.block:has(label:has-text("RemoteImage")) img' | ||
); | ||
const submit_button = page.locator('button:has-text("Submit")'); | ||
|
||
await expect(example_image).toHaveJSProperty("complete", true); | ||
await expect(example_image).not.toHaveJSProperty("naturalWidth", 0); | ||
|
||
await expect(input_image).toHaveJSProperty("complete", true); | ||
await expect(input_image).not.toHaveJSProperty("naturalWidth", 0); | ||
|
||
await submit_button.click(); | ||
|
||
await expect(loopback_image).toHaveJSProperty("complete", true); | ||
await expect(loopback_image).not.toHaveJSProperty("naturalWidth", 0); | ||
await expect(remote_output_image).toHaveJSProperty("complete", true); | ||
await expect(remote_output_image).not.toHaveJSProperty("naturalWidth", 0); | ||
}); |