Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebDriverPoint::equals always false in firefox (float points) #1086

Open
vertexvaar opened this issue Jan 9, 2024 · 0 comments
Open

WebDriverPoint::equals always false in firefox (float points) #1086

vertexvaar opened this issue Jan 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@vertexvaar
Copy link

vertexvaar commented Jan 9, 2024

Bug description

\Facebook\WebDriver\WebDriverPoint::equals compares its own x and y to the integer value of the other x and y, which will always be false in firefox when the position is a float.

public function equals(self $point)
{
return $this->x === $point->getX() &&
$this->y === $point->getY();
}

image

How could the issue be reproduced

$point = new \Facebook\WebDriver\WebDriverPoint(0.0, 0.0);
if (!$point->equals($point)) {
    throw new LogicException('Point not equals point, but point is the same point! Just making a point here.');
}

Expected behavior

If a point equals a point, it must always be true. Either use $this->x === $other->x or $this->getX() === $other->getX()

Php-webdriver version

1.15.1

PHP version

8.2

How do you start the browser driver or Selenium server

Selenium Hub in Docker Compose with Chrome and Firefox node

Selenium server / Selenium Docker image version

selenium/node-firefox:latest

Browser driver (chromedriver/geckodriver...) version

No response

Browser name and version

Firefox 120.0.1 64bit

Operating system

No response

Additional context

No response

@vertexvaar vertexvaar added the bug Something isn't working label Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant