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()元素具有 class 属性
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