Skip to content

Commit

Permalink
Added final test for repl
Browse files Browse the repository at this point in the history
  • Loading branch information
DavyLandman committed Sep 28, 2023
1 parent 2d48502 commit f3ddb10
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 14 deletions.
5 changes: 2 additions & 3 deletions rascal-vscode-extension/src/test/vscode-suite/ide.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ describe('IDE', function () {
it("outline works", async () => {
const editor = await ide.openModule(TestWorkspace.mainFile);
await editor.moveCursor(1,1);
const explorer = await (await (await bench.getActivityBar()).getViewControl("Explorer"))!.openView();
const explorer = await (await bench.getActivityBar().getViewControl("Explorer"))!.openView();
await sleep(1000);
const outline = await explorer.getContent().getSection("Outline") as ViewSection;
await outline.expand();
Expand All @@ -155,8 +155,7 @@ describe('IDE', function () {
}, 10_000, "Main function should show in the outline");

await driver.actions().doubleClick(mainItem!).perform();
//await mainItem!.click();
await driver.wait(async ()=> (await editor.getCoordinates())[0] === 5, 15_000, "Cursor should have moved to line 6 that contains the println function");
await driver.wait(async ()=> (await editor.getCoordinates())[0] === 5, 5_000, "Cursor should have moved to line 6 that contains the println function");
});
});

19 changes: 8 additions & 11 deletions rascal-vscode-extension/src/test/vscode-suite/repl.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ import { expect } from 'chai';
import { VSBrowser, WebDriver, Workbench } from 'vscode-extension-tester';
import { TestWorkspace, RascalREPL, REPL_CREATE_TIMEOUT, REPL_READY_TIMEOUT, IDEOperations } from './utils';


// Create a Mocha suite
describe('REPL', function () {
let browser: VSBrowser;
let driver: WebDriver;
Expand All @@ -48,15 +46,6 @@ describe('REPL', function () {
await ide.cleanup();
console.log("!!!!I got past cleanup!!!!");
await browser.waitForWorkbench();
//panel = new BottomBarPanel();
//await panel.toggle(true);
// we start an initial terminal and keep that one open
//terminal = await panel.openTerminalView();
//await sleep(2000);
});


after(async () => {
});

afterEach(async () => {
Expand Down Expand Up @@ -86,4 +75,12 @@ describe('REPL', function () {
await repl.connect();
expect(repl.lastOutput).is.equal("5\nint: 0");
}).timeout(REPL_CREATE_TIMEOUT * 10);

it("edit call module via repl", async() => {
const repl = new RascalREPL(bench, driver);
await repl.start();
await repl.execute(":edit demo::lang::pico::LanguageServer");

await driver.wait(async () => await (await bench.getEditorView().getActiveTab())?.getTitle() === "LanguageServer.rsc", 10_000, "LanguageServer should be opened");
});
});
Binary file not shown.

0 comments on commit f3ddb10

Please sign in to comment.