Skip to content

Commit 743a399

Browse files
committed
test: update
1 parent f34f923 commit 743a399

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/ui/command.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,17 @@ describe("Command Tests", function() {
109109
}
110110
});
111111

112+
afterEach(async function() {
113+
if (this.currentTest?.state === 'failed') {
114+
const safeName = this.currentTest.title.replace(/[^a-zA-Z0-9_-]/g, '_');
115+
try {
116+
await VSBrowser.instance.takeScreenshot(safeName);
117+
console.log(`Screenshot saved for failed test: ${safeName}`);
118+
} catch (e) {
119+
console.warn(`Failed to take screenshot for ${safeName}: ${e}`);
120+
}
121+
}
122+
});
112123

113124
it("Test javaProjectExplorer.focus", async function() {
114125
await new Workbench().executeCommand("javaProjectExplorer.focus");

0 commit comments

Comments
 (0)