File tree Expand file tree Collapse file tree
main/java/io/appium/java_client/remote/options
test/java/io/appium/java_client/remote/options Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2323public class W3CCapabilityKeys implements Predicate <String > {
2424 public static final W3CCapabilityKeys INSTANCE = new W3CCapabilityKeys ();
2525 private static final Predicate <String > ACCEPTED_W3C_PATTERNS = Stream .of (
26- "^[\\ w- ]+:.*$" ,
26+ "^[^: ]+:.*$" ,
2727 "^acceptInsecureCerts$" ,
2828 "^browserName$" ,
2929 "^browserVersion$" ,
Original file line number Diff line number Diff line change 1+ package io .appium .java_client .remote .options ;
2+
3+ import static org .junit .jupiter .api .Assertions .*;
4+
5+ import org .junit .jupiter .params .ParameterizedTest ;
6+ import org .junit .jupiter .params .provider .CsvSource ;
7+
8+ class BaseOptionsTest {
9+
10+
11+ @ ParameterizedTest
12+ @ CsvSource ({
13+ "test, appium:test" ,
14+ "appium:test, appium:test" ,
15+ "browserName, browserName" ,
16+ "digital.ai:accessKey, digital.ai:accessKey" ,
17+ "digital-ai:accessKey, digital-ai:accessKey" ,
18+ "<VENDOR-KEY>:<CAP-NAME>:<SUB-CAP-NAME>, <VENDOR-KEY>:<CAP-NAME>:<SUB-CAP-NAME>" ,
19+ "digital-ai:my_custom-cap:xyz, digital-ai:my_custom-cap:xyz" ,
20+ "digital-ai:my_custom-cap?xyz, digital-ai:my_custom-cap?xyz" ,
21+ })
22+ void verifyW3CMapping (String capName , String expected ) {
23+ var w3cName = BaseOptions .toW3cName (capName );
24+ assertEquals (expected , w3cName );
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments