Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Playwright tests fail when using MudDatePicker with mask attribute

$
0
0

I use a MudDatePicker:

<MudDatePicker @ref="DateField"                           id="test"                                                          Label="test"                           Mask="@(new DateMask("dd.MM.yyyy"))"                           ErrorText="Date is invalid"                           Editable="true"                           Placeholder="Enter date"                           @bind-Date="@DateValue"                           Validation="@((DateTime? _) => _validationMessage)"                           Required="true"                           RequiredError="input is required."                                                          Converter="_dateTimeConverter"                           Margin="DefaultThemes.Margin"                           Variant="DefaultThemes.Variant"/>

With the attribute Mask the input field provides a masked input. If this is active Playwright will fill the field but it won't validate after submit telling that "input is required". If I remove the "mask" property it works as expected.

Is there a possibility to remove the mask property when testing with playwright?The difference in HTML looks this way:

<!-- without mask --><div                   class="mud-input mud-input-outlined mud-input-outlined-with-label mud-input-adorned-end mud-shrink mud-typography-input"><!-- with mask --><div id="mask6c1d8idn" class="mud-input mud-input-outlined mud-input-outlined-with-label mud-input-adorned-end mud-shrink mud-typography-input">

My idea was to remove the property 'id="mask6c1d8idn"' but even removing the property by hand doesnt make the masked input disappear.

Any help is appreciated.Thank you very much.


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>