带量角器端到端测试的电子应用程序 [英] Electron app with protractor end-to-end testing

查看:85
本文介绍了带量角器端到端测试的电子应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发 Electron 应用,现在我想将端到端测试与

I'm currently working on an Electron app and I now want to integrate end-to-end testing with Protractor. I've reviewed the tutorials for Protractor and am now trying to adapt it to Electron. Since Electron runs as a standalone app, how do I do this?

看来,量角器站起来了一个Selenium服务器,然后尝试连接到可用的HTTP服务器并运行测试,例如单击此处,输入的是我的网址,输入此文本等.

It seems that Protractor stands-up a Selenium server that then tries to reach out to an available HTTP server and run tests such as click here, what url am I on, input this text, etc.

因此,我将如何允许硒服务器访问电子实例?

Therefore how would I go about allowing the selenium server access to the electron instance?

无论如何,这是我对局势的看法,我们将不胜感激,并且可以随时纠正我的任何假设.

Anyway that's my mindset on the situation, any help is appreciated and feel free to correct any of my assumptions.

推荐答案

调整

Adapting the instructions documented at Using Selenium and WebDriver, here is what you need to put into your protractor config (using directConnect, as an example):

exports.config = {
    directConnect: true,

    capabilities: {
         browserName: "chrome",
         chromeOptions: {
             binary: '/Path-to-Your-App.app/Contents/MacOS/Atom'  // < IMPORTANT! 
         },  
    },

    // ...
}

(未经测试)

这篇关于带量角器端到端测试的电子应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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