如何使用';调整窗口大小';docker和electron在Testcafe?
在使用gitlab测试electron应用程序时,我在docker容器中使用如何使用';调整窗口大小';docker和electron在Testcafe?,docker,testing,electron,resize,testcafe,Docker,Testing,Electron,Resize,Testcafe,在使用gitlab测试electron应用程序时,我在docker容器中使用resizeWindow时遇到问题 注意:在本地设置(linux)上,所有测试都按预期工作,但docker容器内的resizeWindow似乎不工作。容器内的其他测试也可以工作 可能我缺少xvfb的任何配置,或者我应该使用fluxbox 有什么建议可以解决这个问题吗 docker的测试错误: 使用的测试设置: 调整窗口大小测试CAFE测试 在gitlab yml内启动 -xvfb run--server num=99
resizeWindow
时遇到问题
注意:在本地设置(linux)上,所有测试都按预期工作,但docker容器内的resizeWindow
似乎不工作。容器内的其他测试也可以工作
可能我缺少xvfb
的任何配置,或者我应该使用fluxbox
有什么建议可以解决这个问题吗
docker的测试错误:
使用的测试设置: 调整窗口大小测试CAFE测试 在gitlab yml内启动
-xvfb run--server num=99--server args='-ac-屏幕0 1024x768x16'纱线测试-e2e-ci
package.json
“test-e2e-ci”:“node-r@babel/register./internals/scripts/CheckBuildsExist.js&&cross-env node_env=test-testcafe-electron:./ci./test/e2e/--截图takenfails=true”,
./ci/.testcafe-electron-rc
已测试的docker图像:
circleci/node:最新浏览器
FROM node:lts-stretch
RUN apt-get update \
&& apt-get install -y xvfb \
libnotify4 \
libgconf2-4 \
libnss3 \
libxtst-dev \
libc6 \
libstdc++6 \
libgcc1 \
libgtk-3-0 \
libasound2 \
libxrender1 \
libxss1
您需要正确安装和设置
fluxbox
工具。
请参阅TestCafe docker相关文件中的示例:
fluxbox
工具。
请参阅TestCafe docker相关文件中的示例:
Xvfb
,显示设置和fluxbox>/dev/null 2>&1&
完成了这个把戏,thx。确实Xvfb
,显示设置和fluxbox>/dev/null 2>&1&
完成了这个把戏,thx。
Warnings (3):
--
Was unable to resize the window due to an error.
The
/builds/myFancyProject/node_modules/testcafe-browser-tools/bin/linux/glibc-64/resize
process failed with the null exit code.
--
test('`ResizeWindow` works as expected ', async t => {
await t.resizeWindow(100, 100);
const innerWidth = await t.eval(() => window.innerWidth);
const innerHeight = await t.eval(() => window.innerHeight);
await t.expect(innerWidth).eql(100);
await t.expect(innerHeight).eql(100);
});
{
"mainWindowUrl": "../app/app.html",
"appPath": "../app",
"appArgs": "--no-sandbox"
}
FROM node:lts-stretch
RUN apt-get update \
&& apt-get install -y xvfb \
libnotify4 \
libgconf2-4 \
libnss3 \
libxtst-dev \
libc6 \
libstdc++6 \
libgcc1 \
libgtk-3-0 \
libasound2 \
libxrender1 \
libxss1