docker - Error: BrowserType.launch: Protocol error (Browser.getVersion): Browser closed when running codeceptjs docker image thru Dockerfile
问题描述
FROM codeceptjs/codeceptjs:latest
# Set working directory
WORKDIR /usr/app
# Copy source code
COPY package.json /usr/app
COPY package-lock.json /usr/app
COPY . /usr/app
# Environment variables
ENV BASE_URL="Local Https URL"
ENV PARALLEL_RUN=false
ENV TAG=int
RUN rm -rf node_modules
RUN npm install
# Run tests
RUN npm run codeceptjs
I have written above docker file when I am pulling the latest docker image of Codeceptjs. When I am trying the Build the image then I am getting error when test execution starts. Error is:
#12 6.636 [pid=286][err][286:286:1004/055308.159970:ERROR:browser_main_loop.cc(1412)] Unable to open X display.
#12 6.636 ============================================================
#12 6.636 Note: use DEBUG=pw:api environment variable to capture Playwright logs.
#12 6.636 browserType.launch: Protocol error (Browser.getVersion): Browser closed.
#12 6.636 ==================== Browser output: ====================
#12 6.636 <launching> /ms-playwright/chromium-888113/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-background
解决方案
推荐阅读
- mysql - MySQL连接表与2个引用表
- scala - 使用 Scala 进行生存 AFT 分析
- python - Matlab 代码到 Python 代码的转换(使用数据框)
- python-2.7 - Pypy(Window10) ImportError: No module named yaml
- excel - 保存时禁止密码
- r - R:ggplot用文本+数字排序变量
- cuda - 如何使用 PGI 调试器进入 CUDA fortran 内核?
- java - 如何使用java在excel中的下一个空白行上添加值
- python - 机器人框架 - 找不到 python 模块
- python - 如何在 Python 代码文件中查找和删除未使用的函数?