You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, Testbench @BrowserConfiguration does not work correctly with JUnit @Nested annotation that is meant to work with not-static inner classes.
The problem is that when BrowserExtension.evaluateExecutionCondition evaluates whether the test should run or not, it tries to compute the requested capabilities; if the test class has a method annotated with @BrowserConfiguration, that method is supposed to be invoked to get the list of capabilities.
However, when BrowserExtension.evaluateExecutionCondition is called, the JUnit test context does not yet have a reference to the test class instance (e.g. ExtensionContext.getTestInstance()), so Testbench tries to create a new instance by reflection calling the default no-args constructor, but it fails because it does not exist (inner classes always take the enclosing class instance as parameter).
To reproduce run the following test, that will fail because the @BrowserConfiguration gets not called
Currently, Testbench
@BrowserConfiguration
does not work correctly with JUnit@Nested
annotation that is meant to work with not-static inner classes.The problem is that when
BrowserExtension.evaluateExecutionCondition
evaluates whether the test should run or not, it tries to compute the requested capabilities; if the test class has a method annotated with@BrowserConfiguration
, that method is supposed to be invoked to get the list of capabilities.However, when
BrowserExtension.evaluateExecutionCondition
is called, the JUnit test context does not yet have a reference to the test class instance (e.g.ExtensionContext.getTestInstance()
), so Testbench tries to create a new instance by reflection calling the default no-args constructor, but it fails because it does not exist (inner classes always take the enclosing class instance as parameter).To reproduce run the following test, that will fail because the
@BrowserConfiguration
gets not calledIf you do the same on a top-level class, it works
The text was updated successfully, but these errors were encountered: