Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: locator selection and outputChannel selector #138

Conversation

jan872
Copy link
Contributor

@jan872 jan872 commented Sep 23, 2024

The locator selection by vscode version did not work, because the vscode version was overwritten by the underlying chrome version and "122" was larger than all vscode versions. The vscode version is now preserved and use for locator selection.

As of vscode 1.87.0 the bottombar's outputChanel selector does not have an attribute title anymore. The locator for 1.87.0 was thus added.

    The locator selection by vscode version did not work, because the vscode version was overwritten by the underlying chrome version and "122" was larger than all vscode versions. The vscode version is now preserved and use for locator selection.

    As of vscode 1.87.0 the bottombar's outputChanel selector does not have an attribute title anymore. The locator for 1.87.0 was thus added.
@@ -87,7 +87,8 @@ export default class VSCodeServiceLauncher {
}

const version = cap[VSCODE_CAPABILITY_KEY].version || cap.browserVersion || DEFAULT_CHANNEL

cap[VSCODE_CAPABILITY_KEY].version = version
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

version is not a valid capability. What is the idea behind this change?

Copy link
Contributor Author

@jan872 jan872 Sep 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From line 89 I assumed that version was a valid capability, as it was used there.

The idea was to store the actual vscode version before cap.browserVersion gets overwritten here: https://github.com/webdriverio-community/wdio-vscode-service/blob/main/src/launcher.ts#L174
such that it is available here for selection of the right locators:
https://github.com/webdriverio-community/wdio-vscode-service/blob/main/src/service.ts#L207
(see https://github.com/webdriverio-community/wdio-vscode-service/pull/138/files#diff-84b68bce2abfcb25c3328df0286963d7dacc924940adc41923bf4f502a6bc95aR206)

Currently the capabilities.browserVersion is overwritten to the chrome version, and the locators may thus not be selected correctly.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jan872 actually this is correct, it is just changing the VSCODE_CAPABILITY_KEY capability object which can have arbitrary content.

Copy link
Contributor

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@christian-bromann christian-bromann merged commit 1429340 into webdriverio-community:main Sep 25, 2024
2 of 9 checks passed
@wdio-bot
Copy link
Collaborator

Hey jan872 👋

Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution.

We've sent you an email with further instructions on how to claim your expenses from our development fund.
Please make sure to check your spam folder as well. If you have any questions, feel free to reach out to us at [email protected] or in the contributing channel on Discord.

We are looking forward to more contributions from you in the future 🙌

Have a nice day,
The WebdriverIO Team 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants