как настроить bitbucket-pipeline.yml для запуска тестов с Selenide-Selenoid?
использую стандартный пример с GitHub - selenide/selenide-selenoid: Selenoid plugin for Selenide для скачивания файла без ссылки
Локально, при использовании remote параметра, все работает прекрасно. Хочу скачивать файлы и на сервере. В качестве CI/CD использую Bitbucket
java-классы
@ExtendWith(SelenoidExtension.class)
public class FileDownloadTest {
@Test
void download() throws IOException {
open("/");
$("#byteCount").clear();
$("#byteCount").setValue("50");
$("#multiplier").selectOption("MiB");
File file = $("div.form-row button").download(withExtension("bin"));
assertThat(file.getName()).isEqualTo("50MiB.bin");
}
}
class SelenoidExtension implements BeforeAllCallback {
@Override
public void beforeAll(ExtensionContext context) {
Configuration.timeout = 10 * 1000L;
Configuration.remote = "http://selenoid:4444/wd/hub";
// Configuration.remote = "http://localhost:4444/wd/hub";
Configuration.screenshots = true;
Configuration.reportsFolder = "target/surefire-reports";
Configuration.downloadsFolder = "target/downloads";
Configuration.fileDownload = FileDownloadMode.FOLDER;
Configuration.baseUrl = "https://fastest.fish/test-files";
}
}
pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.selenide.examples</groupId>
<artifactId>selenoid-sample</artifactId>
<version>1.0-SNAPSHOT</version>
<build>
<defaultGoal>clean test</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M7</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>3.0.0-M7</version>
</plugin>
</plugins>
</build>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.9.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.selenide</groupId>
<artifactId>selenide-selenoid</artifactId>
<version>2.3.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>3.23.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>2.0.6</version>
<scope>test</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>snapshots-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases><enabled>false</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</project>
bitbucket-pipeline.yml
image: maven:3.8.5-openjdk-17-slim
pipelines:
branches:
acceptance:
- step:
name: Acceptance
services:
- selenoid
caches:
- maven
script:
- mvn test
definitions:
services:
selenoid:
image: selenoid/chrome:108.0
pipeline падает вот с такой ошибкой
Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Host info: host: 'd28b5294-cf58-4b6b-b1ea-f674cb5f2c0e-25wcd', ip: '10.39.87.164'
Build info: version: '4.7.2', revision: '4d4020c3b7'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-1028-aws', java.version: '17.0.2'
selenide.remote: http://selenoid:4444/wd/hub
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--proxy-bypass-list=<-loopb..., --disable-dev-shm-usage, --no-sandbox, --window-size=1366,768], excludeSwitches: [enable-automation, load-extension], extensions: [], prefs: {credentials_enable_service: false, plugins.always_open_pdf_externally: true, profile.default_content_setting_values.automatic_downloads: 1, safebrowsing.enabled: true}}, pageLoadStrategy: normal, unhandledPromptBehavior: accept}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--proxy-bypass-list=<-loopb..., --disable-dev-shm-usage, --no-sandbox, --window-size=1366,768], excludeSwitches: [enable-automation, load-extension], extensions: [], prefs: {credentials_enable_service: false, plugins.always_open_pdf_externally: true, profile.default_content_setting_values.automatic_downloads: 1, safebrowsing.enabled: true}}, pageLoadStrategy: normal, unhandledPromptBehavior: accept}}]
selenide.url: https://fastest.fish/test-files/
Capabilities {}
selenide.baseUrl: https://fastest.fish/test-files
org.openqa.selenium.SessionNotCreatedException:
Could not start a new session. Possible causes are invalid address of the remote server or browser start-up failure.
Host info: host: 'd28b5294-cf58-4b6b-b1ea-f674cb5f2c0e-25wcd', ip: '10.39.87.164'
Build info: version: '4.7.2', revision: '4d4020c3b7'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '5.15.0-1028-aws', java.version: '17.0.2'
selenide.remote: http://selenoid:4444/wd/hub
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Command: [null, newSession {capabilities=[Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--proxy-bypass-list=<-loopb..., --disable-dev-shm-usage, --no-sandbox, --window-size=1366,768], excludeSwitches: [enable-automation, load-extension], extensions: [], prefs: {credentials_enable_service: false, plugins.always_open_pdf_externally: true, profile.default_content_setting_values.automatic_downloads: 1, safebrowsing.enabled: true}}, pageLoadStrategy: normal, unhandledPromptBehavior: accept}], desiredCapabilities=Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [--proxy-bypass-list=<-loopb..., --disable-dev-shm-usage, --no-sandbox, --window-size=1366,768], excludeSwitches: [enable-automation, load-extension], extensions: [], prefs: {credentials_enable_service: false, plugins.always_open_pdf_externally: true, profile.default_content_setting_values.automatic_downloads: 1, safebrowsing.enabled: true}}, pageLoadStrategy: normal, unhandledPromptBehavior: accept}}]
selenide.url: https://fastest.fish/test-files/
Capabilities {}
selenide.baseUrl: https://fastest.fish/test-files
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:553)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:228)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:156)
at com.codeborne.selenide.webdriver.RemoteDriverFactory.create(RemoteDriverFactor