Skip to content

Test select

Example#

preview

Code-example#

<measmatic-card highlight-header>
  <measmatic-test-select data-id=control1Id1></measmatic-test-select>
  <measmatic-test-select data-id=control1Id2></measmatic-test-select>
  <measmatic-test-select data-id=control1Id3 pass=true></measmatic-test-select>
  <measmatic-test-select data-id=control1Id4 pass=false></measmatic-test-select>
  <measmatic-test-select data-id=control1Id5 disabled></measmatic-test-select>
</measmatic-card>

Description#

This custom-element creates a control to select a test and executes all child tests within when the selected has passed/failed.

The selectable values are read from window.testList.testList. Update the list by calling TestListUpdated(testList).

Usage#

Attributes#

Necessary#

<measmatic-test-select data-id='control1Id'>
Measmatic needs an data-id in this element to initialize the control properly.

Optional#
<measmatic-test-select data-id='control1Id' pass="false">

pass="false" will set the default of the select-element to fails

<measmatic-test-select data-id='control1Id' disabled>

disabled disables both select-elements. The attribute can be added or removed at any time.

Properties of interest

  • testName gets name of the selected test
  • testGuid gets guid of the selected test
  • testPass gets/sets if the selected test should pass or fail to execute subtests
  • testObject gets/sets Object containing testName and testGuid of selected test
  • disabled gets/sets if the select-elements are disabled

Export

  • exports testName, testGuid and testPass