量角器+ Simple-SSH如何在Jasmine中使其同步 [英] Protractor + Simple-SSH how to get it sync together in Jasmine

查看:64
本文介绍了量角器+ Simple-SSH如何在Jasmine中使其同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用量角器编写一些e2e测试. 在一次测试中,我必须使用ssh物理连接到设备,因此我决定 使用 https://www.npmjs.com/package/simple-ssh

当我在量角器测试中使用simple-ssh时,Jasmine不会等待simple-ssh且无法正常工作.

是否有可能将它们同步在一起?

解决方案

我通过使用Jasmine 2.0中的done()解决了这一问题 http://www.htmlgoodies.com/beyond/javascript/stips/using-jasmine-2.0s-new-done-function-to-test-asynchronous-processes.html

I'm writing some e2e tests with protractor . During one test I have to physically connect to device with ssh so i decided to use https://www.npmjs.com/package/simple-ssh

When I use simple-ssh inside my protractor test's , Jasmine doesn't wait for simple-ssh and it is not working.

Is there any possibility to sync that together ?

解决方案

I solved that by using done() from Jasmine 2.0 http://www.htmlgoodies.com/beyond/javascript/stips/using-jasmine-2.0s-new-done-function-to-test-asynchronous-processes.html

这篇关于量角器+ Simple-SSH如何在Jasmine中使其同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