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

element position #2

Closed
spyoungtech opened this issue Oct 16, 2017 · 4 comments
Closed

element position #2

spyoungtech opened this issue Oct 16, 2017 · 4 comments
Labels
Chrome 🌐 For browser-specific issues affecting Chrome.
Milestone

Comments

@spyoungtech
Copy link
Owner

Appears to be some issues with detecting element position on the x/y axes. Not sure the root cause.

Failing scenarios

  tests\experimental-features\elementPosition.feature:12  The element #square100x100 is at XX pixels on the X axis
  tests\experimental-features\elementPosition.feature:16  The element #square100x100 is at XX pixels on the Y axis

Test output for failing scenarios

  Scenario: The element #square100x100 is at XX pixels on the X axis                # tests\experimental-features\elementPosition.feature:12
    Given I open the site "/"                                                       # behave_webdriver\steps\given.py:15
    And I have a screen that is 800 by 600 pixels                                   # behave_webdriver\steps\given.py:199
    And the element "#square100x100" is 100px broad                                 # behave_webdriver\steps\given.py:177
    And the element "#square100x100" is 100px tall                                  # behave_webdriver\steps\given.py:177
    When I scroll to element "#square100x100"                                       # behave_webdriver\steps\when.py:97
    Then I expect that element "#square100x100" is positioned at 40px on the x axis # behave_webdriver\steps\then.py:199
      Assertion Failed: Position was 32 on the x axis


  @Pending
  Scenario: The element #square100x100 is at XX pixels on the Y axis                 # tests\experimental-features\elementPosition.feature:16
    Given I open the site "/"                                                        # behave_webdriver\steps\given.py:15
    And I have a screen that is 800 by 600 pixels                                    # behave_webdriver\steps\given.py:199
    And the element "#square100x100" is 100px broad                                  # behave_webdriver\steps\given.py:177
    And the element "#square100x100" is 100px tall                                   # behave_webdriver\steps\given.py:177
    When I scroll to element "#square100x100"                                        # behave_webdriver\steps\when.py:97
    Then I expect that element "#square100x100" is positioned at 843px on the y axis # behave_webdriver\steps\then.py:199
      Assertion Failed: Position was 1084 on the y axis
@spyoungtech spyoungtech added this to the 0.0.1 milestone Oct 16, 2017
@spyoungtech spyoungtech mentioned this issue Oct 16, 2017
@spyoungtech
Copy link
Owner Author

Looking closer at this one, for x-axis, it's very likely that chrome's scrollbar throwing off the expected result.

@spyoungtech
Copy link
Owner Author

spyoungtech commented Feb 14, 2018

Working closer with this, there are several factors that affect the specific x/y position of an element and it will vary between browsers and environments. We may need to change the tests from the original webdriverio/cucumber-boilerplate numbers to what happens to fit our CI environment.

Further, as we develop cross-browser testing, it may be apt to make a test that implements something like 'between x1 and x2 on the <> axis'

@spyoungtech
Copy link
Owner Author

This may even be a problem to get the tests to agree with one another... Between one build to the next, the element position seems like it can vary for some reason.

Perhaps there is a race condition.

@spyoungtech
Copy link
Owner Author

Because the core problem remaining is simply related to testing and the element position actually appears to, in fact, be reported correctly, I'll close this issue. May be reopened as another issue for improving tests.

@spyoungtech spyoungtech added Chrome 🌐 For browser-specific issues affecting Chrome. new feature ✨ labels Mar 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chrome 🌐 For browser-specific issues affecting Chrome.
Projects
None yet
Development

No branches or pull requests

1 participant