mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
fix(frontend): use case-insensitive regex in getBlockCardByName
beautifyString capitalizes each word (e.g. "Add To Dictionary") but tests may pass names with different casing (e.g. "Add to Dictionary"). Playwright hasText with a string is case-insensitive but with a regex it is case-sensitive, so add the "i" flag.
This commit is contained in:
@@ -68,7 +68,7 @@ export class BuildPage extends BasePage {
|
||||
|
||||
private getBlockCardByName(name: string): Locator {
|
||||
const escapedName = name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
||||
const exactName = new RegExp(`^\\s*${escapedName}\\s*$`);
|
||||
const exactName = new RegExp(`^\\s*${escapedName}\\s*$`, "i");
|
||||
return this.page
|
||||
.locator('[data-id^="block-card-"]')
|
||||
.filter({ has: this.page.locator("span", { hasText: exactName }) })
|
||||
|
||||
Reference in New Issue
Block a user