Skip to content
This repository was archived by the owner on Feb 2, 2025. It is now read-only.

Commit 1ae7a61

Browse files
authored
Merge pull request #112 from MarketSquare/feat/s4_dependency_updates
Updated dependencies
2 parents 790d298 + 8a876c8 commit 1ae7a61

File tree

10 files changed

+110
-72
lines changed

10 files changed

+110
-72
lines changed

.github/workflows/maven.yml

Lines changed: 57 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: Java CI
22

3-
on: [push, pull_request]
3+
on:
4+
pull_request:
5+
push:
6+
tags:
7+
branches:
8+
- develop
9+
- selenium4
10+
411

512
jobs:
613
build_and_test:
@@ -9,68 +16,96 @@ jobs:
916
matrix:
1017
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
1118
java-version: [ 8 ]
12-
browser: ['jbrowser', 'googlechromeheadless', 'firefoxheadless'] # 'htmlunitwithjs' not working with Selenium4
19+
browser: ['jbrowser', 'googlechromeheadless', 'firefoxheadless', 'edgeheadless'] # 'htmlunitwithjs' not working with Selenium4
1320
include:
1421
- os: ubuntu-latest
1522
set_display: export DISPLAY=:99; Xvfb :99 -screen 0 1024x768x24 -ac -noreset & sleep 3
16-
install_dependencies: sudo apt-get -y -q install xvfb zip curl
23+
install_dependencies: |
24+
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
25+
sudo install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/
26+
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/edge stable main" > /etc/apt/sources.list.d/microsoft-edge-dev.list'
27+
sudo rm microsoft.gpg
28+
sudo apt update
29+
sudo apt-get -y -q install xvfb zip curl microsoft-edge-beta
1730
- os: windows-latest
1831
install_dependencies: choco install firefox googlechrome curl zip -y --no-progress
1932
- os: macos-latest
2033
install_dependencies: |
21-
brew cask install firefox
22-
brew cask install google-chrome
34+
brew install --cask firefox
35+
brew install --cask google-chrome
36+
brew install --cask microsoft-edge
2337
brew install zip
2438
brew install curl
25-
39+
exclude:
40+
- os: macos-latest
41+
browser: firefoxheadless # Webdriver download if not working with Firefox at GHA
42+
java-version: 8
43+
2644
runs-on: ${{ matrix.os }}
2745
name: Test on ${{ matrix.os }} with Java ${{ matrix.java-version }} using browser ${{ matrix.browser }}
2846
steps:
2947
- uses: actions/checkout@v2
3048
- name: Set up JDK ${{ matrix.java-version }}
31-
uses: actions/setup-java@v1.2.0
49+
uses: actions/setup-java@v2.3.0
3250
with:
51+
distribution: zulu
3352
java-version: ${{ matrix.java-version }}
3453
java-package: jdk+fx # needed for jbrowser
3554
- name: Set up other dependencies
3655
run: |
3756
${{ matrix.install_dependencies }}
3857
${{ matrix.set_display }}
3958
- name: Build with Maven
40-
run: mvn -B verify --file pom.xml -P 'build,${{ matrix.browser }}'
59+
run: mvn -B -ntp -q verify --file pom.xml -P 'build,${{ matrix.browser }}'
4160
- name: Delete output.xml (on Win)
4261
run: |
4362
Get-ChildItem target/robotframework-reports -Include *output.xml -Recurse | Remove-Item
44-
echo "::set-env name=REPORT_FILE::$(Get-ChildItem target/robotframework-reports -Include *report.html -Recurse -Name)"
63+
echo "REPORT_FILE=$(Get-ChildItem target/robotframework-reports -Include *report.html -Recurse -Name)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
4564
if: always() && runner.os == 'Windows'
4665

4766
- name: Delete output.xml (on Unix-like)
4867
run: |
4968
find target/robotframework-reports -type f -name '*output.xml' -exec rm {} +
50-
echo "::set-env name=REPORT_FILE::$(find target/robotframework-reports -type f -name '*report.html' | sed 's#.*/##')"
69+
echo "REPORT_FILE=$(find target/robotframework-reports -type f -name '*report.html' | sed 's#.*/##')" >> $GITHUB_ENV
5170
if: always() && runner.os != 'Windows'
5271

5372
- name: Archive acceptances test results
54-
uses: actions/upload-artifact@v1.0.0
73+
uses: actions/upload-artifact@v2.2.4
5574
with:
5675
name: at-results-${{ matrix.browser }}-${{ matrix.os }}-${{ matrix.java-version }}
5776
path: target/robotframework-reports
5877
if: always() && job.status == 'failure'
5978

