【发布时间】:2020-11-17 21:02:47
【问题描述】:
不知道如何检查该元素是否已从 DOM 中消失。
it('closes the modal on the close button click', async () => {
await driver.get('http://localhost:3000/')
const btn = await getElementXpath(driver, "//button[@class='Navbar__button']")
await btn.click()
const closeBtn = await getElementXpath(driver, "//button[@class='Modal__close']")
await closeBtn.click()
const modal = await getElementXpath(driver, '//div[@class="Modal__content"]')
// here I need to check if the element is present
})
【问题讨论】:
标签: selenium selenium-webdriver jestjs