flutter - Listener or rule for flutter_driver tests, to make automatically screenshot, if any one test failed
问题描述
Hello!
There is huge trouble with taking automatically screenshot in flutter, if any test failed in test suite. In general I mean the same solution as it working in JUnit or TestNG. Also I'm tried to wrap all test cases in try/catch, but it didn't work properly... Please help if have any idea how to solve it. Thanks in advance)
For example
In JUnit it's:
import com.codeborne.selenide.junit.ScreenShooter;
public class MyTest {
@rule
public ScreenShooter makeScreenshotOnFailure = ScreenShooter.failedTests();
// `enter code here`
}
In TestNG it's:
import com.codeborne.selenide.testng.ScreenShooter;
@listeners({ ScreenShooter.class})
public class MyTest {
// `enter code here`
}
解决方案
推荐阅读
- html - Safari 浏览器在图像上显示模糊动画以实现缩放和不透明度 CSS 动画
- homebrew - 尝试使用自制软件下载 nvm 时出错
- angular - Angular 指令标签搞乱了 Bootstrap 布局
- c++ - 进程运行时是否可以使用进程输出?
- .net - 在 xaml 中显示当前区域性小数分隔符
- javascript - react组件的执行顺序
- python - 不使用 if-else 的条件参数?
- angular - Angular Eslint config is not extending Project Eslint config
- python - 使用多处理时结合 Pandas DataFrames
- python - 无论如何使用带有 python GUI 框架的 Windows UI 库