是否可以创建可以运行每个功能的尝试捕获块?
因此,我的问题通常是关于根本不理解编程的人们进行一些调试和故障排除。 是否可以创建一种类似的方法:
public foo(method){
try(){
method();
}
catch(error){
console.log(method().name + 'caused an error');
throw Error;
}
通常可以做类似的事情,是的,我知道,即使没有类似的东西,错误也很好,但是例如,如果我正在为一个想知道的客户进行测试关于一切,看看到底出了什么问题。我想让他尽可能多地知道问题,我已经在项目上有吸引力的记者
So, my question is generally about some debugging and troubleshooting for people who don't really understand programming at all.
Is it possible to create a method like:
public foo(method){
try(){
method();
}
catch(error){
console.log(method().name + 'caused an error');
throw Error;
}
is it generally okay to do something like that, yes, I know that errors are shown very good even without something similar but if, for example I'm doing testing for a client who wants to know about everything and see what's exactly goes wrong. I'd like to let him know about problems as much as I can, I already have allure reporter on my project but it is not enough
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可能是。但是,对于您运行的每种单个方法,使用Logger使用Logger将其与步骤描述一起使用的好方法很多。
因此,人们会看到以人类可读形式称为的每一个动作。
他们将具有带有屏幕截图和视频的堆栈跟踪,它不会比这更好。
要在playwright.config文件中使用Allure
列出
在package中
,也可以
。请参阅部分:
on:
httpps://playwright.dev/dev/dev/dev/docs/docs/api/class-testp.-testp.-class-testepp#,测试步骤eRror
用于打开诱人的使用:
还有一件事。剧作家在市场上具有最好的调试模式,它显示您的代码,并且在浏览器中的每个动作请参见: https:https:// playwright。开发/文档/检查员
Probably it is. But there are so many good ways to use logger to use allure report with step description for every single method that you run.
So people will see every action which is called in human-readable form.
They will have a stack trace with screenshot and video, it can't get better than that.
To use allure in playwright.config file use
also, list
in package.json
You can cal every method like this
Also, there is a test error built-in playwright, so you do not need to build your own. See section:
on:
https://playwright.dev/docs/api/class-teststep#test-step-error
For opening allure use:
And one more thing. Playwright has the best debug mode on market, it shows your code and every action in browser see: https://playwright.dev/docs/inspector