Skip to content

Commit

Permalink
feat: new test for sprigbnnbotot + parametrised
Browse files Browse the repository at this point in the history
  • Loading branch information
pospisilf committed Oct 7, 2024
1 parent 8da1575 commit ce251a4
Showing 1 changed file with 10 additions and 36 deletions.
46 changes: 10 additions & 36 deletions src/ui-test/tests/remote.debug.on.openshift.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,49 +38,33 @@ describe.only('Remote debug on OpenShift', function () {
});

it(`SpringBoot`, async function () {
await DefaultWait.sleep(10000);
//await DefaultWait.sleep(10000);
driver = VSBrowser.instance.driver;

//VSBrowser.instance.takeScreenshot('spring0');
await createCamelRoute(driver, "Demo");
//VSBrowser.instance.takeScreenshot('spring1');
await createProject(driver, SPRINGBOOT_CREATE_COMMAND)
//VSBrowser.instance.takeScreenshot('spring2');

// open file
// open file
await VSBrowser.instance.openResources(path.join(SPRINGBOOT_PROJECT_FOLDER, DEMO_FILE));
//VSBrowser.instance.takeScreenshot('spring3');

// set breakpoint
textEditor = new TextEditor();
await driver.wait(async function () {
return await textEditor.toggleBreakpoint(15);
}, 5000);
//VSBrowser.instance.takeScreenshot('spring4');


// open debug view
const debugView = await openDebugView();
//VSBrowser.instance.takeScreenshot('spring5');


// validate configuration and start debug
assert.isTrue(await validateLaunchConfiguration(debugView, SPRINGBOOT_ATTACH_DEBUGGER));
//VSBrowser.instance.takeScreenshot('spring6');
await startDebugSession(debugView,SPRINGBOOT_ATTACH_DEBUGGER);
//VSBrowser.instance.takeScreenshot('spring7');

//await DefaultWait.sleep(30000);


const terminalView = await new BottomBarPanel().openTerminalView();
console.log("SB1 " + await terminalView.getText());

//console.log("SB1 " + await terminalView.getText());

// check breakpoint is hitted
const breakpoint = await waitForBreakpointPause(driver, textEditor);

//VSBrowser.instance.takeScreenshot('spring8');

assert.isTrue(await breakpoint.isPaused());
});
});
Expand All @@ -96,43 +80,33 @@ describe.only('Remote debug on OpenShift', function () {
});

it(`Quarkus`, async function () {
await DefaultWait.sleep(10000);
//await DefaultWait.sleep(10000);

driver = VSBrowser.instance.driver;
//VSBrowser.instance.takeScreenshot('quarkus0');
await createCamelRoute(driver, "Demo");
//VSBrowser.instance.takeScreenshot('quarkus1');
await createProject(driver, QUARKUS_CREATE_COMMAND);
//VSBrowser.instance.takeScreenshot('quarkus2');

// open file
await VSBrowser.instance.openResources(path.join(QUARKUS_PROJECT_FOLDER, DEMO_FILE));
//VSBrowser.instance.takeScreenshot('quarkus3');

// set breakpoint
textEditor = new TextEditor();
await driver.wait(async function () {
return await textEditor.toggleBreakpoint(12);
}, 5000);

//VSBrowser.instance.takeScreenshot('quarkus4');
// open debug view
const debugView = await openDebugView();
//VSBrowser.instance.takeScreenshot('quarkus5');

// validate configuration and start debug
assert.isTrue(await validateLaunchConfiguration(debugView, QUARKUS_ATTACH_DEBUGGER));
//VSBrowser.instance.takeScreenshot('quarkus6');
await startDebugSession(debugView,QUARKUS_ATTACH_DEBUGGER);
//VSBrowser.instance.takeScreenshot('quarkus7');

//await DefaultWait.sleep(30000);

const terminalView = await new BottomBarPanel().openTerminalView();
console.log("QR1 " + await terminalView.getText());
//console.log("QR1 " + await terminalView.getText());

// check breakpoint is hitted
const breakpoint = await waitForBreakpointPause(driver, textEditor);
VSBrowser.instance.takeScreenshot('quarkus8');
assert.isTrue(await breakpoint.isPaused());
});
});
Expand Down Expand Up @@ -179,9 +153,9 @@ async function workaround(driver: WebDriver): Promise<void> {
const editor = new TextEditor();
const newJson = addNewItemToRawJson(await editor.getText(), "java.project.sourcePaths", ["src/main/java"]);
await editor.setText(newJson);
await DefaultWait.sleep(10000);
await DefaultWait.sleep(2000);
await editor.save();
await DefaultWait.sleep(10000);
await DefaultWait.sleep(2000);
await new EditorView().closeEditor("settings.json");
}

Expand Down Expand Up @@ -269,7 +243,7 @@ async function startDebugSession(debugView: DebugView, configName: string): Prom
async function waitForBreakpointPause(driver: WebDriver, textEditor: TextEditor, timeout: number = 300000, interval: number = 500): Promise<Breakpoint> {

const terminalView = await new BottomBarPanel().openTerminalView();
console.log("WFB " + await terminalView.getText());
// console.log("WFB " + await terminalView.getText());


const breakpoint = await driver.wait<Breakpoint>(async () => {
Expand Down

0 comments on commit ce251a4

Please sign in to comment.