K
K
knowledge2019-03-26 17:36:46
selenium
knowledge, 2019-03-26 17:36:46

How to run codeception tests via webdriver in docker?

php, mariadb, nginx and webdriver are connected in docker-compose.yml + network
fragment with webdriver and network is configured

webdriver:
    image: selenium/standalone-chrome-debug
    ports:
      - 4444:4444
      - 5900:5900
    networks:
      - internal
networks:
  internal:
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 192.168.220.0/28

in codeception in the settings it is written like this:
class_name: AcceptanceTester
modules:
  enabled:
    - Asserts
        browser: chrome
        url: 'http://mysite.loc'
        host: webdriver

127.0.0.1 mysite.loc is written in /etc/hosts of the machine
when I try to run tests in the container, I get (I can’t give it for sure, from memory)
an unreachable IP address. check your connection, IP address and DNS, etc., etc.
if you specify localhost or 192.168.220.1 in the url, then the tests see the greeting of the nginx start page, but they don’t see mysite.loc
, I understand that the matter is most likely in DNS, not sees entries in /etc/hosts, perhaps it needs to be duplicated in the container, now there is no way to check, maybe someone faced such a problem?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question