This PR updates the logic to select the correct input/select element for the specified label to support config options without an help text (e.g. "Enable Evergreen Subscriptions").
This PR uses the following logic to select the correct input:
Find the label containing the specified label text
Traverse to the ancestor th element with class labelCol
Go to the first sibling td element with class dataCol or data2Col
Select the first child input or select element
The selection of the current and target picklist values uses the following logic:
Current value: Get the value property of the input and select the option by using this property.
Target value: Get the option element by using the display value and then get the value property of the element. Afterwards the input is updated by using the select() method and specifying the target value.
Additionally, I have added a check to look for options which cannot be updated (disabled controls). If the target value does not match the existing value an error is logged.
This is necessary because you cannot deactivate the "Enable Evergreen Subscriptions" checkbox after it is enabled. Maybe this applies to other controls as well. Therefore I have added this check for all controls.
Fixes #145
This PR updates the logic to select the correct
input
/select
element for the specified label to support config options without an help text (e.g. "Enable Evergreen Subscriptions").This PR uses the following logic to select the correct input:
th
element with classlabelCol
td
element with classdataCol
ordata2Col
input
orselect
elementThe selection of the current and target picklist values uses the following logic:
value
property of the input and select the option by using this property.value
property of the element. Afterwards the input is updated by using theselect()
method and specifying the target value.Additionally, I have added a check to look for options which cannot be updated (disabled controls). If the target value does not match the existing value an error is logged. This is necessary because you cannot deactivate the "Enable Evergreen Subscriptions" checkbox after it is enabled. Maybe this applies to other controls as well. Therefore I have added this check for all controls.