60-
- name: Upload results
79+
- name: Upload results on failure
80+
id: upload_results
6181
run: |
6282
echo '<html><head><meta http-equiv = "refresh" content =" 0 ; url = /${{ env.REPORT_FILE }}"></head></html>' > target/robotframework-reports/index.html
6383
zip -r -j site.zip target/robotframework-reports > no_output 2>&1
6484
curl -s -H "Content-Type: application/zip" -H "Authorization: Bearer ${{ secrets.NETLIFY_TOKEN }}" --data-binary "@site.zip" https://api.netlify.com/api/v1/sites > response.json
65-
echo "::set-env name=REPORT_URL::$(cat response.json|python -c "import sys, json; print('https://' + json.load(sys.stdin)['subdomain'] + '.netlify.com')")"
66-
echo "::set-env name=JOB_STATUS::$(python -c "print('${{ job.status }}'.lower())")"
85+
echo "::set-output name=REPORT_URL::$(cat response.json|python -c "import sys, json; print('https://' + json.load(sys.stdin)['subdomain'] + '.netlify.com')")"
86+
echo "::set-output name=JOB_STATUS::$(python -c "print('${{ job.status }}'.lower())")"
6787
if: always() && job.status == 'failure'
6888

69-
- uses: octokit/request-action@57ec46afcc4c58c813af3afe67e57ced1ea9f165
89+
- uses: octokit/request-action@7e93b91076fad3920c29d44eb2a6311d929db3dd
7090
name: Update status with Github Status API
71-
id: update_status
91+
id: update_status_pr
7292
with:
73-
route: POST /repos/:repository/statuses/:sha
93+
route: POST /repos/{repository}/statuses/{sha}
94+
repository: ${{ github.repository }}
95+
sha: ${{ github.event.pull_request.head.sha }}
96+
state: "${{steps.upload_results.outputs.JOB_STATUS}}"
97+
target_url: "${{steps.upload_results.outputs.REPORT_URL}}"
98+
description: "Link to test report."
99+
context: at-results-${{ matrix.browser }}-${{ matrix.os }}-${{ matrix.java-version }}
100+
env:
101+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
102+
if: always() && job.status == 'failure' && github.event.pull_request
103+
104+
- uses: octokit/request-action@7e93b91076fad3920c29d44eb2a6311d929db3dd
105+
name: Update status with Github Status API
106+
id: update_status_push
107+
with:
108+
route: POST /repos/{repository}/statuses/{sha}
74109
repository: ${{ github.repository }}
75110
sha: ${{ github.sha }}
76111
state: "${{env.JOB_STATUS}}"
@@ -79,21 +114,22 @@ jobs:
79114
context: at-results-${{ matrix.browser }}-${{ matrix.os }}-${{ matrix.java-version }}
80115
env:
81116
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
82-
if: always() && job.status == 'failure'
117+
if: always() && job.status == 'failure' && github.event.push
83118

84119
release:
85120
needs: [build_and_test]
86-
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/selenium4' || startsWith(github.ref, 'refs/tags/')
121+
if: github.event.push
87122
runs-on: ubuntu-latest
88123
name: Release package
89124
steps:
90125
- uses: actions/checkout@v2
91126
- name: Set up JDK
92-
uses: actions/setup-java@v1.2.0
127+
uses: actions/setup-java@v2.3.0
93128
with:
129+
distribution: zulu
94130
java-version: 8
95131
- name: Release Maven package
96-
uses: samuelmeuli/action-maven-publish@1221d1fa792cab948a772c5e7c1f3abe84aec3bf
132+
uses: samuelmeuli/action-maven-publish@201a45a3f311b2ee888f252ba9f4194257545709
97133
with:
98134
gpg_private_key: ${{ secrets.gpg_private_key }}
99135
gpg_passphrase: ${{ secrets.gpg_passphrase }}

pom.xml

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>com.github.marketsquare</groupId>
77
<artifactId>robotframework-seleniumlibrary</artifactId>
8-
<version>4.0.0-alpha-4.2-SNAPSHOT</version>
8+
<version>4.0.0-rc-1-SNAPSHOT</version>
99
<packaging>jar</packaging>
1010

