Skip to content

Commit 7feec76

Browse files
authored
v7 (#559)
* v7
1 parent 39f4a1c commit 7feec76

33 files changed

+468
-990
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
root: true,
33
parserOptions: {
4-
ecmaVersion: 2017,
4+
ecmaVersion: 2019,
55
},
66
plugins: ['prettier'],
77
extends: ['eslint:recommended', 'prettier', 'plugin:prettier/recommended'],

.github/workflows/test.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
9+
jobs:
10+
linux:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
node-version: ['12.x', '14.x', '16.x']
15+
java: ['11']
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-java@v2
19+
with:
20+
distribution: 'adopt'
21+
java-version: ${{ matrix.java }}
22+
- uses: actions/setup-node@v1
23+
with:
24+
node-version: ${{ matrix.node-version }}
25+
- uses: actions/cache@v2
26+
id: cache
27+
with:
28+
path: '**/node_modules'
29+
key: ${{ runner.os }}-${{ matrix.node-version }}-node_modules-${{ hashFiles('**/package-lock.json') }}
30+
- name: Install Dependencies
31+
if: steps.cache.outputs.cache-hit != 'true'
32+
run: npm ci
33+
- name: Lint
34+
run: npm run lint
35+
- name: Test
36+
run: npm run test
37+
env:
38+
CI: true

.travis.yml

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

Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
FROM ubuntu:latest@sha256:aba80b77e27148d99c034a987e7da3a287ed455390352663418c0f2ed40417fe
22

3-
ENV NODE_VERSION 8.11.2
4-
53
LABEL author="Vincent Voyer <vincent@zeroload.net>"
64
LABEL maintainer="Serban Ghita <serbanghita@gmail.com>"
75

@@ -35,7 +33,7 @@ RUN apt-get -qqy --no-install-recommends install \
3533
nodejs \
3634
firefox \
3735
google-chrome-stable \
38-
openjdk-8-jre-headless \
36+
openjdk-11-jre-headless \
3937
xvfb \
4038
xfonts-100dpi \
4139
xfonts-75dpi \

HISTORY.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 7.0.0 (2021-06-18)
2+
* BREAKING CHANGE drop nodejs 10, minimum version is 12
3+
* BREAKING CHANGE removed callbacks for `install` and `start` commands
4+
* BREAKING CHANGE `install` and `start` commands are Promises now!
5+
* BREAKING CHANGE docker images are built with `jdk11`
6+
* BREAKING CHANGE dropped support of old browser drivers and platforms
7+
* BREAKING CHANGE change folder structure #491
8+
* check port before starting selenium #553
9+
110
# 6.24.0 (2021-06-16)
211
* selenium 4 support
312
* update default versions

README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
22
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
33

4-
54
- [selenium-standalone](#selenium-standalone)
65
- [Install & Run](#install--run)
76
- [Command line interface (CLI)](#command-line-interface-cli)
@@ -14,7 +13,6 @@
1413
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1514

1615
# selenium-standalone
17-
[![Build Status](https://travis-ci.org/vvo/selenium-standalone.svg?branch=master)](https://travis-ci.org/vvo/selenium-standalone)
1816
[![dependencies Status](https://david-dm.org/vvo/selenium-standalone/status.svg)](https://david-dm.org/vvo/selenium-standalone)
1917
[![devDependencies Status](https://david-dm.org/vvo/selenium-standalone/dev-status.svg)](https://david-dm.org/vvo/selenium-standalone?type=dev)
2018

bin/selenium-standalone

Lines changed: 16 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -11,54 +11,33 @@ const path = require('path');
1111
const selenium = require('../');
1212
const defaultConfig = require('../lib/default-config')();
1313

14+
if (!process.listeners('unhandledRejection').length === 0) {
15+
process.on('unhandledRejection', (reason) => {
16+
console.error(reason);
17+
});
18+
}
19+
1420
const actions = {
15-
start: function (options) {
21+
start: async function (options) {
1622
const killEvents = ['exit', 'SIGTERM', 'SIGINT'];
23+
const cp = await selenium.start(options);
1724

18-
selenium.start(options, started);
19-
20-
function started(err, cp) {
21-
if (err) {
22-
if (cp) {
23-
cp.kill('SIGINT');
24-
}
25-
throw err;
26-
}
27-
28-
console.log('Selenium started');
29-
30-
killEvents.forEach(register);
31-
32-
function register(evName) {
33-
process.on(evName, kill);
34-
}
25+
console.log('Selenium started');
3526

36-
function unregister(evName) {
37-
process.removeListener(evName, kill);
38-
}
27+
killEvents.forEach((evName) => {
28+
process.once(evName, () => cp.kill('SIGTERM'));
29+
});
3930

40-
function kill() {
41-
killEvents.forEach(unregister);
42-
cp.kill('SIGTERM');
43-
}
44-
}
31+
return cp;
4532
},
46-
install: function (options) {
33+
install: async function (options) {
4734
const ProgressBar = require('progress');
4835
let bar;
4936
let firstProgress = true;
5037

5138
// eslint-disable-next-line no-param-reassign
5239
options.progressCb = options.silent ? null : progressCb;
5340

54-
selenium.install(options, installed);
55-
56-
function installed(err) {
57-
if (err) {
58-
throw err;
59-
}
60-
}
61-
6241
function progressCb(total, progress, chunk, url, reset) {
6342
if (firstProgress) {
6443
console.log('');
@@ -77,6 +56,8 @@ const actions = {
7756

7857
bar.tick(chunk);
7958
}
59+
60+
await selenium.install(options);
8061
},
8162
};
8263

bin/start-selenium

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

docker/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ LABEL maintainers="Serban Ghita <serbanghita@gmail.com>, David Catalan <catalan.
1010
ENV LC_ALL=C
1111
ENV DISPLAY=:99
1212
ENV SELENIUM_CONSOLE_URL=http://localhost:4444/wd/hub
13-
ENV SCREEN_GEOMETRY=1024x768x16
13+
ENV SCREEN_GEOMETRY=1920x1080x16
1414

1515

1616
# Expose Selenium web console port
@@ -29,7 +29,7 @@ RUN apt-get -qqy install \
2929
jq \
3030
software-properties-common \
3131
sudo \
32-
openjdk-8-jre-headless \
32+
openjdk-11-jre-headless \
3333
wget \
3434
xvfb \
3535
xfonts-100dpi \

docker/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ $ docker run -it -p 4444:4444 vvoyer/selenium-standalone
3535

3636
* `SCREEN_GEOMETRY` Set browser window size
3737
* Format: `<WIDTH>x<HEIGHT>x<DEPTH>`
38-
* Default: `1024x768x16`
38+
* Default: `1920x1080x16`
3939
* Usage example: set screen size to 1200x1200 with 8bits depth
4040
```
4141
$ docker run -it -p 4444:4444 -e SCREEN_GEOMETRY="1200x1200x8" vvoyer/selenium-standalone

0 commit comments

Comments
 (0)