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

Help for openContextMenu in TextEditor #65

Closed
YvesMichon opened this issue Feb 8, 2023 · 3 comments
Closed

Help for openContextMenu in TextEditor #65

YvesMichon opened this issue Feb 8, 2023 · 3 comments

Comments

@YvesMichon
Copy link

Hello,

I'm writing test for private extension.
I want to automate the opening of the contextMenu to send command by click.

When i open the contextMenu

const workbench = await browser.getWorkbench();
const editorView = workbench.getEditorView();
const currentEditor = await editorView.openEditor(`${fic}`) as TextEditor;
const mnu = await currentEditor.openContextMenu();

I've got the error

invalid argument: invalid argument: invalid locator
  (Session info: chrome=102.0.5005.167)
    at getErrorFromResponseBody (C:\dev\webio\adv-e2e\node_modules\webdriver\build\utils.js:198:12)
    at NodeJSRequest._request (C:\dev\webio\adv-e2e\node_modules\webdriver\build\request\index.js:166:60)
    at async Browser.wrapCommandFn (C:\dev\webio\adv-e2e\node_modules\@wdio\utils\build\shim.js:137:29)
    at async Browser.$ (C:\dev\webio\adv-e2e\node_modules\@wdio\runner\node_modules\webdriverio\build\commands\browser\$.js:91:17)
    at async Browser.wrapCommandFn (C:\dev\webio\adv-e2e\node_modules\@wdio\utils\build\shim.js:137:29)
    at async ContextMenu.wait (C:\dev\webio\adv-e2e\node_modules\wdio-vscode-service\src\pageobjects\menu\ContextMenu.ts:80:16)
    at async World.<anonymous> (C:\dev\webio\adv-e2e\e2e\step-definitions\vscode.step.ts:82:21)

On debugging my test, I see the menu opening but it hangs just after

@jeffb-sfdc
Copy link
Contributor

We ran into this as well. I think the issue is that VS Code now uses the operating system's native UI controls for contextual menus, and they aren't able to be automated by wdio. We've gotten around it (so far) by doing most things in the command palette, but it would be nice if there was a means to automate the context menus.

@jeffb-sfdc
Copy link
Contributor

Also, I think this is a duplicate issue of #57

@christian-bromann
Copy link
Contributor

@jeffb-sfdc good call.

Closing as duplicate of #57

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

No branches or pull requests

3 participants