Skip to content

Commit eff2b60

Browse files
feat: Allow extension capability keys to contain dot characters (#2271)
1 parent 3c5d12b commit eff2b60

File tree

2 files changed

+41
-1
lines changed

2 files changed

+41
-1
lines changed

src/main/java/io/appium/java_client/remote/options/W3CCapabilityKeys.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
public 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+
"^[\\w-\\.]+:.*$",
2727
"^acceptInsecureCerts$",
2828
"^browserName$",
2929
"^browserVersion$",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/*
2+
* Licensed under the Apache License, Version 2.0 (the "License");
3+
* you may not use this file except in compliance with the License.
4+
* See the NOTICE file distributed with this work for additional
5+
* information regarding copyright ownership.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.appium.java_client.remote.options;
18+
19+
import org.junit.jupiter.params.ParameterizedTest;
20+
import org.junit.jupiter.params.provider.CsvSource;
21+
22+
import static org.junit.jupiter.api.Assertions.assertEquals;
23+
24+
class BaseOptionsTest {
25+
26+
@ParameterizedTest
27+
@CsvSource({
28+
"test, appium:test",
29+
"appium:test, appium:test",
30+
"browserName, browserName",
31+
"digital.ai:accessKey, digital.ai:accessKey",
32+
"digital-ai:accessKey, digital-ai:accessKey",
33+
"digital-ai:my_custom-cap:xyz, digital-ai:my_custom-cap:xyz",
34+
"digital-ai:my_custom-cap?xyz, digital-ai:my_custom-cap?xyz",
35+
})
36+
void verifyW3CMapping(String capName, String expected) {
37+
var w3cName = BaseOptions.toW3cName(capName);
38+
assertEquals(expected, w3cName);
39+
}
40+
}

0 commit comments

Comments
 (0)