你可以同时使用 Protractor 和 Appium 来测试混合应用程序吗? [英] Can you use Protractor and Appium together to test hybrid apps?

查看:33
本文介绍了你可以同时使用 Protractor 和 Appium 来测试混合应用程序吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的场景.我有一个建立在 Angular JS 之上的网站.我能够使用量角器自动化网站.但是,在网站上执行的某些操作会反映在 Android 和 IOS 设备中.

Here is my scenario. I have a website which is built on top of Angular JS. I am able to automate the website using protractor. However there are certain actions which when performed on website are reflected in Android and IOS devices.

这就是我想要实现的目标.

Here's what I want to achieve.

像往常一样在网站上运行我的测试,但我也想触发命令来测试 android 和 ios 应用程序

Run my tests on website like I normally do but I want to fire commands to test the android and ios app also

    /*
    For eg:  
    1. Change password on website using protractor 
    2. Launch android app and check if the password has been changed
    3. Switch back to protractor tests for website
    */
    it('Change password and check on IOS and Android device' , function()
    {
           changePasswordOnWeb();
           OpenMobileAppInDeviceUsingAppium();
           checNewkPasswordOnMobileApp();
    });

有可能吗?如果是,你能指出我的任何教程吗?

Is it possible? If it is can you point me to any of the tutorials?

推荐答案

回答你的问题,是的,你可以集成 protractor 和 appium.虽然到目前为止 Protractor 还没有正式支持 appium,但您仍然可以通过以下详细信息使其成为可能.Protractor 文档中有一个帮助文件.您需要做的就是更新您的 conf.js 文件以包含 appium 配置,并记住在运行测试脚本之前启动您的 appium 服务器.请注意以下几点 -

To answer your question, yes you can integrate protractor and appium. Though as of now Protractor doesn't support appium officially, you can still make it possible with the below details. There is a help file that is available in Protractor docs. All you need to do is update your conf.js file to include the appium configurations and remember to start your appium server before you run the test script. Take care of below points -

  1. 开始你的 avd

  1. Start your avd

在您将通过 appium 调用的 avd 中安装 .apk 文件

Install the .apk file in your avd that you will be invoking through appium

使用命令-appium &

Start the appium server using command - appium &

更新您的量角器 conf.js 文件以包含 appium android/chrome 配置.有关配置的更多详细信息,请参见以下链接.

Update your protractor conf.js file to include appium android/chrome configurations. More details about configurations can be found in the below link.

这里是更多信息的链接 - Protractor-Appium设置 .希望这会有所帮助

Here's the link to more info on this - Protractor-Appium Setup . Hope this helps

这篇关于你可以同时使用 Protractor 和 Appium 来测试混合应用程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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