Skip to content

Commit

Permalink
Updated final message for gradle test case
Browse files Browse the repository at this point in the history
  • Loading branch information
SuparnaSuresh committed Nov 4, 2024
1 parent 58e971d commit 0ab0a56
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/test/GradleTestDevModeActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ it('attach debugger for gradle with custom parameter event', async () => {
}
}

await utils.stopLibertyserver();
await utils.stopLibertyserverForGradle();
isServerRunning = !await utils.checkTerminalforServerState(constants.SERVER_STOP_STRING); //negate isServerRunning
if (!isServerRunning)
console.log("Server stopped successfully ");
Expand All @@ -209,7 +209,7 @@ it('attach debugger for gradle with custom parameter event', async () => {
} finally {
console.log("finally block: is server running - ", isServerRunning);
if (isServerRunning) {
utils.stopLibertyserver();
utils.stopLibertyserverForGradle();
}
else
console.log("good to close test - Attach Debugger for start with custom parameter(-DdebugPort=7777) event");
Expand Down
16 changes: 15 additions & 1 deletion src/test/utils/testUtils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import path = require('path');
import { Workbench, InputBox, DefaultTreeItem, ModalDialog } from 'vscode-extension-tester';
import * as fs from 'fs';
import { MAVEN_PROJECT, STOP_DASHBOARD_MAC_ACTION } from '../definitions/constants';
import { GRADLE_PROJECT, MAVEN_PROJECT, STOP_DASHBOARD_MAC_ACTION } from '../definitions/constants';
import { MapContextMenuforMac } from './macUtils';
import clipboard = require('clipboardy');
import { expect } from 'chai';
Expand Down Expand Up @@ -192,4 +192,18 @@ export async function clearCommandPalette() {
expect(buttons.length).equals(2);
await dialog.pushButton('Clear');
}

/* Stop Server Liberty dashboard post Attach Debugger for Gradle project */
/* As the Window view changes using command to stop server instead of devmode action */
export async function stopLibertyserverForGradle() {
console.log("Stop Server action for GRADLE_PROJECT: " + GRADLE_PROJECT);
const workbench = new Workbench();
await workbench.executeCommand(STOP_DASHBOARD_MAC_ACTION);
const input = InputBox.create();
(await input).clear();
(await input).setText(GRADLE_PROJECT);
(await input).confirm();
(await input).click();
await delay(10000);
}

0 comments on commit 0ab0a56

Please sign in to comment.