ATF: Set Component Values (Custom UI) doesn't set input field properly

KunningL
Tera Contributor

In WashingtonDC version, and I created an ATF test to simply set value in a custom component and then perform submit action. However, I found the value wasn't set properly in now-input field. (see screenshots below)

For your note, manual test is working fine

 

Do you know how to solve this issue?

 

ATF test step using "Set Component Values (Custom UI)"

ATF_screenshot_1.png

After debugging, I found value was not set properly in <now-input> element

ATF_screenshot_2.png

1 ACCEPTED SOLUTION

KunningL
Tera Contributor

Hi @Shaqeel, I investigate into this issue. And I found "Set Component Values (Custom UI)" test step will run change & blur event, after setValue().

{
   key: "afterSetValue",
   value: function afterSetValue() {
     if (this.skipAfterSetValue || !this.element) return;
     var event = this.element.ownerDocument.createEvent("Event");
     event.initEvent("change", true, false);
     this.element.dispatchEvent(event);
     if (this.version.sendFocusEventForSetValue()) this.element.blur();
   }
}

 However, in my custom component, I only set "Input input" and "Input enter keydown" to set form data. This issue is resolved after I create a new event handler "Input invalid set" to handle blur event.

KunningL_0-1737744857472.png

 

View solution in original post

2 REPLIES 2

Shaqeel
Mega Sage

Hi @KunningL 

 

Can you share the result screenshot?

All looks good here.

 

Regards

Shaqeel


***********************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting "Accept as Solution" and " Helpful." This action benefits both the community and me.

***********************************************************************************************************************





Regards

Shaqeel

KunningL
Tera Contributor

Hi @Shaqeel, I investigate into this issue. And I found "Set Component Values (Custom UI)" test step will run change & blur event, after setValue().

{
   key: "afterSetValue",
   value: function afterSetValue() {
     if (this.skipAfterSetValue || !this.element) return;
     var event = this.element.ownerDocument.createEvent("Event");
     event.initEvent("change", true, false);
     this.element.dispatchEvent(event);
     if (this.version.sendFocusEventForSetValue()) this.element.blur();
   }
}

 However, in my custom component, I only set "Input input" and "Input enter keydown" to set form data. This issue is resolved after I create a new event handler "Input invalid set" to handle blur event.

KunningL_0-1737744857472.png