chore: bump vscode-extension-tester from 8.23.0 to 8.24.0 - #1464
chore: bump vscode-extension-tester from 8.23.0 to 8.24.0#1464djelinek wants to merge 5 commits into
Conversation
|
Warning Review limit reached
Next review available in: 58 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request adds shared page objects and locators for VS Code integration tests, migrates tests to those APIs, configures ExTester, updates Kaoto and Camel versions, and reformats an unchanged type union. ChangesIntegration test page-object migration
Type union formatting
Estimated code review effort: 4 (Complex) | ~45 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
9101453 to
478fa1e
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@it-tests/pageObjects/CatalogModal.ts`:
- Around line 97-113: The toggleProviderDropdown method should wait for the
provider menu’s actual state after clicking: when open is true, wait for the
menu to become visible; when false, wait for the menu to become hidden or absent
using the appropriate Selenium condition. Remove the fixed driver.sleep and the
closed-branch elementLocated wait, while preserving propagation of unexpected
wait errors.
In `@it-tests/pageObjects/locators.ts`:
- Around line 128-131: Replace compound class locators with CSS selectors:
define KaotoEdge.addStepIcon as the combined
.custom-edge__add-step.add-step-icon selector in
it-tests/pageObjects/locators.ts (128-131), change the compound By.className
calls in it-tests/pageObjects/locators.ts (235-251) and KaotoCanvas.ts (181-184)
to By.css, and update CatalogModal.gallery, DataMapperEditor.constructor, and
DataMapperEditor.howTo usages accordingly.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6fb2f65d-526b-4b44-94d5-d10e4833c498
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (21)
extester.config.jsonit-tests/BasicFlow.test.tsit-tests/MavenDependencyUpdate.test.tsit-tests/PropertyPanelLoading.test.tsit-tests/SwitchBetweenTabs.test.tsit-tests/Util.tsit-tests/pageObjects/CatalogModal.tsit-tests/pageObjects/DataMapperEditor.tsit-tests/pageObjects/EditorTabs.tsit-tests/pageObjects/KaotoCanvas.tsit-tests/pageObjects/KaotoEditor.tsit-tests/pageObjects/index.tsit-tests/pageObjects/locators.tsit-tests/settings/CatalogURLSettings.test.tsit-tests/settings/NodeLabelSettings.test.tsit-tests/views/03_IntegrationsViewNewFile.test.tsit-tests/vscode-settings-minikube.jsonpackage.jsonsrc/constants.tstest Fixture with speci@l chars/kaoto-view/example-tests/folderA/folderAA/test/citrus-application.propertiestest Fixture with speci@l chars/kaoto-view/example-tests/test/citrus-application.properties
| static async toggleProviderDropdown(driver: WebDriver, catalogWindow: WebElement, open: boolean, timeout = 5_000): Promise<void> { | ||
| const dropdown = await catalogWindow.findElement(By.xpath(kaotoLocators.CatalogModal.providerFilterDropdown)); | ||
| await dropdown.click(); | ||
| await driver.sleep(1_000); // allow DOM to reflect changes | ||
|
|
||
| if (open) { | ||
| await driver.wait(until.elementLocated(By.id(kaotoLocators.CatalogModal.providerSelectMenu)), timeout); | ||
| } else { | ||
| try { | ||
| await driver.wait(until.elementLocated(By.id(kaotoLocators.CatalogModal.providerSelectMenu)), timeout); | ||
| } catch (error) { | ||
| if (error instanceof Error && error.name !== 'TimeoutError') { | ||
| throw error; | ||
| } | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Locate target file and related selectors"
git ls-files | rg 'it-tests/pageObjects/CatalogModal\.ts|CatalogModal|catalog-modal|select menu|provider' || true
echo
echo "Target file excerpt"
if [ -f it-tests/pageObjects/CatalogModal.ts ]; then
nl -ba it-tests/pageObjects/CatalogModal.ts | sed -n '1,150p'
fi
echo
echo "Search providerSelectMenu usages"
rg -n "providerSelectMenu|toggleProviderDropdown|providerFilterDropdown" . || true
echo
echo "Check package selenium/wait dependency version"
for f in package.json yarn.lock; do
[ -f "$f" ] && { echo "--- $f"; sed -n '1,220p' "$f"; }
done
echo
echo "Inspect project lock around selenium versions"
rg -n '"selenium-webdriver"|selenium-webdriver|until' package.json yarn.lock package-lock.json 2>/dev/null || trueRepository: KaotoIO/vscode-kaoto
Length of output: 555
🌐 Web query:
Selenium WebDriver JavaScript until.elementLocated documentation
💡 Result:
In the Selenium WebDriver JavaScript bindings, until.elementLocated is a condition function used to wait for an element to be present in the DOM [1][2]. It is designed to be used in conjunction with the driver.wait method [1][3]. Usage The function accepts a locator (an instance of the By class or a function) and returns a WebElementCondition [1][2]. When passed to driver.wait, it causes the driver to repeatedly poll the DOM until the element is found, at which point the wait method resolves with the located WebElement [1][3]. Example async function example { const { Builder, By, until } = require('selenium-webdriver'); let driver = await new Builder.forBrowser('chrome').build; try { await driver.get('https://www.google.com'); // Wait up to 10 seconds for the element with name 'q' to be located let element = await driver.wait(until.elementLocated(By.name('q')), 10000); await element.sendKeys('webdriver'); } finally { await driver.quit; } } Key Details - Function Signature: until.elementLocated(locator) [1][2] - Parameter: locator (By | Function) - The locator used to identify the element [1][2]. - Return Value: WebElementCondition - A condition that resolves to a WebElement once the element is located [1][2]. - Behavior: Unlike driver.findElement, which throws an error if an element is not immediately present, until.elementLocated allows the script to pause and wait for the element to appear within the specified timeout duration [3][4].
Citations:
- 1: https://www.selenium.dev/selenium/docs/api/javascript/lib_until.js.html
- 2: https://www.selenium.dev/selenium/docs/api/javascript/global.html
- 3: https://www.selenium.dev/selenium/docs/api/javascript/WebDriver.html
- 4: https://www.selenium.dev/selenium/docs/api/javascript/lib_webdriver.js.html
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Target file excerpt"
if [ -f it-tests/pageObjects/CatalogModal.ts ]; then
grep -n . it-tests/pageObjects/CatalogModal.ts | sed -n '1,170p' || true
fi
echo
echo "Search providerSelectMenu usages"
rg -n "providerSelectMenu|toggleProviderDropdown|providerFilterDropdown" . || true
echo
echo "Inspect package manifest and lock for selenium-webdriver"
for f in package.json yarn.lock; do
[ -f "$f" ] && { echo "--- $f"; sed -n '1,220p' "$f"; }
done
echo
echo "Programmatic parse of Selenium until.elementLocated source semantics from installed package if available"
node - <<'JS' >/tmp/probe.js 2>/tmp/probe.err || true
try {
const fs = require('fs');
const path = require('path');
const mod = fs.realpathSync(path.resolve(require.resolve('selenium-webdriver/lib/webdriver'), '..', '..'));
console.log('module root', mod);
const file = fs.readFileSync(path.join(mod, 'lib', 'until.js'), 'utf8');
const lines = file.split(/\n/);
let i = 0;
for (; i < lines.length; i++) {
if (lines[i].includes('function () return this.findElement(locator)') || lines[i].includes('findElement')) {
console.log(`line ${i + 1}: ${lines[i]}`);
for (let j = Math.max(0, i - 8); j < Math[min: (lines.length - 1, i + 8); j++) { console.log(`${j + 1}: ${lines[j]}`); }
break;
}
}
} catch (error) {
console.log('not found or unavailable');
console.log(String(error));
}
JS
echo "--- probe stdout"
cat /tmp/probe.js 2>/tmp/probe.err || true
echo "--- probe stderr"
cat /tmp/probe.err || trueRepository: KaotoIO/vscode-kaoto
Length of output: 26353
🌐 Web query:
@redhat-developer/vscode-extension-tester until getElementLocated elementLocated
💡 Result:
The vscode-extension-tester framework is built on top of Selenium WebDriver [1][2][3]. When you need to perform conditional waits or handle elements that may not be immediately available, you should use the underlying WebDriver's wait mechanism [4]. getElementLocated is not a direct method provided by vscode-extension-tester classes, but you can achieve the desired behavior by using the driver.wait method along with Selenium's until.elementLocated or custom condition functions [4][5]. To wait for an element effectively: 1. Access the underlying driver from your page object or via VSBrowser.instance.driver. 2. Use driver.wait to poll for the element's existence or a specific state [4][5]. Example of waiting for an element to be located: import { until, By } from 'selenium-webdriver'; import { VSBrowser } from 'vscode-extension-tester'; const driver = VSBrowser.instance.driver; const element = await driver.wait(until.elementLocated(By.className('your-class-name')), 5000); If you need to wait for an element to be not just located, but also fully loaded or visible (as elementLocated only checks if the DOM node exists), consider using a custom wait condition [4]: await driver.wait(async => { const items = await section.getVisibleItems; return items.length > 0; }, 5000, 'Items were not properly loaded in 5 seconds...'); This approach allows you to implement robust synchronization tailored to the dynamic nature of VS Code's UI [4][5].
Citations:
- 1: https://github.com/redhat-developer/vscode-extension-tester?tab=readme-ov-file
- 2: https://github.com/redhat-developer/vscode-extension-tester/
- 3: https://registry.npmjs.org/vscode-extension-tester
- 4: [🚫 Bug] Wait periods needed to make sure tree items are loaded redhat-developer/vscode-extension-tester#1320
- 5: Provide a method to check whether an extension is activated redhat-developer/vscode-extension-tester#854
🏁 Script executed:
#!/bin/bash
set -euo pipefail
echo "Check module cache for vscode-extension-tester"
find "$HOME/.cache/yarn" "$HOME/.npm" "$HOME/.yarn" -path '*vscode-extension-tester*' -type f 2>/dev/null | head -50 || true
echo
echo "Inspect installed vscode-extension-tester wait wrappers if present"
node - <<'JS'
try {
const path = require.resolve('vscode-extension-tester');
const fs = require('fs');
console.log('vscode-extension-tester at', path);
const dir = path.endsWith('.js') ? path.split('/').slice(0, -1).join('/') : path;
for (const file of ['lib/out/util/wait.js', 'out/util/wait.js', 'out/lib/util/wait.js']) {
try {
const p = require.resolve('vscode-extension-tester/' + file);
console.log('--- found ' + p);
console.log(fs.readFileSync(p, 'utf8').split(/\n/).slice(0, 220).join('\n'));
} catch {}
}
} catch (error) {
console.log('vscode-extension-tester unavailable for inspection:', String(error));
}
JS
echo
echo "Inspect any npm registry package metadata for exported until module"
node - <<'JS'
const https = require('https');
https.get('https://unpkg.com/vscode-extension-tester@latest/out/util/wait.js', (res) => {
let data = '';
res.on('data', (chunk) => data += chunk);
res.on('end', () => console.log(data.split(/\n/).slice(0, 260).join('\n')));
}).on('error', (e) => console.log('fetch error:', String(e)));
JSRepository: KaotoIO/vscode-kaoto
Length of output: 717
Wait for the provider menu to close.
When open is false, until.elementLocated only waits for DOM presence, not the closed state. Reorder the click and wait the same way as the open branch, then wait for visibility/closure instead of relying on driver.sleep and an unrelated locator wait.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@it-tests/pageObjects/CatalogModal.ts` around lines 97 - 113, The
toggleProviderDropdown method should wait for the provider menu’s actual state
after clicking: when open is true, wait for the menu to become visible; when
false, wait for the menu to become hidden or absent using the appropriate
Selenium condition. Remove the fixed driver.sleep and the closed-branch
elementLocated wait, while preserving propagation of unexpected wait errors.
| /** Edge / add-step interactions */ | ||
| KaotoEdge: { | ||
| addStepIcon: `custom-edge__add-step add-step-icon`, | ||
| }, |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
rg -n -C2 'KaotoEdge\.addStepIcon|CatalogModal\.gallery|DataMapperEditor\.howTo' it-testsRepository: KaotoIO/vscode-kaoto
Length of output: 2630
🏁 Script executed:
#!/bin/bash
set -euo pipefail
printf 'Relevant locator definitions and usages:\n'
cat -n it-tests/pageObjects/locators.ts | sed -n '120,135p;225,258p'
printf '\n'
cat -n it-tests/pageObjects/KaotoCanvas.ts | sed -n '176,187p'
printf '\n'
cat -n it-tests/pageObjects/CatalogModal.ts | sed -n '74,90p'
printf '\n'
cat -n it-tests/pageObjects/DataMapperEditor.ts | sed -n '130,140p'
printf '\n'
cat -n it-tests/pageObjects/EditorTabs.ts | sed -n '74,82p'
printf '\nInstalled Selenium version evidence:\n'
if [ -f it-tests/package.json ]; then
cat it-tests/package.json | jq '.dependencies.selenium-webdriver, .dependencies["`@exadel/exstertest-webdriver`"]'
fiRepository: KaotoIO/vscode-kaoto
Length of output: 5494
🌐 Web query:
Selenium WebDriver By.className compound class names documentation
💡 Result:
In Selenium WebDriver, the By.className locator strategy does not support compound class names [1][2][3]. When you provide a string containing multiple classes separated by spaces, Selenium throws an InvalidSelectorException (often described as "Compound class names not permitted") [2][4][3]. The By.className method is designed to locate an element based on a single class name attribute [1]. If an HTML element has multiple classes (e.g., class="class1 class2"), attempting to use By.className("class1 class2") will fail because the locator interprets the space as a delimiter, treating it as multiple distinct classes rather than a single compound selector [2][3]. To locate elements that have multiple classes, you should use one of the following alternatives: 1. CSS Selectors: This is the recommended approach for handling multiple classes. You can represent compound classes by prefixing each class name with a dot (.) and joining them together (e.g., By.cssSelector(".class1.class2")) [2][4][3]. 2. XPath: You can use an XPath expression to match the entire class attribute exactly (e.g., By.xpath("//[@class='class1 class2']")) or use contains logic if you only need to match a subset of classes (e.g., By.xpath("//[contains(@class, 'class1') and contains(@class, 'class2')]")) [4][3]. If you only need to target one of the classes that is unique enough to identify the element, you can continue to use By.className with that single, specific class name [1][5].
Citations:
- 1: https://www.selenium.dev/selenium/docs/api/java/org/openqa/selenium/By.html
- 2: https://stackoverflow.com/questions/75716760/compound-class-names-not-permitted-error-selenium-java
- 3: https://stackoverflow.com/questions/56446458/finding-a-element-from-a-website-with-using-classname-css-selector-and-xpath
- 4: https://stackoverflow.com/questions/10658907/selenium-python-find-element-by-class-name-stopped-working-from-v-2-2-to-2-21
- 5: https://www.selenium.dev/documentation/webdriver/elements/finders/
Use CSS locators for compound class selectors.
By.className matches a single class token on class. Selectors that contain multiple classes fail as locators instead of matching elements.
Update each compound selector to CSS, and update the locators that pass it through:
it-tests/pageObjects/locators.ts#130: defineaddStepIcon:.custom-edge__add-step.add-step-icon``.it-tests/pageObjects/locators.ts#235,250,251: replace the compoundBy.classNamecalls withBy.css.it-tests/pageObjects/KaotoCanvas.ts#184: resolvekaotoLocators.KaotoEdge.addStepIconwithBy.css.- Update
CatalogModal.gallery,DataMapperEditor.constructor, andDataMapperEditor.howTousages where they callBy.className.
📍 Affects 2 files
it-tests/pageObjects/locators.ts#L128-L131(this comment)it-tests/pageObjects/locators.ts#L235-L251it-tests/pageObjects/KaotoCanvas.ts#L181-L184
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@it-tests/pageObjects/locators.ts` around lines 128 - 131, Replace compound
class locators with CSS selectors: define KaotoEdge.addStepIcon as the combined
.custom-edge__add-step.add-step-icon selector in
it-tests/pageObjects/locators.ts (128-131), change the compound By.className
calls in it-tests/pageObjects/locators.ts (235-251) and KaotoCanvas.ts (181-184)
to By.css, and update CatalogModal.gallery, DataMapperEditor.constructor, and
DataMapperEditor.howTo usages accordingly.
Source: Coding guidelines
bf88b8f to
237e14b
Compare
|
|
@djelinek the update was done, so we would need to rebase this PR to add the tests changes. |



Summary by CodeRabbit
New Features
Chores
Style