In docker The Chinese characters in the Cypress console log show garbled code #27153
-
cypress: 12.16.0 cypress-video668a5c2c-d05b-411c-a534-ea338ad844d8.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
cypress: 12.17.1 We had troubles in our visual regression testing where Chinese characters were rendered as rectangles similar to your console log result. We resolved it by installing the fonts-wqy-zenhei font in our Dockerfile. |
Beta Was this translation helpful? Give feedback.
-
As mentioned earlier, I tried to solve this problem by installing fonts. As Cypress/included uses Debian and the network is not very smooth in China, I first cleared the default apt download source, added the domestic Alibaba Cloud image source, and finally downloaded it. The relevant Dockerfile is as follows: # 删除默认镜像源
RUN rm -rf /etc/apt/sources.list.d
# 添加多个国内镜像源
RUN echo 'deb http://mirrors.aliyun.com/debian/ bookworm main non-free contrib' > /etc/apt/sources.list && \
echo 'deb-src http://mirrors.aliyun.com/debian/ bookworm main non-free contrib' >> /etc/apt/sources.list && \
echo 'deb http://mirrors.aliyun.com/debian-security bookworm-security main' >> /etc/apt/sources.list && \
echo 'deb http://mirrors.aliyun.com/debian/ bookworm-updates main non-free contrib' >> /etc/apt/sources.list && \
echo 'deb http://mirrors.aliyun.com/debian/ bookworm-backports main non-free contrib' >> /etc/apt/sources.list
#更新包列表并安装字体
RUN apt-get update && \
apt-get install -y fonts-wqy-microhei fonts-wqy-zenhei && \
rm -rf /var/lib/apt/lists/*
|
Beta Was this translation helpful? Give feedback.
cypress: 12.17.1
docker : cypress/included:12.17.1
electron: 106
We had troubles in our visual regression testing where Chinese characters were rendered as rectangles similar to your console log result. We resolved it by installing the fonts-wqy-zenhei font in our Dockerfile.