问题标签 [visual-testing]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
2 回答
1122 浏览

visual-testing - Applitools openBase() 失败,出现 com.applitools.eyes.EyesException

我无法弄清楚为什么这段代码会失败,我浏览了 Applitools 教程,但我无法弄清楚这里发生了什么。

这是抛出的异常:

这是搜索测试:

验证窗口方法:

和抛出异常的类:

0 投票
1 回答
549 浏览

angular - 使用 Angular 为故事书实现 StoryShots

我正在运行一个 Angular v8 应用程序并在故事书中。我想为其集成自动化视觉测试并找到 StoryShots。我找到了这条指令并像那样实现了它。因为 Karma 是应用程序中的测试工具,所以我调整了仅包含“test.ts”的文件应进行视觉测试的开玩笑配置。Jest 找到了 spec.ts 文件,但只有 test.ts 文件,它找不到 test No tests found, exiting with code 1。我错过了什么?有人对角度和 StoryShots 有一些经验吗?

这是我的代码:

package.json

jest.config.js

jest.setup.js

在根文件夹中,我有一个.storybook包含测试文件的文件夹

storyshots.test.ts

0 投票
1 回答
508 浏览

docker - Visual test fail on gitlab pipeline because of font rendering

I have an Angular project with Storybook as a design system. I want to integrate visual testing for it. I use Jest with puppeteer and image snapshot. Locally it is running fine but on GitLab, the pipeline is failing, because the font is rendered differently. I use a specific font but it is also included in the GitLab environment but it seems more stretched:

diff output from the pipeline

I also run the same docker container locally and on GitLab.

Here is my jest.config.js

And my jest-puppeteer.config.js

It would be great if somebody could help me with this.

0 投票
1 回答
142 浏览

testing - TestCafe:扩展“期望”以合并 jest-image-snapshot

我注意到有一个选项可以扩展 TestCafe 的 Selector。我正在从事的项目需要进行视觉图像测试。

我想看看我是否可以jest-image-snapshot与 TestCafe 一起工作……但没有这样做。

因此,需要帮助来了解如何将该包合并到对 TestCafe 期间截取的屏幕截图的验证中。

这是我到目前为止编写的一些基本代码:

const { toMatchImageSnapshot } = require('jest-image-snapshot'); var fs = 需要('fs');

fixture('快照').page('https://tallkurideon.myshopify.com/');

0 投票
1 回答
447 浏览

selenium - 使用 WinAPPpDriver 对 Windows 桌面应用程序和 C# 进行图像比较和可视化测试

请帮助选择测试水印/图像覆盖的工具。透明度可以为0%,应该不是问题。

被测应用程序是 Windows 上的 WPF 桌面应用程序,自动测试是用 Winappdriver + C# 编写的,现在看来我必须截取特定元素的屏幕截图,并通过蒙版将实际图像与理想样本进行比较。

被测产品是一款能够在图像和视频上插入标识/水印和/或其他详细信息(日期/名称/地址)的摄像机。任务是自动验证插入徽标的正确性以及图像/视频中插入细节的正确性(大小、颜色、插入后是否镜像徽标或输入错误的名称......)。

目前我正在考虑使用 OpenCV 或 Sikuli。我知道 Appium 有类似的东西,但它可能不适用于我的驱动程序。

目前还不清楚如何以及可以用视频测试什么。只是随机拍摄一帧并对其进行测试,就像图像一样?

非常感谢您的帮助和建议!

0 投票
2 回答
411 浏览

javascript - 是否可以在 percy 视觉测试中增加视口的宽度?

我试图在 Percy 视觉测试中增加视口的大小,因为它不会截取整个页面的屏幕截图。我的窗口在 x 轴上有一个滚动条,Percy 没有截取整个页面的屏幕截图。

有可能做这样的事情吗?

page.viewport().width(1600);

0 投票
1 回答
40 浏览

javascript - 如何测试博客上呈现在其位置上的所有页面元素,其中图像随柏树而变化

我想为我的博客页面添加 cypress 测试,其中图像不断变化,我无法使用 cypress 共享的可视化测试插件。这些测试因图像更改而失败。我尝试使用 cypress-plugin-snapshot。

是否有任何插件可以帮助我测试所有页面元素都在它们的位置呈现。页面结构是否符合预期?

也许你可以有下面的图像示例 - 仅供参考。块内的内容不是必需的,但块需要在预期的范围内进行测试。

在此处输入图像描述

图像内容可能会发生变化,但整个页面布局会按预期呈现。例如。可能是 img 样式忘记添加宽度 100% 并且它会根据实际图像宽度进行渲染。

0 投票
1 回答
474 浏览

javascript - cypress 可以等待一些元素出现吗?

我想让柏树等到我的网络应用程序全部打开。有些元素彼此独立加载,我必须等待全屏加载,因为在此之后我想用 percy 拍摄快照。我该如何处理?是否可以使其依赖于某些例如 html 类?

0 投票
0 回答
66 浏览

python - 函数 test_example_element 中的参数“needle”到底是什么?从哪里访问它?

最近我开始使用 python 进行可视化测试。我正在将 Needle 与一个名为pytest-needle https://pypi.org/project/pytest-needle/的 python 库一起使用

谁能解释下面一行中的针到底是什么?从哪里访问它?
def test_example_element(针):

0 投票
2 回答
154 浏览

automated-tests - Silk Test Visual Test Pressed Enter Key

Let's say there's only one textbox on a page (no confirm button). I have inputted the text. How do I press enter? (in mobile, I can press the "enter" key in the keyboard, but there's no keyboard in visual test). Can anyone please help me?

EDIT

So in the end I used .NET Script. But I can't integrate the script to Visual Test (the app reinstall itself from the beginning). It works if the scenario fully uses .NET Script, but then I need to change all the Visual Test to .NET Script (I need to make it all in Visual Test or .NET Script).

Does anybody know how to integrate this one function in .NET to Visual Test?

Here's my .NET Script:

Public Module Main

Dim _desktop As Desktop = Agent.Desktop

End Module

====== the script's 'till here (I can't insert it into the code brackets) ======