vscode-extension-tester: [Bug] Not able to find setting `extension-id.title.path`

**Trying to get a setting defined as extension-id.title.path, unable to do so using function **

  • Sample code used:
      const settingsEditor = await workbench.openSettings();
      const setting = await settingsEditor.findSetting(
        "Path",
        "Extension_ID",
        "Title"
      );

Steps to Reproduce

  1. Define a setting in package.json as below:
{
  "contributes": {
    "configuration": [
       {
         "title": "Miscellaneous",
         "properties": {
           "extension-id.title.path": {
            "type": "string",
            "default": null,
            "description": "Path to SDK",
            "scope": "machine-overridable",
            "order": 0
          }
         }
       }
    ]
  }
}
  1. Set the property, make sure it is not set to undefined.
  2. Define a test where you try to call the setting using the following code.
      const workbench = new Workbench();
      const settingsEditor = await workbench.openSettings();
      const setting = await settingsEditor.findSetting(
        "Path",
        "Extension-id",
        "Title"
      );
      await workbench.getDriver().sleep(10000);
      const value = await setting.getValue();

Expected behavior

  • The setting should be defined, but it shows up as undefined.

Environment information

  • OS:
    • Windows
  • VSCode version: 1.77.3
  • ExTester version: 5.5.3
  • Node (npm) version: 9.6.6

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 16

Most upvoted comments

Hello @ashish-gawali-adi, I am sorry for such a late response. I had to slowdown for a while on this project so I am now catching up things here again.

anyway… thank you for your sample project. I tried locally and I was able to reproduce that test is failing because the vscode settings filter, in this case of similar naming in settings definitions, is not working very well and I was not able even manually to achieve results where I would get only one requested setting which I was looking for…

so for this cases I have implemented new method which will enable to use setting ID to filter results. I hope it will suits your needs and unlock your testing project.

It is working for one of the setting I have but not another, the one it is not working on, I think it might be due to the setting not being on the visible part of screen. I am trying to work on an example and will try and post a link to the project so you can have a look at the code by Wednesday at the latest.

I was able to figure it out, it was due to the tsconfig.json, you need to set compilerOptions.module to Node16