Add undo/redo check (#3893)
* add check for other browsers * [autofix.ci] apply automated fixes * add command + zand y test --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
f802f9a92a
commit
34ef5f5964
3 changed files with 61 additions and 7 deletions
|
|
@ -55,7 +55,37 @@ export default defineConfig({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// name: "firefox",
|
||||||
|
// use: {
|
||||||
|
// ...devices["Desktop Firefox"],
|
||||||
|
// launchOptions: {
|
||||||
|
// // headless: false,
|
||||||
|
// firefoxUserPrefs: {
|
||||||
|
// "dom.events.asyncClipboard.readText": true,
|
||||||
|
// "dom.events.testing.asyncClipboard": true,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "safari",
|
||||||
|
// use: {
|
||||||
|
// ...devices["Desktop Safari"],
|
||||||
|
// launchOptions: {
|
||||||
|
// // headless: false,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: "arc",
|
||||||
|
// use: {
|
||||||
|
// ...devices["Desktop Arc"],
|
||||||
|
// launchOptions: {
|
||||||
|
// // headless: false,
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// },
|
||||||
// {
|
// {
|
||||||
// name: "firefox",
|
// name: "firefox",
|
||||||
// use: {
|
// use: {
|
||||||
|
|
|
||||||
|
|
@ -106,4 +106,19 @@ test("LangflowShortcuts", async ({ page }) => {
|
||||||
if (numberOfNodes != 1) {
|
if (numberOfNodes != 1) {
|
||||||
expect(false).toBeTruthy();
|
expect(false).toBeTruthy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Test undo (Command+Z or Control+Z)
|
||||||
|
await page.getByTestId("title-Ollama").click();
|
||||||
|
await page.keyboard.press("Backspace");
|
||||||
|
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||||
|
expect(numberOfNodes).toBe(0);
|
||||||
|
|
||||||
|
await page.keyboard.press(`${control}+z`);
|
||||||
|
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||||
|
expect(numberOfNodes).toBe(1);
|
||||||
|
|
||||||
|
// Test redo (Command+Y or Control+Y)
|
||||||
|
await page.keyboard.press(`${control}+y`);
|
||||||
|
numberOfNodes = await page.getByTestId("title-Ollama")?.count();
|
||||||
|
expect(numberOfNodes).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,22 @@ export default async () => {
|
||||||
// temp is in src/frontend/temp
|
// temp is in src/frontend/temp
|
||||||
const tempDbPath = path.join(__dirname, "..", "temp");
|
const tempDbPath = path.join(__dirname, "..", "temp");
|
||||||
console.log("tempDbPath", tempDbPath);
|
console.log("tempDbPath", tempDbPath);
|
||||||
|
|
||||||
|
// Check if the directory exists before attempting to remove it
|
||||||
|
if (fs.existsSync(tempDbPath)) {
|
||||||
// Remove the temp database
|
// Remove the temp database
|
||||||
fs.rmSync(tempDbPath);
|
fs.rmSync(tempDbPath, { recursive: true, force: true });
|
||||||
|
|
||||||
// Check if the file is removed
|
// Check if the file is removed
|
||||||
if (!fs.existsSync(tempDbPath)) {
|
if (!fs.existsSync(tempDbPath)) {
|
||||||
console.log("Successfully removed the temp database");
|
console.log("Successfully removed the temp database");
|
||||||
} else {
|
} else {
|
||||||
console.error("Error while removing the temp database");
|
console.error(
|
||||||
|
"Error: temp database still exists after removal attempt",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("Temp database directory does not exist, skipping removal");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error while removing the temp database:", error);
|
console.error("Error while removing the temp database:", error);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue