CSS单元测试 [英] CSS Unit Testing

查看:74
本文介绍了CSS单元测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

几次快速搜索发现,我显然不是 第一个人有思想我可以单元测试我的CSS吗?

A few quick searches discovered that I'm obviously not the first person to have the thought "Can I unit test my CSS?".

我想知道这里的人是否已经采用CSS单元测试成功?

I'm wondering if anyone here has taken on CSS Unit Testing successfully? If you've tried and failed, or just have your own theories, please tell me why it (apparently) hasn't been done yet?

推荐答案

您可以使用Selenium,它是一个Web测试框架。这样,您可以声明要将什么样式应用于DOM中的元素等。

You could use Selenium, which is a web testing framework. This way you could assert what styles are to be applied to elements in the DOM etc.

Selenium

否则,不知道你的目的是什么。单元测试,顾名思义,测试单元,对我来说,这只对代码而不是css有意义。

Otherwise, not sure what your aim is. Unit testing is, as the name suggests, testing 'Units', and to me, this only makes sense with code, not css.

这篇关于CSS单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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