Skip to content
On this page

Advanced Options in BVT

This section highlights some of the advanced functionality available in BVT VS Code extension.

Exclusion of DOM Sub-trees

This functionality lets you define certain elements on your application page that should be omitted from the HTML document during processing. This comes in handy for lengthy pages that might potentially trigger server-side errors due to too many prompts.

To implement this functionality, create a ai_config.json file.

Example:

In the example given below, the document elements having IDs 'sticky-banner' and 'footer' will be bypassed.

json
{
  "domIgnore": ["#sticky-banner", "#footer"]
}

Page load timeout

The default page load timeout is 10 seconds (or 10000 milliseconds). To change the default timeout first create a ai_config.json file. You should add a page_timeout field with the timeout value in milliseconds.

Example:

In the example given below, changes the page load timeout to 60 seconds.

json
{
  "page_timeout": 60000
}

@protect Annotation

By adding @protect annotation to your function documentation, you can protect the steps definitions functions from overwriting by AI.

Example:

javascript
/**
 * Create a new repository name "<repo>", description "<description>", and README file
 * @param {string} repo repo
 * @param {string} description description
 * @protect
 */
const create_new_repository_with_description_and_readme = async (repo, description) => {
  ...
};

memory.json file

As guidelines for a specific page, the AI engine utilizes a memory file named .memory.json situated at the project's root directory.

As time progresses, the memory file can furnish the AI engine with a clearer understanding of the application being tested. Every unique URL path is allocated an entry with a default brief description of possible actions on that page.

You have the flexibility to modify this file and update the description. When doing this, switch the type from auto to manual.

Example:

json
{
  "paths": [
    {
      "pathKey": "/",
      "touchCount": 7,
      "validationCount": 1,
      "summary": "The GitHub webpage facilitates users to maneuver through the global menu, search for content, instantiate new items, and adjust user account configurations. It lists top repositories, recent events, and account specifics. Users can sieve updates, cancel alerts, and get acquainted with novel functionalities. The page also presents trending and suggested repositories, enabling users to favorite and enlist them. The footer features links to assorted segments like Blog, About, Shop, API, Training, among others. An 'Explore' segment delivers updates on the latest shifts and presents prominent repositories.",
      "type": "auto"
    },
    {
      "pathKey": "/new",
      "touchCount": 8,
      "validationCount": 1,
      "summary": "When instituting a new repository, it ought to be private.",
      "type": "manual"
    }
  ]
}

Modify role

The engine relly on accessibilty roles of elements. If for some reasons the element role is not configure you can do that by adding the following to the ai_config.json file.

Example:

In the example given below, changes gb-side-navigation-menu-item html tags to links, gb-toolbar-icon to buttons and push the gb-period-picker-panel tag to be first in the dump.

json
{
  "changes": [
    {
      "css": "gb-side-navigation-menu-item",
      "changes": {
        "role": "link"
      }
    },
    {
      "css": "gb-toolbar-icon",
      "changes": {
        "role": "button"
      }
    },
    {
      "css": "gb-period-picker-panel",
      "changes": {
        "order": "first"
      }
    }
  ]
}