Запускаю тесты в codeception через docker. Само приложение стартую через встроенный веб сервер в PHP (php -S 0.0.0.0:8080), из контейнеров с
selenium/node-chrome и
selenium/hub могу дергать ссылку на сайт через
curl:
selenium/hubseluser@90eb3bd12e50:/$ curl -v http://app:8080
* Rebuilt URL to: http://app:8080/
* Trying 172.23.0.2...
* TCP_NODELAY set
* Connected to app (172.23.0.2) port 8080 (#0)
> GET / HTTP/1.1
> Host: app:8080
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Host: app:8080
< Date: Thu, 04 Apr 2019 12:59:58 +0000
< Connection: close
< X-Powered-By: PHP/7.3.3
< Content-type: text/html; charset=UTF-8
<
* Closing connection 0
Hello World!
selenium/node-chromeseluser@b77b51e95490:/$ curl -v http://app:8080
* Rebuilt URL to: http://app:8080/
* Trying 172.23.0.2...
* TCP_NODELAY set
* Connected to app (172.23.0.2) port 8080 (#0)
> GET / HTTP/1.1
> Host: app:8080
> User-Agent: curl/7.58.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Host: app:8080
< Date: Thu, 04 Apr 2019 13:01:05 +0000
< Connection: close
< X-Powered-By: PHP/7.3.3
< Content-type: text/html; charset=UTF-8
<
* Closing connection 0
Hello World!
Но во время тестов подключиться не может, получаю ошибку
This site can’t be reached app unexpectedly closed the connection.
И вот такой лог в консоли веб сервера:
app_1 | [Thu Apr 4 13:02:23 2019] 172.23.0.4:46120 Invalid request (Unsupported SSL request)
app_1 | [Thu Apr 4 13:02:23 2019] 172.23.0.4:46122 Invalid request (Unsupported SSL request)
app_1 | [Thu Apr 4 13:02:23 2019] 172.23.0.4:46124 Invalid request (Unsupported SSL request)
app_1 | [Thu Apr 4 13:02:23 2019] 172.23.0.4:46126 Invalid request (Unsupported SSL request)
acceptance.suite.ymlactor: AcceptanceEngineer
modules:
enabled:
- WebDriver:
browser: chrome
url: http://app:8080
host: selenium-hub
port: 4444
- \Helper\Acceptance
docker-composer.ymlversion: "3"
services:
app:
image: php:latest
volumes:
- ./:/app
working_dir: /app
command: php -S 0.0.0.0:8080
selenium-hub:
image: selenium/hub:3.141.59-mercury
depends_on:
- app
ports:
- 4444:4444
chrome:
image: selenium/node-chrome:3.141.59-mercury
volumes:
- /dev/shm:/dev/shm
depends_on:
- selenium-hub
- app
environment:
- HUB_HOST=selenium-hub
- HUB_PORT=4444