webdriverio/webdriverio

[🐛 Bug]: negated assertions fail in component tests

Open

#14,059 创建于 2025年1月10日

在 GitHub 查看
 (1 评论) (0 反应) (0 负责人)JavaScript (6,029 star) (1,793 fork)batch import
Bug 🐛help wanted

描述

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

latest

Node.js Version

latest

Mode

Standalone Mode

Which capabilities are you using?

n/a

What happened?

When having assertions like:

await expect($('nonExisting')).not.toBeExisting()

it fails with:

[chrome 131.0.6778.265 mac #0-0] Expect $(`div`) not to be existing

Expected [not]: "not existing"
Received      : "existing"
[chrome 131.0.6778.265 mac #0-0] Error: Expect $(`div`) not to be existing
[chrome 131.0.6778.265 mac #0-0]
[chrome 131.0.6778.265 mac #0-0] Expected [not]: "not existing"
[chrome 131.0.6778.265 mac #0-0] Received      : "existing"

even though $('nonExisting').isExisting() correctly returns false.

What is your expected behavior?

The assertion should pass properly.

How to reproduce the bug.

n/a

Relevant log output

n/a

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

贡献者指南