1616
1717package com .microsoft .playwright .impl ;
1818
19- import com .microsoft .playwright .PlaywrightException ;
2019import org .opentest4j .AssertionFailedError ;
2120import org .opentest4j .ValueWrapper ;
2221
2928import static com .microsoft .playwright .impl .Utils .toJsRegexFlags ;
3029import static java .util .Arrays .asList ;
3130
32- class AssertionsBase {
33- final LocatorImpl actualLocator ;
31+ abstract class AssertionsBase {
3432 final boolean isNot ;
3533
36- AssertionsBase (LocatorImpl actual , boolean isNot ) {
37- this .actualLocator = actual ;
34+ AssertionsBase (boolean isNot ) {
3835 this .isNot = isNot ;
3936 }
4037
@@ -58,7 +55,7 @@ void expectImpl(String expression, FrameExpectOptions expectOptions, Object expe
5855 if (isNot ) {
5956 message = message .replace ("expected to" , "expected not to" );
6057 }
61- FrameExpectResult result = actualLocator . expect (expression , expectOptions , title );
58+ FrameExpectResult result = doExpect (expression , expectOptions , title );
6259 if (result .matches == isNot ) {
6360 Object actual = result .received == null ? null : Serialization .deserialize (result .received );
6461 String log = (result .log == null ) ? "" : String .join ("\n " , result .log );
@@ -75,7 +72,9 @@ void expectImpl(String expression, FrameExpectOptions expectOptions, Object expe
7572 }
7673 }
7774
78- private static ValueWrapper formatValue (Object value ) {
75+ abstract FrameExpectResult doExpect (String expression , FrameExpectOptions expectOptions , String title );
76+
77+ protected static ValueWrapper formatValue (Object value ) {
7978 if (value == null || !value .getClass ().isArray ()) {
8079 return ValueWrapper .create (value );
8180 }
0 commit comments