Привет.
Был ли у кого опыт разворачивания GUI тестов на gitlab-ci?
Разобрался как сделать конфиг, чтобы в нем поднимался selenium/standalone-chrome, но никак не получается запустить тесты.
Вот конфиг:
image: python:3.7 stages: - test test: stage: test before_script: - echo "Install environment" - apt-get update -q -y - pip3 install -r requirements.txt script: - echo "Run all tests" - pytest -s -v tests services: - name: selenium/standalone-chrome - alias: selenium
В конфиге проекта указываю вот такой адрес для подключения:
selenium_full_url: "http://selenium__standalone-chrome:4444/wd/hub/"
Вот так создаю драйвер:
def setup_method(self): desired_capabilities = None if self.browser == 'Chrome': desired_capabilities = DesiredCapabilities.CHROME if self.browser == 'Firefox': desired_capabilities = DesiredCapabilities.FIREFOX self.driver = webdriver.Remote( command_executor=self.selenium_full_url, desired_capabilities=desired_capabilities)
gitlab-ci ругается на эту строку "desired_capabilities=desired_capabilities)". Видимо как-то не так создаю драйвер.
tests/web/test_auth.py::TestsAuth::test_login ERROR ==================================== ERRORS ==================================== ____________________ ERROR at setup of TestsAuth.test_login ____________________ self = <tests.web.test_auth.TestsAuth object at 0x7fea70a2e5d0> def setup_method(self): desired_capabilities = None if self.browser == 'Chrome': desired_capabilities = DesiredCapabilities.CHROME if self.browser == 'Firefox': desired_capabilities = DesiredCapabilities.FIREFOX self.driver = webdriver.Remote( command_executor=self.selenium_full_url, > desired_capabilities=desired_capabilities) tests/web/test_auth.py:35: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py:157: in __init__ self.start_session(capabilities, browser_profile) /usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py:252: in start_session response = self.execute(Command.NEW_SESSION, parameters) /usr/local/lib/python3.7/site-packages/selenium/webdriver/remote/webdriver.py:321: in execute self.error_handler.check_response(response) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7fea70e1ded0> response = {'status': 404, 'value': '{\n "sessionId": null,\n "value": {\n "error": "unknown command",\n "message": "Unable to find command matching POST to \\u002f\\u002fsession",\n "stacktrace": ""\n },\n "status": 9\n}'}
Может есть у кого какие мысли, куда копать?