Skip to content

WebDriver 5: seeTextEquals passes for any string if element is empty #1561

Closed
@mirao

Description

@mirao

It works as expected with WebDriver 4 and doesn't work with WebDriver 5.

What are you trying to achieve?

I want to test if the exact text "Authentication failed." appears in the p subelement of

<div class="ui error message">
  <div class="content">
    <p></p>
  </div>
</div>

Let's say now there is no value in p.
So I.seeTextEquals("Authentication failed.", ".error.message"); should fail.

What do you get instead?

Provide console output if related. Use --verbose mode for more details.

This test passes:

Emitted | step.start (I see text equals "Authentication failed.", ".error.message")
    I see text equals "Authentication failed.", ".error.message"
    › [SmartWait (20000ms)] Locating .error.message in 20000
    Emitted | step.passed (I see text equals "Authentication failed.", ".error.message")
    Emitted | step.finish (I see text equals "Authentication failed.", ".error.message")

Provide test source code if related

    I.seeTextEquals("Authentication failed.", ".error.message");

Details

  • CodeceptJS version: 2.0.7
  • NodeJS Version: 10.15.1
  • Operating System: Ubuntu 18.10
  • WebDriver: 5.7.2
  • Configuration file:
exports.config = {
    tests: "./*_test.js",
    output: "./output",
    helpers: {
        WebDriver: {
            url: "http://localhost",
            browser: process.profile || "chrome",
            waitForTimeout: 20000,
            smartWait: 20000
        }
    },
    include: {
        I: "./steps_file.js"
    },
    bootstrap: null,
    mocha: {},
    name: "demo"
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions