Skip to content

Commit 6f0f3e9

Browse files
committed
Add a stress test for the new grid
1 parent 84852b5 commit 6f0f3e9

File tree

8 files changed

+574
-420
lines changed

8 files changed

+574
-420
lines changed

java/client/test/org/openqa/selenium/testing/drivers/BUILD.bazel

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ java_library(
1515
"//java/client/src/org/openqa/selenium/edge",
1616
"//java/client/src/org/openqa/selenium/edgehtml",
1717
"//java/client/src/org/openqa/selenium/firefox",
18+
"//java/client/src/org/openqa/selenium/firefox/xpi",
1819
"//java/client/src/org/openqa/selenium/ie",
1920
"//java/client/src/org/openqa/selenium/opera",
2021
"//java/client/src/org/openqa/selenium/remote",

java/client/test/org/openqa/selenium/testing/drivers/Browser.java

+26-12
Original file line numberDiff line numberDiff line change
@@ -19,38 +19,48 @@
1919

2020
import org.openqa.selenium.Capabilities;
2121
import org.openqa.selenium.ImmutableCapabilities;
22+
import org.openqa.selenium.chrome.ChromeDriverInfo;
2223
import org.openqa.selenium.chrome.ChromeOptions;
24+
import org.openqa.selenium.edge.EdgeDriverInfo;
2325
import org.openqa.selenium.edge.EdgeOptions;
26+
import org.openqa.selenium.edgehtml.EdgeHtmlDriverInfo;
2427
import org.openqa.selenium.edgehtml.EdgeHtmlOptions;
2528
import org.openqa.selenium.firefox.FirefoxOptions;
29+
import org.openqa.selenium.firefox.GeckoDriverInfo;
30+
import org.openqa.selenium.firefox.xpi.XpiDriverInfo;
31+
import org.openqa.selenium.ie.InternetExplorerDriverInfo;
2632
import org.openqa.selenium.ie.InternetExplorerOptions;
33+
import org.openqa.selenium.opera.OperaDriverInfo;
2734
import org.openqa.selenium.opera.OperaOptions;
2835
import org.openqa.selenium.remote.BrowserType;
36+
import org.openqa.selenium.safari.SafariDriverInfo;
2937
import org.openqa.selenium.safari.SafariOptions;
3038

3139
import java.util.logging.Logger;
3240

3341
import static org.openqa.selenium.remote.CapabilityType.BROWSER_NAME;
3442

3543
public enum Browser {
36-
ALL(new ImmutableCapabilities(), false),
37-
CHROME(new ChromeOptions(), true),
38-
EDGE_HTML(new EdgeHtmlOptions(), false),
39-
EDGIUM(new EdgeOptions(), true),
40-
HTMLUNIT(new ImmutableCapabilities(BROWSER_NAME, BrowserType.HTMLUNIT), false),
41-
LEGACY_FIREFOX_XPI(new FirefoxOptions().setLegacy(true), false),
42-
IE(new InternetExplorerOptions(), false),
43-
FIREFOX(new FirefoxOptions(), false),
44-
LEGACY_OPERA(new OperaOptions(), false),
45-
OPERA(new OperaOptions(), false),
46-
SAFARI(new SafariOptions(), false);
44+
ALL(new ImmutableCapabilities(), "any", false),
45+
CHROME(new ChromeOptions(), new ChromeDriverInfo().getDisplayName(), true),
46+
EDGE_HTML(new EdgeHtmlOptions(), new EdgeHtmlDriverInfo().getDisplayName(), false),
47+
EDGIUM(new EdgeOptions(), new EdgeDriverInfo().getDisplayName(), true),
48+
HTMLUNIT(new ImmutableCapabilities(BROWSER_NAME, BrowserType.HTMLUNIT), "HtmlUnit", false),
49+
LEGACY_FIREFOX_XPI(new FirefoxOptions().setLegacy(true), new XpiDriverInfo().getDisplayName(), false),
50+
IE(new InternetExplorerOptions(), new InternetExplorerDriverInfo().getDisplayName(), false),
51+
FIREFOX(new FirefoxOptions(), new GeckoDriverInfo().getDisplayName(), false),
52+
LEGACY_OPERA(new OperaOptions(), new OperaDriverInfo().getDisplayName(), false),
53+
OPERA(new OperaOptions(), new OperaDriverInfo().getDisplayName(), false),
54+
SAFARI(new SafariOptions(), new SafariDriverInfo().getDisplayName(), false);
4755

4856
private static final Logger log = Logger.getLogger(Browser.class.getName());
4957
private final Capabilities canonicalCapabilities;
58+
private final String displayName;
5059
private final boolean supportsCdp;
5160

52-
Browser(Capabilities canonicalCapabilities, boolean supportsCdp) {
61+
Browser(Capabilities canonicalCapabilities, String displayName, boolean supportsCdp) {
5362
this.canonicalCapabilities = ImmutableCapabilities.copyOf(canonicalCapabilities);
63+
this.displayName = displayName;
5464
this.supportsCdp = supportsCdp;
5565
}
5666

@@ -89,6 +99,10 @@ public boolean supportsCdp() {
8999
return supportsCdp;
90100
}
91101

102+
public String displayName() {
103+
return displayName;
104+
}
105+
92106
public Capabilities getCapabilities() {
93107
return canonicalCapabilities;
94108
}

java/server/test/org/openqa/selenium/grid/router/BUILD.bazel

+43-39
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,67 @@
11
load("@rules_jvm_external//:defs.bzl", "artifact")
22
load("//java:defs.bzl", "java_selenium_test_suite", "java_test_suite")
3+
load("//java/client/src/org/openqa/selenium/devtools:versions.bzl", "CDP_DEPS")
34

45
LARGE_TESTS = [
56
"DistributedCdpTest.java",
67
"NewSessionCreationTest.java",
8+
"StressTest.java",
79
]
810

11+
java_library(
12+
name = "support",
13+
srcs = [
14+
"DeploymentTypes.java",
15+
],
16+
javacopts = [
17+
"--release",
18+
"11",
19+
],
20+
testonly = True,
21+
deps = [
22+
"//java/client/src/org/openqa/selenium:core",
23+
"//java/client/src/org/openqa/selenium/json",
24+
"//java/client/src/org/openqa/selenium/remote/http",
25+
"//java/client/src/org/openqa/selenium/support",
26+
"//java/client/test/org/openqa/selenium/testing:test-base",
27+
"//java/server/src/org/openqa/selenium/grid",
28+
],
29+
runtime_deps = [
30+
artifact("org.slf4j:slf4j-jdk14"),
31+
],
32+
)
33+
934
java_selenium_test_suite(
1035
name = "large-tests",
1136
size = "large",
37+
browsers = [
38+
"chrome",
39+
# "firefox",
40+
],
41+
tags = [
42+
"no-remote",
43+
],
1244
srcs = LARGE_TESTS,
1345
deps = [
14-
"//java/client/src/org/openqa/selenium:core",
46+
":support",
1547
"//java/client/src/org/openqa/selenium/chrome",
1648
"//java/client/src/org/openqa/selenium/devtools",
1749
"//java/client/src/org/openqa/selenium/firefox",
1850
"//java/client/src/org/openqa/selenium/json",
1951
"//java/client/src/org/openqa/selenium/remote",
20-
"//java/client/src/org/openqa/selenium/remote/http",
2152
"//java/client/src/org/openqa/selenium/support",
2253
"//java/client/test/org/openqa/selenium/remote/tracing:tracing-support",
2354
"//java/client/test/org/openqa/selenium/testing:annotations",
24-
"//java/client/test/org/openqa/selenium/testing/drivers",
55+
"//java/client/test/org/openqa/selenium/testing:test-base",
2556
"//java/server/src/org/openqa/selenium/grid",
26-
"//java/server/src/org/openqa/selenium/grid/commands",
27-
"//java/server/src/org/openqa/selenium/grid/distributor/httpd",
28-
"//java/server/src/org/openqa/selenium/grid/security",
29-
"//java/server/src/org/openqa/selenium/grid/sessionmap/httpd",
30-
"//java/server/src/org/openqa/selenium/grid/sessionqueue/httpd",
3157
"//java/server/test/org/openqa/selenium/grid/testing",
3258
artifact("com.google.guava:guava"),
3359
artifact("junit:junit"),
3460
artifact("org.assertj:assertj-core"),
61+
] + CDP_DEPS,
62+
javacopts = [
63+
"--release",
64+
"11",
3565
],
3666
)
3767

@@ -42,43 +72,17 @@ java_test_suite(
4272
["*Test.java"],
4373
exclude = LARGE_TESTS,
4474
),
75+
tags = [
76+
"requires-network",
77+
],
4578
deps = [
46-
"//java/client/src/org/openqa/selenium:core",
79+
":support",
4780
"//java/client/src/org/openqa/selenium/json",
4881
"//java/client/src/org/openqa/selenium/remote",
4982
"//java/client/src/org/openqa/selenium/support",
5083
"//java/client/test/org/openqa/selenium/remote/tracing:tracing-support",
5184
"//java/client/test/org/openqa/selenium/testing:test-base",
52-
"//java/server/src/org/openqa/selenium/events",
53-
"//java/server/src/org/openqa/selenium/events/local",
54-
"//java/server/src/org/openqa/selenium/events/zeromq",
55-
"//java/server/src/org/openqa/selenium/grid/commands",
56-
"//java/server/src/org/openqa/selenium/grid/component",
57-
"//java/server/src/org/openqa/selenium/grid/config",
58-
"//java/server/src/org/openqa/selenium/grid/data",
59-
"//java/server/src/org/openqa/selenium/grid/distributor",
60-
"//java/server/src/org/openqa/selenium/grid/distributor/httpd",
61-
"//java/server/src/org/openqa/selenium/grid/distributor/local",
62-
"//java/server/src/org/openqa/selenium/grid/distributor/remote",
63-
"//java/server/src/org/openqa/selenium/grid/jmx",
64-
"//java/server/src/org/openqa/selenium/grid/node",
65-
"//java/server/src/org/openqa/selenium/grid/node/httpd",
66-
"//java/server/src/org/openqa/selenium/grid/node/local",
67-
"//java/server/src/org/openqa/selenium/grid/router",
68-
"//java/server/src/org/openqa/selenium/grid/router/httpd",
69-
"//java/server/src/org/openqa/selenium/grid/security",
70-
"//java/server/src/org/openqa/selenium/grid/server",
71-
"//java/server/src/org/openqa/selenium/grid/sessionmap",
72-
"//java/server/src/org/openqa/selenium/grid/sessionmap/httpd",
73-
"//java/server/src/org/openqa/selenium/grid/sessionmap/local",
74-
"//java/server/src/org/openqa/selenium/grid/sessionmap/remote",
75-
"//java/server/src/org/openqa/selenium/grid/sessionqueue",
76-
"//java/server/src/org/openqa/selenium/grid/sessionqueue/config",
77-
"//java/server/src/org/openqa/selenium/grid/sessionqueue/httpd",
78-
"//java/server/src/org/openqa/selenium/grid/sessionqueue/local",
79-
"//java/server/src/org/openqa/selenium/grid/sessionqueue/remote",
80-
"//java/server/src/org/openqa/selenium/grid/web",
81-
"//java/server/src/org/openqa/selenium/netty/server",
85+
"//java/server/src/org/openqa/selenium/grid",
8286
"//java/server/test/org/openqa/selenium/grid/testing",
8387
artifact("com.google.guava:guava"),
8488
artifact("io.opentelemetry:opentelemetry-api"),

0 commit comments

Comments
 (0)