Skip to main content

断言

断言列表

¥List of assertions

断言描述
assertThat(locator).isAttached()元素已附加
assertThat(locator).isChecked()复选框被选中
assertThat(locator).isDisabled()元素被禁用
assertThat(locator).isEditable()元素可编辑
assertThat(locator).isEmpty()容器是空的
assertThat(locator).isEnabled()元素已启用
assertThat(locator).isFocused()元素已聚焦
assertThat(locator).isHidden()元素不可见
assertThat(locator).isInViewport()元素与视口相交
assertThat(locator).isVisible()元素可见
assertThat(locator).containsClass()元素已指定 CSS 类
assertThat(locator).containsText()元素包含文本
assertThat(locator).hasAccessibleDescription()元素具有匹配的 可访问描述
assertThat(locator).hasAccessibleName()元素具有匹配的 可访问的名称
assertThat(locator).hasAttribute()元素具有 DOM 属性
assertThat(locator).hasClass()元素具有类属性
assertThat(locator).hasCount()列表有确切的子级数量
assertThat(locator).hasCSS()元素具有 CSS 属性
assertThat(locator).hasId()元素有一个 ID
assertThat(locator).hasJSProperty()元素具有 JavaScript 属性
assertThat(locator).hasRole()元素具有特定的 ARIA 角色
assertThat(locator).hasText()元素与文本匹配
assertThat(locator).hasValue()输入有一个值
assertThat(locator).hasValues()选择已选择的选项
assertThat(locator).matchesAriaSnapshot()元素与提供的 Aria 快照匹配
assertThat(page).hasTitle()页面有标题
assertThat(page).hasURL()页面有一个 URL
assertThat(response).isOK()响应状态为 OK