使用phantomJS进行端到端测试时确保IE-9兼容性 [英] Ensuring IE-9 compatibility while end to end testing using phantomJS

查看:130
本文介绍了使用phantomJS进行端到端测试时确保IE-9兼容性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用PhantomJS(无头端到端测试),selenium webdriver,grunt(任务运行器)来进行我的应用程序测试。我的要求是应用程序应该与IE-9兼容。我必须进行无头测试,因为我正在使用jenkins进行持续集成。


我如何确保我的应用程序能够完美运行IE-9
在phantomJS上测试?


解决方案

PhantomJS用于测试与Internet Explorer的兼容性,因为它是一个Webkit浏览器。



由于您使用的是Selenium,因此您应该可以使用IE WebDriver。



关于为什么你甚至无法在PhantomJS中模拟IE的一些想法:


  • 建立在不同的基础技术上。他们使用不同的渲染引擎,并且在遵守W3C规范时都有不同的错误。

  • JavaScript错误可能是模拟的,但这需要您继续并通过交换一些浏览器API的实现来修复PhantomJS与您的特定IE版本相比的所有缺陷。您还需要引入一些存在于您的IE版本中的错误,但不会再通过交换实现方式再次出现在PhantomJS中。

  • 只有更改WebKit实现并编译时才能引入CSS错误它再次。您必须首先找到它们。



太好了,您已经有效地逆向设计了IE。

I am using PhantomJS (headless end to end testing),selenium webdriver,grunt(task runner) for my application testing. My requirement is that the application should be compatible with IE-9. I have to do headless testing because I'm using jenkins for continuous integration.

How do i make sure that my application will run perfectly on IE-9 while testing on phantomJS ?

解决方案

You can't use PhantomJS for testing compatibility with Internet Explorer, because it is a Webkit browser.

Since you're using Selenium, you should be able to use the IE WebDriver.

Some thoughts on why you can't even simulate IE in PhantomJS:

  • They are built on different base technologies. They use different rendering engines and both have different bugs when it comes to adhering to W3C specifications.
  • JavaScript bugs may be simulatable, but this requires you to go ahead and fix all bugs that PhantomJS has in comparison to your specific IE version by exchanging the implementation of some browser APIs. You would also need to introduce some bugs that are present in your IE version, but not in PhantomJS again by exchanging implementation.
  • CSS bugs can only be introduced if you change the WebKit implementation and compile it again. You would have to find them first.

Great, you have effectively reverse engineered IE.

这篇关于使用phantomJS进行端到端测试时确保IE-9兼容性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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