【发布时间】:2022-06-29 02:19:56
【问题描述】:
HTML:
<div class="example-event Gantt-event event_class_color Gannt-event-another-edit" data-object-type-id="4" data-is-people="true" data-is-taken="false" data-is-externalorder="false" data-is-inaccessibility="false" data-work-status="1" title="SEPP-16288" style="width: 400px; height: 18px; left: 400px; top: 5px; line-height: 18px; background: repeating-linear-gradient(45deg, rgb(255, 243, 204), rgb(255, 243, 204) 10px, rgb(249, 30, 26) 10px, rgb(249, 30, 26) 20px);"></div>
我有几个相同的元素,但风格不同。赛普拉斯有什么方法可以按样式选择元素,但版本比:
cy.get('[style="width: 400px; height: 18px; left: 400px; top: 5px; line-height: 18px; background: repeating-linear-gradient(45deg, rgb(255, 243, 204), rgb(255, 243, 204) 10px, rgb(249, 30, 26) 10px, rgb(249, 30, 26) 20px);"]') ?例如只使用背景颜色或高度?
【问题讨论】:
-
你有几个
data属性。如果他们不改变每次运行,您可以使用这些吗?
标签: cypress