检查 Cypress 中的主机是否在线
我的测试在通过网络界面控制的物联网设备上运行。我想创建一个恢复出厂设置测试,其中涉及设备的重新启动,并且我想循环检查设备是否再次在线(“可 ping”)。有没有办法在 Cypress 内部执行 ping 命令并获取其返回值。
My tests run on a IOT device which is controlled via a web interface. I want to create a factory reset test which involves a reboot of the device and I want to check in a loop if the device is online ("pingable") again. Is there a way to execute the ping command inside of Cypress and get a return value of it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
假设您指的是标准 ping 协议,这就是形式。替换您的设备地址并回复消息。
可能不需要循环,但如果需要,我会使用递归函数
Presuming you mean the standard ping protocol, this is the form. Substitute your device address and reply message.
A loop may not be needed, but if so I'd use a recursive function