webdriverio-community / wdio-vscode-service

A service to test VSCode extensions from end to end using WebdriverIO

Home Page:https://webdriverio-community.github.io/wdio-vscode-service/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terminal getText not working correctly

degrammer opened this issue · comments

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('')

Hey @degrammer

thanks for raising the issue.

I added a test for this in 3050417. 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.