Эти тесты раньше работали нормально на CI с Chrome и драйвером Chrome версии 114, но теперь этот URL-адрес не поддерживается. https://dl.google.com/linux/chrome/deb/ ... _amd64.deb
Мой CI выглядит так, как показано ниже. :
Код: Выделить всё
erp_test:
stage: test_Python_3.12
image: python:3.12
variables:
OPERATING_SYSTEM: 'Ubuntu'
script:
- python -V
- pip install -r requirements.txt
- pip install --upgrade webdriver-manager
# install google chrome
- wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
- sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
- apt-get update
- echo $(pwd)
- mkdir -p /opt/google/
- cd /opt/google/
- echo $(pwd)
- wget -q -O ./chrome-linux64.zip https://storage.googleapis.com/chrome-for-testing-public/125.0.6422.141/linux64/chrome-linux64.zip
- unzip chrome-linux64.zip
- rm -f chrome-linux64.zip
- echo $(ls)
- echo $(ls -ll /opt/google/chrome-linux64/)
- echo $(ls -ll /usr/bin/)
- ln -sf /opt/google/chrome-linux64/chrome /usr/bin/google-chrome
- echo $(ls -ll /usr/bin/)
- echo $(whereis google-chrome)
- pytest tests/test_infor_EAM.py
У меня есть драйвер Chrome для браузера Google версии 125.0.6422.141 под Каталог драйверов
И я получаю ошибку ниже в Gitlab CI
< div class="snippet-code">
Код: Выделить всё
@pytest.fixture()
def setup():
global driver
if BROWSER == 'Chrome_Headless':
chrome_options = Options()
chrome_options.add_argument('--headless=new')
chrome_options.add_argument('--window-size=1920,1200')
chrome_options.add_argument('--no-sandbox')
chrome_options.add_argument('--disable-dev-shm-usage')
chrome_linux_64 = Service('./Drivers/chromedriver-linux64')
> driver = webdriver.Chrome(service=chrome_linux_64, options=chrome_options)
tests/test_infor_EAM.py:21:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py:45: in __init__
super().__init__(
/usr/local/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py:55: in __init__
self.service.start()
/usr/local/lib/python3.12/site-packages/selenium/webdriver/common/service.py:102: in start
self.assert_process_still_running()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self =
def assert_process_still_running(self) -> None:
"""Check if the underlying process is still running."""
return_code = self.process.poll()
if return_code:
> raise WebDriverException(f"Service {self._path} unexpectedly exited. Status code was: {return_code}")
E selenium.common.exceptions.WebDriverException: Message: Service ./Drivers/chromedriver-linux64 unexpectedly exited. Status code was: 127
/usr/local/lib/python3.12/site-packages/selenium/webdriver/common/service.py:115: WebDriverException
=========================== short test summary info ============================
ERROR tests/test_infor_EAM.py::test_login_infor_eam - selenium.common.exceptions.WebDriverException: Message: Service ./Drivers/chromedriver-linux64 unexpectedly exited. Status code was: 127
=============================== 1 error in 0.26s ===============================
Подробнее здесь: https://stackoverflow.com/questions/786 ... de-was-127