1111
<name>Robot Framework :: SeleniumLibrary</name>
@@ -73,11 +73,11 @@
7373
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
7474
<downloadSources>true</downloadSources>
7575
<downloadJavadocs>true</downloadJavadocs>
76-
<aspectj.version>1.9.5</aspectj.version>
76+
<aspectj.version>1.9.8.M1</aspectj.version>
7777
<java.version>1.8</java.version>
78-
<robotframework.maven.plugin.version>1.6.0</robotframework.maven.plugin.version>
79-
<robotframework.version>3.1.2</robotframework.version>
80-
<selenium.version>4.0.0-alpha-4</selenium.version>
78+
<robotframework.maven.plugin.version>2.1.0</robotframework.maven.plugin.version>
79+
<robotframework.version>4.1</robotframework.version>
80+
<selenium.version>4.0.0-rc-1</selenium.version>
8181
<keywords.class>SeleniumLibrary</keywords.class>
8282
<browser>jbrowser</browser>
8383
<downloadWebDriver>False</downloadWebDriver>
@@ -124,7 +124,7 @@
124124
<dependency>
125125
<groupId>io.appium</groupId>
126126
<artifactId>java-client</artifactId>
127-
<version>7.3.0</version>
127+
<version>7.5.1</version>
128128
<exclusions>
129129
<exclusion>
130130
<groupId>org.seleniumhq.selenium</groupId>
@@ -160,7 +160,7 @@
160160
<dependency>
161161
<groupId>org.seleniumhq.selenium</groupId>
162162
<artifactId>htmlunit-driver</artifactId>
163-
<version>2.36.0</version>
163+
<version>2.52.0</version>
164164
<exclusions>
165165
<exclusion>
166166
<groupId>org.seleniumhq.selenium</groupId>
@@ -185,7 +185,7 @@
185185
<dependency>
186186
<groupId>io.github.bonigarcia</groupId>
187187
<artifactId>webdrivermanager</artifactId>
188-
<version>3.8.1</version>
188+
<version>5.0.2</version>
189189
</dependency>
190190
</dependencies>
191191

@@ -290,9 +290,12 @@
290290
<log>target/robotframework-reports/${browser}_log.html</log>
291291
<output>target/robotframework-reports/${browser}_output.xml</output>
292292
<xunitFile>target/robotframework-reports/${browser}_xUnit.xml</xunitFile>
293-
<nonCriticalTags>
294-
<nonCriticalTag>${browser}</nonCriticalTag>
295-
</nonCriticalTags>
293+
<skips>
294+
<skip>${browser}</skip>
295+
</skips>
296+
<skiponfailures>
297+
<skiponfailure>${browser}</skiponfailure>
298+
</skiponfailures>
296299
</configuration>
297300
</execution>
298301
<execution>
@@ -371,7 +374,7 @@
371374
<!-- extract documentation for libdoc -->
372375
<groupId>org.apache.maven.plugins</groupId>
373376
<artifactId>maven-javadoc-plugin</artifactId>
374-
<version>3.1.1</version>
377+
<version>3.2.0</version>
375378
<executions>
376379
<execution>
377380
<id>attach-javadocs</id>
@@ -426,6 +429,13 @@
426429
<downloadWebDriver>True</downloadWebDriver>
427430
</properties>
428431
</profile>
432+
<profile>
433+
<id>edgeheadless</id>
434+
<properties>
435+
<browser>edgeheadless</browser>
436+
<downloadWebDriver>True</downloadWebDriver>
437+
</properties>
438+
</profile>
429439
<profile>
430440
<id>deploy</id>
431441
<build>
@@ -460,7 +470,7 @@
460470
<!-- Build the fat jar with all dependencies -->
461471
<groupId>org.apache.maven.plugins</groupId>
462472
<artifactId>maven-assembly-plugin</artifactId>
463-
<version>3.2.0</version>
473+
<version>3.3.0</version>
464474
<configuration>
465475
<archive>
466476
<manifest>
@@ -485,7 +495,7 @@
485495
<plugin>
486496
<groupId>org.codehaus.mojo</groupId>
487497
<artifactId>build-helper-maven-plugin</artifactId>
488-
<version>3.0.0</version>
498+
<version>3.2.0</version>
489499
<executions>
490500
<execution>
491501
<id>attach-artifacts</id>

src/main/java/com/github/markusbernhardt/seleniumlibrary/keywords/BrowserManagement.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.github.markusbernhardt.seleniumlibrary.keywords;
22

33
import io.appium.java_client.ios.IOSDriver;
4-
import io.github.bonigarcia.wdm.DriverManagerType;
54
import io.github.bonigarcia.wdm.WebDriverManager;
5+
import io.github.bonigarcia.wdm.config.DriverManagerType;
66
import io.selendroid.client.SelendroidDriver;
77

