Skip to content

Commit

Permalink
Merge pull request #2292 from selenide/merge-selenide-selenoid
Browse files Browse the repository at this point in the history
Merge selenide selenoid
  • Loading branch information
asolntsev committed May 23, 2023
2 parents e71efbe + 4c26ebd commit a970b6a
Show file tree
Hide file tree
Showing 26 changed files with 887 additions and 6 deletions.
24 changes: 23 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,10 +214,32 @@ jobs:
build/reports/
appium.log
run-selenoid-tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
cache: 'gradle'
java-version: '11'
- name: Start selenoid
uses: Xotabu4/selenoid-github-action@v2
- name: Run integration tests
uses: gradle/gradle-build-action@v2
with:
arguments: :modules:selenoid:selenoidTests
- uses: actions/upload-artifact@v3
if: failure()
with:
name: test-report-selenoid
path: build/reports/

auto-merge-dependabot:
name: 🤖 Auto merge dependabot PR
timeout-minutes: 10
needs: [run-tests-on-linux, run-tests-on-windows, run-android-tests, run-ios-tests]
needs: [run-tests-on-linux, run-tests-on-windows, run-android-tests, run-ios-tests, run-selenoid-tests]
if: ${{ github.actor == 'dependabot[bot]' }}
runs-on: ubuntu-latest
permissions:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public void login() {
Look for [detailed comparison of Selenide and Selenium WebDriver API](https://github.com/selenide/selenide/wiki/Selenide-vs-Selenium).

#### Selenide for mobile apps
You can use Selenide for testing mobile applications. See plugin [selenide-appium](https://github.com/selenide/selenide/tree/main/modules/selenide-appium).
You can use Selenide for testing mobile applications. See plugin [selenide-appium](https://github.com/selenide/selenide/tree/main/modules/appium).

#### Selenide with Selenoid
You can use Selenide for running tests in Selenoid containers. See plugin [selenide-selenoid](https://github.com/selenide/selenide-selenoid).
You can use Selenide for running tests in Selenoid containers. See plugin [selenide-selenoid](https://github.com/selenide/selenide/tree/main/modules/selenoid).


## Changelog
Expand Down
1 change: 1 addition & 0 deletions gradle/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
ext {
seleniumVersion = '4.9.1'
httpClientVersion = '5.2.1'
junitVersion = '5.9.3'
jettyVersion = '9.4.51.v20230217'
nettyVersion = '4.1.92.Final'
Expand Down
11 changes: 11 additions & 0 deletions gradle/tests.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
subprojects {
tasks.withType(Test).configureEach {
include 'com/codeborne/selenide/**/*'
include 'org/selenide/**/*'
}

tasks.register("ie", Test) {
Expand All @@ -10,13 +11,15 @@ subprojects {
exclude '**/AlertText.*'
exclude '**/ConfirmTest.*'
exclude 'com/codeborne/selenide/**/*'
exclude 'org/selenide/**/*'
outputs.upToDateWhen {false}
}

tasks.register("edge", Test) {
systemProperties['selenide.browser'] = 'edge'
include 'integration/**/*'
exclude 'com/codeborne/selenide/**/*'
exclude 'org/selenide/**/*'
outputs.upToDateWhen {false}
}

Expand All @@ -25,13 +28,15 @@ subprojects {
systemProperties['selenide.headless'] = 'true'
include 'integration/**/*'
exclude 'com/codeborne/selenide/**/*'
exclude 'org/selenide/**/*'
outputs.upToDateWhen {false}
}

tasks.register("chrome", Test) {
systemProperties['selenide.browser'] = 'chrome'
include 'integration/**/*'
exclude 'com/codeborne/selenide/**/*'
exclude 'org/selenide/**/*'
outputs.upToDateWhen {false}
}

Expand All @@ -40,6 +45,7 @@ subprojects {
systemProperties['selenide.headless'] = 'true'
include 'integration/**/*'
exclude 'com/codeborne/selenide/**/*'
exclude 'org/selenide/**/*'
outputs.upToDateWhen {false}
}

Expand All @@ -48,13 +54,15 @@ subprojects {
systemProperties['selenide.browser'] = 'chrome'
include 'integration/**/*'
exclude 'com/codeborne/selenide/**/*'
exclude 'org/selenide/**/*'
outputs.upToDateWhen {false}
}

tasks.register("firefox", Test) {
systemProperties['selenide.browser'] = 'firefox'
include 'integration/**/*'
exclude 'com/codeborne/selenide/**/*'
exclude 'org/selenide/**/*'
outputs.upToDateWhen {false}
}

Expand All @@ -63,13 +71,15 @@ subprojects {
systemProperties['selenide.headless'] = 'true'
include 'integration/**/*'
exclude 'com/codeborne/selenide/**/*'
exclude 'org/selenide/**/*'
outputs.upToDateWhen {false}
}

tasks.register("safari", Test) {
systemProperties['selenide.browser'] = 'safari'
include 'integration/**/*'
exclude 'com/codeborne/selenide/**/*'
exclude 'org/selenide/**/*'
maxParallelForks = 1
outputs.upToDateWhen {false}
}
Expand All @@ -79,6 +89,7 @@ subprojects {
systemProperties['selenide.browser'] = 'firefox'
include 'integration/**/*'
exclude 'com/codeborne/selenide/**/*'
exclude 'org/selenide/**/*'
outputs.upToDateWhen {false}
}

Expand Down
2 changes: 1 addition & 1 deletion modules/appium/CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
== Changelog

=== 6.15.0 (released 2x.06.2023)
=== 6.15.0 (released 2x.05.2023)
Project "selenide-appium" was merged into project "selenide".

=== 2.8.1 (released 22.05.2023)
Expand Down
2 changes: 1 addition & 1 deletion modules/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ dependencies {
exclude group: 'org.slf4j'
}
implementation('org.apache.commons:commons-compress:1.23.0') {because 'used by webdrivermanager'}
implementation('org.apache.httpcomponents.client5:httpclient5:5.2.1')
implementation("org.apache.httpcomponents.client5:httpclient5:$httpClientVersion")

compileOnly("com.github.valfirst.browserup-proxy:browserup-proxy-core:$browserupProxyVersion")
compileOnly("xyz.rogfam:littleproxy:$littleProxyVersion")
Expand Down
95 changes: 95 additions & 0 deletions modules/selenoid/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# Changelog

## 6.15.0 (released 2x.05.2023)
Project "selenide-selenoid" was merged into project "selenide".

## 2.3.7 (released 15.05.2023)
* Make the method $.download() wait for the full completion of download #19
* #24 #26 bump Selenide from 6.12.4 to 6.14.1

## 2.3.6 (released 22.03.2023)
* bump Selenide from 6.11.1 to 6.12.4
* bump slf4j from 2.0.6 to 2.0.7

## 2.3.5 (released 23.01.2023)
* declare Selenide dependency with `api` scope
* upgrade to Selenide 6.11.1
* update dependencies

## 2.3.4 (released 03.01.2023)
* upgrade to Selenide 6.11.0

## 2.3.3 (released 08.12.2022)
* upgrade to Selenide 6.10.2

## 2.3.2
* upgrade to Selenide 6.10.0

## 2.3.1
* upgrade to Selenide 6.9.0

## 2.3.0 (released 27.09.2022)
* upgrade to Selenide 6.8.0

## 2.2.4 (released 14.08.2022)
* upgrade to Selenide 6.7.2
* #20 fix reading multiline clipboard content

## 2.2.3 (released 20.05.2022)
* upgrade to Selenide 6.5.0

## 2.2.2 (released 16.05.2022)
* #13 Now selenide-selenoid doesn't fetch `selenide-proxy` as transitive dependency, only `selenide`.
* upgrade to Selenide 6.4.0

## 2.2.1 (released 16.02.2022)
* upgrade to Selenide 6.3.2

## 2.2.0 (released 07.02.2022)
* upgrade to Selenide 6.3.0
* upgrade to Selenium webdriver 4.1.2

## 2.1.0 (released 24.11.2021)
* upgrade to Selenide 6.1.0
* upgrade to Selenium webdriver 4.1.0

## 2.0.0 (released 25.10.2021)
* upgrade to Selenide 6.0.0
* upgrade to Selenium webdriver 4.0.0

## 1.2.0 (released 28.09.2021)
* upgrade to Selenide 5.25.0

## 1.1.7 (released 13.09.2021)
* add Selenide and other dependencies

## 1.1.6 (released 13.09.2021)
* upgrade to Selenide 5.24.3

## 1.1.5 (released 29.08.2021)
* upgrade to Selenide 5.24.0

## 1.1.4 (released 17.07.2021)
* upgrade to Selenide 5.23.0

## 1.1.3 (released 08.06.2021)
* #10 fix ClassCastException when using EventFiringDriver
* #10 upgrade to Selenide 5.22.0

## 1.1.2 (released 11.05.2021)
* #9 add support for BasicAuth when downloading files from Selenoid

## 1.1.1 (released 23.04.2021)
* upgrade to Selenide 5.20.4
* upgrade to Gradle 7.0

## 1.1.0 (released 20.03.2021)
* #6 Added get & set clipboard methods -- thanks to Dmitriy Budim
* upgrade to Selenide 5.20.0

## 1.0.1 (released 29.01.2021)
* #4 Support local browsers too
* upgrade to Selenide 5.18.0

## 1.0.0 (released 20.11.2020)
* initial version
26 changes: 26 additions & 0 deletions modules/selenoid/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# How to run tests

## Running unit-tests
> ./gradlew test
## Running integration tests
> ./gradlew selenoidTests
To run browser tests, you need to have Selenoid installed.
Also, we assume you have file `~/.aerokube/selenoid/browsers.json` with such a block:

```json
{
"chrome": {
"default": "chrome",
"versions": {
"100.0": {
"image": "sskorol/selenoid_chromium_vnc:100.0",
"port": "4444",
"path": "/",
"privileged": true
}
}
}
}
```
50 changes: 50 additions & 0 deletions modules/selenoid/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
Selenide Selenoid plugin
================================

A [Selenide](https://selenide.org) extension for working with Selenoid

## Why it's needed?

Most Selenide features work with Selenoid out of the box.
There are only a few things that might not work: proxy and downloading files.
1. Selenide proxy generally works with Selenoid, except one case: when tests and Selenoid are run on different machines,
and "test machine" is not accessible from "selenoid machine".
2. Downloading files: Selenide has 3 methods for downloading files: `HTTPGET`, `PROXY` and `FOLDER`.
* `HTTPGET` and `PROXY` work in Selenoid as usually
* `FOLDER` doesn't work in Selenoid because the downloads folder is inside the container.

This problem is addressed by `selenide-selenoid` plugin: _it can get files from Selenoid container_.

## Features
Currently, the plugin supports the following features:
* File download
* Access to clipboard (get & set & verify clipboard contents)
* BasicAuth

We are going to implement more features like reading logs and videos etc.

## Usage
1. Import `com.codeborne:selenide-selenoid:6.15.0`
2. Set `Configuration.fileDownload = FOLDER;`
3. Use method `$.download()` as usually.

## How it works?
When you call `$("a#report").download()` method, Selenide-selenoid plugin
1. clicks the element,
2. lets the browser download file to its default location,
3. uses [Selenoid API](https://aerokube.com/selenoid/latest/#_accessing_files_downloaded_with_browser) to get the downloaded file.

## Sample project

This is a sample project using `selenide-selenoid` plugin:
* [github/selenide-examples/selenoid-sample](https://github.com/selenide-examples/selenoid-sample)

## Feedback
_Feel free to share your feedback!_

Register [GitHub issues](https://github.com/selenide/selenide/issues), write to
[![chat](https://img.shields.io/badge/chat-green.svg)](https://gitter.im/codeborne/selenide?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
or
[![чат](https://img.shields.io/badge/%D1%87%D0%B0%D1%82-green.svg)](https://gitter.im/codeborne/selenide-ru?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge).

[![Follow](https://img.shields.io/twitter/follow/selenide.svg?style=social&label=Follow)](https://twitter.com/selenide)
30 changes: 30 additions & 0 deletions modules/selenoid/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
ext {
artifactId = 'selenide-selenoid'
}

dependencies {
api project(":statics")
testImplementation "org.seleniumhq.selenium:selenium-http-jdk-client:$seleniumVersion"
implementation("org.apache.httpcomponents.client5:httpclient5:$httpClientVersion")
implementation("commons-io:commons-io:2.12.0")

testImplementation project(':statics').sourceSets.test.output
testImplementation project(':modules:core').sourceSets.test.output
testRuntimeOnly project(':modules:proxy')
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")

testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testImplementation("org.assertj:assertj-core:$assertjVersion")
testImplementation("org.mockito:mockito-core:$mockitoVersion")
testRuntimeOnly("org.slf4j:slf4j-simple:$slf4jVersion")
}

task selenoidTests(type: Test) {
systemProperties['selenide.browser'] = 'chrome'
include 'it/selenoid/**/*'
exclude 'org/selenide/**/*'
exclude 'com/codeborne/**/*'
outputs.upToDateWhen { false }
}

apply from: rootProject.file('gradle/publish-module.gradle')

0 comments on commit a970b6a

Please sign in to comment.