diff --git a/extensions/vscode/e2e/actions/Global.actions.ts b/extensions/vscode/e2e/actions/Global.actions.ts index d418fece3..b3fca5cbd 100644 --- a/extensions/vscode/e2e/actions/Global.actions.ts +++ b/extensions/vscode/e2e/actions/Global.actions.ts @@ -10,15 +10,16 @@ import { DEFAULT_TIMEOUT } from "../constants"; import { TestUtils } from "../TestUtils"; export class GlobalActions { + static defaultFolder = "e2e/test-continue"; + public static defaultNewFilename = "test.py"; + public static async openTestWorkspace() { - await VSBrowser.instance.openResources("e2e/test-continue"); + await VSBrowser.instance.openResources(GlobalActions.defaultFolder); await new Workbench().executeCommand( "Notifications: Clear All Notifications", ); } - public static defaultNewFilename = "test.py"; - public static async createAndOpenNewTextFile(): Promise<{ editor: TextEditor; }> { @@ -59,14 +60,15 @@ export class GlobalActions { return { editor }; } - public static async deleteFile( + public static async deleteFileFromFolder( filename = GlobalActions.defaultNewFilename, + folder = GlobalActions.defaultFolder, ): Promise { const fs = require("fs"); const path = require("path"); - const workspacePath = path.join(process.cwd(), "e2e", "test-continue"); - const filePath = path.join(workspacePath, filename); + const folderPath = path.join(process.cwd(), folder); + const filePath = path.join(folderPath, filename); try { await fs.promises.unlink(filePath); diff --git a/extensions/vscode/e2e/tests/Apply.test.ts b/extensions/vscode/e2e/tests/Apply.test.ts index 875e786dd..0328fa755 100644 --- a/extensions/vscode/e2e/tests/Apply.test.ts +++ b/extensions/vscode/e2e/tests/Apply.test.ts @@ -47,7 +47,7 @@ describe("Apply Test", () => { after(async function () { this.timeout(DEFAULT_TIMEOUT.XL); - await GlobalActions.deleteFile(); + await GlobalActions.deleteFileFromFolder(); }); it("Can reject and apply changes from sidebar", async () => {