diff --git a/rascal-vscode-extension/src/test/vscode-suite/dsl.test.ts b/rascal-vscode-extension/src/test/vscode-suite/dsl.test.ts index 287331323..976452b4a 100644 --- a/rascal-vscode-extension/src/test/vscode-suite/dsl.test.ts +++ b/rascal-vscode-extension/src/test/vscode-suite/dsl.test.ts @@ -47,13 +47,14 @@ describe('DSL', function () { const repl = new RascalREPL(bench, driver); await repl.start(); await repl.execute("import demo::lang::pico::LanguageServer;"); - repl.execute("main();"); // we don't wait, be cause we might miss pico loading window + const replExecuteMain = repl.execute("main();"); // we don't wait yet, because we might miss pico loading window const ide = new IDEOperations(browser); const isPicoLoading = ide.statusContains("Pico"); await driver.wait(isPicoLoading, Delays.slow, "Pico DSL should start loading"); - await repl.terminate(); - // now wait for the Pico loader to dissapear + // now wait for the Pico loader to disappear await driver.wait(async () => !(await isPicoLoading()), Delays.extremelySlow, "Pico DSL should be finished starting", 100); + await replExecuteMain; + await repl.terminate(); } @@ -70,6 +71,12 @@ describe('DSL', function () { await ide.load(); }); + beforeEach(async function () { + if (this.test?.title) { + await ide.screenshot("DSL-" + this.test?.title); + } + }); + afterEach(async function () { if (this.test?.title) { await ide.screenshot("DSL-" + this.test?.title); @@ -87,6 +94,11 @@ describe('DSL', function () { try { await editor.setTextAtLine(10, "b := ;"); await ide.hasErrorSquiggly(editor, Delays.slow); + } catch (e) { + console.log(`Failed to trigger parse error: ${e}`); + if (e instanceof Error) { + console.log(e.stack); + } } finally { await ide.revertOpenChanges(); } diff --git a/rascal-vscode-extension/src/test/vscode-suite/utils.ts b/rascal-vscode-extension/src/test/vscode-suite/utils.ts index 680991d24..9ec8a51bd 100644 --- a/rascal-vscode-extension/src/test/vscode-suite/utils.ts +++ b/rascal-vscode-extension/src/test/vscode-suite/utils.ts @@ -315,8 +315,12 @@ export class IDEOperations { }; } + private screenshotSeqNumber = 0; + screenshot(name: string): Promise { - return this.browser.takeScreenshot(name.replace(/[/\\?%*:|"<>]/g, '-')); + return this.browser.takeScreenshot( + `${String(this.screenshotSeqNumber++).padStart(4, '0')}-` + // Make sorting screenshots chronologically in VS Code easier + name.replace(/[/\\?%*:|"<>]/g, '-')); } } diff --git a/runUItests.sh b/runUItests.sh index 641c9ef20..7e05214f0 100755 --- a/runUItests.sh +++ b/runUItests.sh @@ -21,4 +21,7 @@ npm run compile-tests # test what was compiled -exec npx extest setup-and-run out/test/vscode-suite/*.test.js --storage $UITESTS +exec npx extest setup-and-run out/test/vscode-suite/*.test.js \ + --code_version 1.82.3 \ + --storage $UITESTS \ + --extensions_dir $UITESTS/extensions_dir \ No newline at end of file