OpenLiberty / liberty-tools-vscode

Visual Studio Code extension for Liberty Tools
https://marketplace.visualstudio.com/items?itemName=Open-Liberty.liberty-dev-vscode-ext
Eclipse Public License 2.0
17 stars 34 forks source link

Explore framework options for Liberty-tools-vcode Integration testing #225

Closed vkavitha closed 1 year ago

vkavitha commented 1 year ago

Exploring framework options for liberty-tools-vscode integration testing

1. vscode-extension-tester

2. webdriverio

3. Basic extension suite that comes with vscode

dselvara2 commented 1 year ago

Default test suite that comes along with VScode

  1. Added the test compile/run scripts to the package.json file.
  2. Upgraded certain libraries which had an issue during the test compilation
  3. Added the sample starter io project to launch.json so that it gets opened when the extension is launched
  4. Ran the default tests - which basically launches the extension and runs the hello world test

Post above tasks, when I started looking for ways to access the views/sections in the extension to get access to the UI objects, there was not much information available on the same. So moved on to vscode-extenstion-tester which had the paging objects, makes it easier to work with extension UI.

dselvara2 commented 1 year ago

vscode-extension-tester

  1. Used the same test compile instructions as before
  2. Added the sample starter-io to the src/test folder
  3. Used openResources API to open the sample project when the extension launches
  4. Further using the paging objects like Bars, Sections, Views, Items was able to get hold of the "Liberty Dashboard" section and the "inventory" project item. (60 secs delay in the test to load the project in the libery dashboard)

Observations

Comparatively easier than the default test suite approach w.r.to the access to UI objects. There are some inconsistencies when we run the tests repeatedly. need to check why is that.

image (9)

Project -

src.zip otherfiles.zip

log generated in the debug console- log.txt

reference (steps) - https://developers.redhat.com/blog/2019/11/18/new-tools-for-automating-end-to-end-tests-for-vs-code-extensions

vkavitha commented 1 year ago

For Mac as well, Basic vscode-extension-tester setup, test trial is done one minor issue <specific to my Mac setup , documenting here for any future reference >

1.vcode tester gets the manifest.json from ” https://raw.githubusercontent.com/Microsoft/vscode/1.75.1/cgmanifest.json” to get the compatible chromium driver to install

  1. IP of this URL is coming as wrong value and hence the wget is timing out “https://github.com/orgs/community/discussions/32889” From above, it appears that 185.199.108.133 raw.githubusercontent.com is the working IP for the URL I mapped it in /etc/hosts as a workaround, reported it to the extension tester group as an issue and now wget of json and subsequent steps went fine!
TrevCraw commented 1 year ago

Closing as test automation has been implemented using vscode-extension-tester framework.