Skip to content

Commit b427695

Browse files
authored
Merge branch 'trunk' into release-preparation-4.28.0
2 parents d9615cb + 72d6341 commit b427695

File tree

1 file changed

+68
-0
lines changed

1 file changed

+68
-0
lines changed

java/test/org/openqa/selenium/grid/data/DefaultSlotMatcherTest.java

+68
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,74 @@ void fullMatch() {
6767
assertThat(slotMatcher.matches(stereotype, capabilities)).isTrue();
6868
}
6969

70+
@Test
71+
void fullMatchWithTestMetadata() {
72+
Capabilities stereotype =
73+
new ImmutableCapabilities(
74+
CapabilityType.BROWSER_NAME, "chrome", CapabilityType.PLATFORM_NAME, Platform.LINUX);
75+
Capabilities capabilities =
76+
new ImmutableCapabilities(
77+
CapabilityType.BROWSER_NAME,
78+
"chrome",
79+
CapabilityType.PLATFORM_NAME,
80+
Platform.LINUX,
81+
"se:name",
82+
"testName");
83+
assertThat(slotMatcher.matches(stereotype, capabilities)).isTrue();
84+
}
85+
86+
@Test
87+
void fullMatchWithVideoRecording() {
88+
Capabilities stereotype =
89+
new ImmutableCapabilities(
90+
CapabilityType.BROWSER_NAME,
91+
"chrome",
92+
CapabilityType.PLATFORM_NAME,
93+
Platform.LINUX,
94+
"se:noVncPort",
95+
7900,
96+
"se:vncEnabled",
97+
true,
98+
"se:containerName",
99+
"my-container");
100+
Capabilities capabilities =
101+
new ImmutableCapabilities(
102+
CapabilityType.BROWSER_NAME,
103+
"chrome",
104+
CapabilityType.PLATFORM_NAME,
105+
Platform.LINUX,
106+
"se:recordVideo",
107+
true,
108+
"se:screenResolution",
109+
"1920x1080");
110+
assertThat(slotMatcher.matches(stereotype, capabilities)).isTrue();
111+
}
112+
113+
@Test
114+
void notMatchWithTestMetadata() {
115+
Capabilities stereotype =
116+
new ImmutableCapabilities(
117+
CapabilityType.BROWSER_NAME,
118+
"chrome",
119+
CapabilityType.PLATFORM_NAME,
120+
Platform.LINUX,
121+
"myApp:version",
122+
"beta");
123+
Capabilities capabilities =
124+
new ImmutableCapabilities(
125+
CapabilityType.BROWSER_NAME,
126+
"chrome",
127+
CapabilityType.PLATFORM_NAME,
128+
Platform.LINUX,
129+
"se:recordVideo",
130+
true,
131+
"se:name",
132+
"testName",
133+
"myApp:version",
134+
"stable");
135+
assertThat(slotMatcher.matches(stereotype, capabilities)).isFalse();
136+
}
137+
70138
@Test
71139
void matchesBrowserAndVersion() {
72140
Capabilities stereotype =

0 commit comments

Comments
 (0)