【问题标题】:Layout Testing - Web Testing布局测试 - 网页测试
【发布时间】:2011-03-20 08:34:53
【问题描述】:
【问题讨论】:
标签:
testing
user-interface
layout
automation
【解决方案2】:
您可以为此使用 Galen 框架,请参阅此处的介绍:http://holisticon.github.io/presentations/jsunconf_galen/#/
基本上你在 DSL 中定义你的规范:
@ Overall layout | *
--------------------------
content
visible
navbar
visible
content
below: navbar 370 to 410 px
@ navigation hidden on mobile | mobile
--------------------------
navbar-item-*
absent
@ navigation shown on desktop | desktop
--------------------------
navbar-item-*
visible
@ Content should fit to screen size | mobile
--------------------------
content
width: 100% of screen/width
@ Content should fit to screen size | desktop
--------------------------
content
width: 80 to 90% of screen/width
您可以在此处找到更多示例代码:https://github.com/hypery2k/galen_samples