Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/ui-test/tests/camel.settings.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ describe('Camel User Settings', function () {

await executeCommand(CAMEL_RUN_ACTION_QUICKPICKS_LABEL);
await waitUntilTerminalHasText(driver, [defaultExtraLaunchParameterSetting, newParameter, `Tracing is enabled on CamelContext`], 15000, 180000);


// cleaning for next test
await killTerminal();
await new BottomBarPanel().toggle(false);
});

it('Should remove parameter', async function () {
Expand All @@ -162,7 +165,7 @@ describe('Camel User Settings', function () {
await waitUntilItemNotExists(newParameter, arraySetting);

const values = await arraySetting.getValues();
expect(values.length).is.lessThan(3);
expect(values.length, `Current parameters are ${values}, we are expecting them to not contain ${newParameter}`).is.lessThan(3);
expect(values).not.includes(newParameter);
await cleanEnvironment();
});
Expand Down
7 changes: 6 additions & 1 deletion src/ui-test/tests/tasks.json.launch.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,12 @@ describe('Launch configuration from tasks.json autocompletion', function () {
async function setupEnvironment(resourceDir: string, vscodeDir: string, launch: boolean = false) {
driver = VSBrowser.instance.driver;
await VSBrowser.instance.openResources(resourceDir);
await (await new ActivityBar().getViewControl('Explorer'))?.openView();
try {
await (await new ActivityBar().getViewControl('Explorer'))?.openView();
} catch {
// workaround: retry in case of StaleElementReferenceError
await (await new ActivityBar().getViewControl('Explorer'))?.openView();
}

await deleteResource(vscodeDir);
await createFolder(vscodeDir);
Expand Down
11 changes: 8 additions & 3 deletions src/ui-test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ export async function waitUntilTerminalHasText(driver: WebDriver, textArray: str
await driver.sleep(interval);
await driver.wait(async function () {
try {
const terminal = await activateTerminalView();
const terminalText = await terminal.getText();
const terminalText = await getTerminalText();
for await (const text of textArray) {
if (!(terminalText.includes(text))) {
return false;
Expand All @@ -160,7 +159,7 @@ export async function waitUntilTerminalHasText(driver: WebDriver, textArray: str
} catch (err) {
return false;
}
}, timeout, undefined, interval);
}, timeout, `Expecting texts in terminal ${textArray} were not found in ${await getTerminalText()}`, interval);
}

/**
Expand Down Expand Up @@ -633,3 +632,9 @@ export async function waitUntilNotificationShows(driver: WebDriver, notification
}
}, timeout, "Required notification not available", interval);
}

async function getTerminalText() : Promise<string> {
const terminal = await activateTerminalView();
return await terminal.getText();
}

Loading