webdriverio-community / wdio-vscode-service

A service to test VSCode extensions from end to end using WebdriverIO
https://webdriverio-community.github.io/wdio-vscode-service/
MIT License
33 stars 28 forks source link

Terminal getText not working correctly #69

Closed degrammer closed 1 year ago

degrammer commented 1 year ago

The getText method from TerminalView is not working correctly. It selects the Terminal output executing the wrong copy command: terminal copy selection There is no such command. One alternative could be to modify the command to use copy

Reproduction example:

 const workbench = await browser.getWorkbench()
 const bottomBar = workbench.getBottomBar()
 const terminalView = await bottomBar.openTerminalView()
 const text = await terminalView.getText() // returns empty value

A temporary workaround:

 import clipboard from 'clipboardy'

 const workbench = await browser.getWorkbench()
 await workbench.executeCommand('Terminal select all')
 await workbench.executeCommand('Copy')

// Use the clipboard to get the copied text.
  const text = await clipboard.read()
  await clipboard.write('')
christian-bromann commented 1 year ago

Hey @degrammer

thanks for raising the issue.

I added a test for this in https://github.com/webdriverio-community/wdio-vscode-service/commit/3050417daeb14a61a9079095e2614369ebafb158. It seems that the way getText was implemented wasn't working anymore since the command for copying the text from the terminal was removed in VS Code. This is now fixed.