File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed
main/java/com/microsoft/playwright/impl
test/java/com/microsoft/playwright Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change 4040import static com .microsoft .playwright .impl .Utils .fromJsRegexFlags ;
4141
4242class Serialization {
43- private static final Gson gson = new GsonBuilder ()
43+ private static final Gson gson = new GsonBuilder (). disableHtmlEscaping ()
4444 .registerTypeAdapter (SameSiteAttribute .class , new SameSiteAdapter ().nullSafe ())
4545 .registerTypeAdapter (BrowserChannel .class , new ToLowerCaseAndDashSerializer <BrowserChannel >())
4646 .registerTypeAdapter (ColorScheme .class , new ToLowerCaseAndDashSerializer <ColorScheme >())
Original file line number Diff line number Diff line change @@ -139,6 +139,12 @@ void shouldFilterByRegexWithSpecialSymbols() {
139139 Pattern pattern = Pattern .compile ("first\\ /\" .*\" second\\ \\ $" , Pattern .CASE_INSENSITIVE );
140140 assertThat (page .locator ("div" , new Page .LocatorOptions ().setHasText (pattern ))).hasClass ("test" );
141141 }
142+ @ Test
143+ void shouldFilterByTextWithAmpersand () {
144+ page .setContent ("<div>Save & Continue</div>" );
145+ assertEquals ("Save & Continue" , page .locator ("div" ,
146+ new Page .LocatorOptions ().setHasText ("Save & Continue" )).textContent ());
147+ }
142148
143149 @ Test
144150 void shouldSupportHasLocator () {
You can’t perform that action at this time.
0 commit comments