88
import java.io.File;
@@ -157,6 +157,7 @@ public void closeBrowser() {
157157
"| Google Chrome (headless) | googlechromeheadless, chromeheadless, gcheadless |\r\n" +
158158
"| Internet Explorer | internetexplorer, ie |\r\n" +
159159
"| Edge | edge |\r\n" +
160+
"| Edge (headless) | edgeheadless |\r\n" +
160161
"| Safari | safari |\r\n" +
161162
"| Android | android |\r\n" +
162163
"| Iphone | iphone |\r\n" +
@@ -632,6 +633,7 @@ protected WebDriver createLocalWebDriver(String browserName, Capabilities desire
632633
case "internetexplorer":
633634
return new InternetExplorerDriver((InternetExplorerOptions)desiredCapabilities);
634635
case "edge":
636+
case "edgeheadless":
635637
return new EdgeDriver((EdgeOptions)desiredCapabilities);
636638
case "gc":
637639
case "chrome":
@@ -688,6 +690,7 @@ private void initWebDriver(String browserName) {
688690
WebDriverManager.getInstance(DriverManagerType.IEXPLORER).setup();
689691
break;
690692
case "edge":
693+
case "edgeheadless":
691694
WebDriverManager.getInstance(DriverManagerType.EDGE).setup();
692695
break;
693696
case "gc":
@@ -731,6 +734,10 @@ protected Capabilities createCapabilities(String browserName, String desiredCapa
731734
case "edge":
732735
desiredCapabilities = new EdgeOptions();
733736
break;
737+
case "edgeheadless":
738+
desiredCapabilities = new EdgeOptions();
739+
((EdgeOptions)desiredCapabilities).setHeadless(true);
740+
break;
734741
case "gc":
735742
case "chrome":
736743
case "googlechrome":

src/test/robotframework/objects/Google.Site.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Go To
2424
${Current.Location}= Get Location
2525
Run Keyword If '${Current.Location}'!='${Google.Site.Url}' SeleniumLibrary.Go To ${Google.Site.Url}
2626
Title Should Be ${Google.Site.PageTitle}
27+
Handle Cookie Consent xpath:(//div[@role="none"])[last()]
2728

2829
Close
2930
Close Browser

src/test/robotframework/settings/Settings.robot

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,13 @@ ${Selenium.Timeout} 30.0
1313
1414
*** Keywords ***
1515
Test
16-
Op
16+
Op
17+
18+
Handle Cookie Consent
19+
[Arguments] ${consent click xpath}
20+
Comment Consent search causes stack overflow to jbrowser, so tagging tescases using this keyword
21+
Set Tags jbrowser
22+
${count} Get Matching Xpath Count ${consent click xpath}
23+
IF ${count} > 0
24+
Click Element ${consent click xpath}
25+
END

src/test/robotframework/testsuites/UnitTests/AW3Schools.robot

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ ${URL Application} http://www.w3schools.com
88

99
*** Test Cases ***
1010
Select
11+
[Tags] jbrowser
1112
Open Browser https://developer.mozilla.org/en/docs/Web/HTML/Element/select#Examples ${browser} mainbrowser
12-
Wait Until Page Contains Element xpath://select
13-
Select From List xpath://select Third Value
14-
${label} Get Selected List Label xpath://select
13+
Wait Until Page Contains Element frame_Basic_select
14+
Select Frame frame_Basic_select
15+
Wait Until Page Contains Element xpath://select[@name="choice"]
16+
Select From List xpath://select[@name="choice"] Third Value
17+
${label} Get Selected List Label xpath://select[@name="choice"]
1518
Should Be Equal ${label} Third Value
16-
List Selection Should Be xpath://select Third Value
19+
List Selection Should Be xpath://select[@name="choice"] Third Value
1720

1821
Multiple Browsers
1922
Open Browser ${URL Application} ${browser} mainbrowser1

src/test/robotframework/testsuites/UnitTests/ExtJS.robot

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
Suite Setup Open Page
33
Suite Teardown Close Browser
44
Resource ../../settings/Settings.robot
5+
Default Tags jbrowser
56

67
*** Variables ***
78
${URL Application} http://examples.sencha.com/extjs/6.5.0/examples/classic/ticket-app/index.html

src/test/robotframework/testsuites/UnitTests/GetInnerElementId.robot

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/test/robotframework/testsuites/UnitTests/JSEvents.robot

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)