fix: playground img not working (#3980)
* 🐛 (model.py): fix issue where message.files was not being updated correctly when image_paths is empty in MessageBase class * 🐛 (model.py): simplify condition for checking if image_paths is not empty to improve readability and maintainability * [autofix.ci] apply automated fixes * 🔧 (OutputParser.py): refactor error message handling for unsupported or missing parser to improve readability and maintainability * [autofix.ci] apply automated fixes --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
e710b457c3
commit
7f10a2a201
2 changed files with 13 additions and 2 deletions
|
|
@ -37,7 +37,9 @@ class MessageBase(SQLModel):
|
||||||
if hasattr(file, "path") and hasattr(file, "url") and file.path:
|
if hasattr(file, "path") and hasattr(file, "url") and file.path:
|
||||||
session_id = message.session_id
|
session_id = message.session_id
|
||||||
image_paths.append(f"{session_id}{file.path.split(session_id)[1]}")
|
image_paths.append(f"{session_id}{file.path.split(session_id)[1]}")
|
||||||
message.files = image_paths
|
if image_paths:
|
||||||
|
message.files = image_paths
|
||||||
|
|
||||||
if isinstance(message.timestamp, str):
|
if isinstance(message.timestamp, str):
|
||||||
timestamp = datetime.fromisoformat(message.timestamp)
|
timestamp = datetime.fromisoformat(message.timestamp)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { expect, test } from "@playwright/test";
|
import { expect, test } from "@playwright/test";
|
||||||
import * as dotenv from "dotenv";
|
import * as dotenv from "dotenv";
|
||||||
import path from "path";
|
import path from "path";
|
||||||
|
import uaParser from "ua-parser-js";
|
||||||
|
|
||||||
test("Simple Agent", async ({ page }) => {
|
test("Simple Agent", async ({ page }) => {
|
||||||
test.skip(
|
test.skip(
|
||||||
|
|
@ -37,6 +38,14 @@ test("Simple Agent", async ({ page }) => {
|
||||||
modalCount = await page.getByTestId("modal-title")?.count();
|
modalCount = await page.getByTestId("modal-title")?.count();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getUA = await page.evaluate(() => navigator.userAgent);
|
||||||
|
const userAgentInfo = uaParser(getUA);
|
||||||
|
let control = "Control";
|
||||||
|
|
||||||
|
if (userAgentInfo.os.name.includes("Mac")) {
|
||||||
|
control = "Meta";
|
||||||
|
}
|
||||||
|
|
||||||
await page.getByRole("heading", { name: "Simple Agent" }).click();
|
await page.getByRole("heading", { name: "Simple Agent" }).click();
|
||||||
|
|
||||||
await page.waitForSelector('[title="fit view"]', {
|
await page.waitForSelector('[title="fit view"]', {
|
||||||
|
|
@ -124,7 +133,7 @@ test("Simple Agent", async ({ page }) => {
|
||||||
|
|
||||||
await page.waitForTimeout(500);
|
await page.waitForTimeout(500);
|
||||||
|
|
||||||
await page.keyboard.press("Control+V");
|
await page.keyboard.press(`${control}+V`);
|
||||||
|
|
||||||
await page.waitForTimeout(500);
|
await page.waitForTimeout(500);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue