Skip to content

Commit 86c660b

Browse files
committed
update kill command and revert to DriverManager to auto-find chrome installation
1 parent 1411153 commit 86c660b

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.kokoro/tests/run_tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ fi
116116

117117
# Install Chrome and chrome driver for recaptcha tests.
118118
current_dir="$PWD"
119-
pkill chrome
119+
ps aux | awk '/chrome/ { print $2 } ' | xargs kill -9
120120
# Install Chrome.
121121
curl https://dl-ssl.google.com/linux/linux_signing_key.pub -o /tmp/google.pub \
122122
&& cat /tmp/google.pub | apt-key add -; rm /tmp/google.pub \

recaptcha_enterprise/snippets/src/test/java/app/SnippetsIT.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import account_defender.ListRelatedAccountGroups;
2626
import account_defender.SearchRelatedAccountGroupMemberships;
2727
import com.google.protobuf.ByteString;
28+
import io.github.bonigarcia.wdm.WebDriverManager;
2829
import java.io.ByteArrayOutputStream;
2930
import java.io.IOException;
3031
import java.io.PrintStream;
@@ -95,11 +96,8 @@ public static void setUp() throws IOException, InterruptedException {
9596
TimeUnit.SECONDS.sleep(5);
9697

9798
// Set Selenium Driver to Chrome.
98-
ChromeOptions chromeOptions = new ChromeOptions().setBinary(CHROME_DRIVER_PATH);
99-
chromeOptions.addArguments("--no-sandbox");
100-
chromeOptions.addArguments("--headless");
101-
chromeOptions.addArguments("--disable-gpu");
102-
BROWSER = new ChromeDriver(chromeOptions);
99+
WebDriverManager.chromedriver().setup();
100+
BROWSER = new ChromeDriver();
103101
TimeUnit.SECONDS.sleep(5);
104102
}
105103

0 commit comments

Comments
 (0)