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

Implement tag name selector for FindElement and related WebDriver commands #23585

Merged
merged 4 commits into from Jul 21, 2019

Conversation

@georgeroman
Copy link
Contributor

georgeroman commented Jun 17, 2019


  • ./mach build -d does not report any errors
  • ./mach test-tidy does not report any errors
  • There are tests for these changes

This change is Reviewable

@highfive
Copy link

highfive commented Jun 17, 2019

Heads up! This PR modifies the following files:

  • @asajeffrey: components/script/webdriver_handlers.rs, components/webdriver_server/lib.rs, components/script/script_thread.rs
  • @jgraham: components/webdriver_server/lib.rs
  • @KiChjang: components/script/webdriver_handlers.rs, components/script/script_thread.rs, components/script_traits/webdriver_msg.rs
@jdm
Copy link
Member

jdm commented Jun 17, 2019

@highfive highfive assigned jdm and unassigned nox Jun 17, 2019
@bors-servo
Copy link
Contributor

bors-servo commented Jun 17, 2019

📌 Commit e2596e3 has been approved by jdm

bors-servo added a commit that referenced this pull request Jun 17, 2019
…_wd_commands, r=jdm

Implement tag name selector for FindElement and related WebDriver commands

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23585)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jun 17, 2019

Testing commit e2596e3 with merge f3ce98a...

@bors-servo
Copy link
Contributor

bors-servo commented Jun 17, 2019

💔 Test failed - linux-rel-wpt

@highfive
Copy link

highfive commented Jun 17, 2019

Test failures:

Unexpected subtest result in /webdriver/tests/find_elements/find.py: │ FAIL [expected PASS] test_find_elements[css selector-#linkText] │ → assert 0 == 1 │ │ session = , using = 'css selector' │ value = '#linkText' │ │ @pytest.mark.parametrize("using,value", │ [("css selector", "#linkText"), │ ("link text", "full link text"), │ ("partial link text", "link text"), │ ("tag name", "a"), │ ("xpath", "//a")]) │ def test_find_elements(session, using, value): │ # Step 8 - 9 │ session.url = inline("full link text") │ │ response = find_elements(session, using, value) │ assert_success(response) │ > assert len(response.body["value"]) == 1 │ E assert 0 == 1 │ E + where 0 = len([]) │ │ response = │ session = │ using = 'css selector' │ value = '#linkText' │ └ tests/wpt/web-platform-tests/webdriver/tests/find_elements/find.py:52: AssertionError
  ▶ Unexpected subtest result in /webdriver/tests/find_elements/find.py:
  │ FAIL [expected PASS] test_find_elements[tag name-a]
  │   → assert 0 == 1
  │ 
  │ session = <Session b99bec99-4fdc-43dc-9d57-432e76a59156>, using = 'tag name'
  │ value = 'a'
  │ 
  │     @pytest.mark.parametrize("using,value",
  │                              [("css selector", "#linkText"),
  │                               ("link text", "full link text"),
  │                               ("partial link text", "link text"),
  │                               ("tag name", "a"),
  │                               ("xpath", "//a")])
  │     def test_find_elements(session, using, value):
  │         # Step 8 - 9
  │         session.url = inline("<a href=# id=linkText>full link text</a>")
  │     
  │         response = find_elements(session, using, value)
  │         assert_success(response)
  │ >       assert len(response.body["value"]) == 1
  │ E       assert 0 == 1
  │ E        +  where 0 = len([])
  │ 
  │ response   = <Responsetatus=200 body={"value": []}>
  │ session    = <Session b99bec99-4fdc-43dc-9d57-432e76a59156>
  │ using      = 'tag name'
  │ value      = 'a'
  │ 
  └ tests/wpt/web-platform-tests/webdriver/tests/find_elements/find.py:52: AssertionError

  ▶ Unexpected subtest result in /webdriver/tests/find_element_from_element/find.py:
  │ FAIL [expected PASS] test_find_element[css selector-#linkText]
  │   → AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ session = <Session fadbd0f1-8acf-4ef8-bab5-4ad5109b6a8a>, using = 'css selector'
  │ value = '#linkText'
  │ 
  │     @pytest.mark.parametrize("using,value",
  │                              [("css selector", "#linkText"),
  │                               ("link text", "full link text"),
  │                               ("partial link text", "link text"),
  │                               ("tag name", "a"),
  │                               ("xpath", "//a")])
  │     def test_find_element(session, using, value):
  │         # Step 8 - 9
  │         session.url = inline("<div><a href=# id=linkText>full link text</a></div>")
  │         element = session.find.css("div", all=False)
  │ >       response = find_element(session, element.id, using, value)
  │ E       AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ element    = None
  │ session    = <Session fadbd0f1-8acf-4ef8-bab5-4ad5109b6a8a>
  │ using      = 'css selector'
  │ value      = '#linkText'
  │ 
  └ tests/wpt/web-platform-tests/webdriver/tests/find_element_from_element/find.py:56: AttributeError

  ▶ Unexpected subtest result in /webdriver/tests/find_element_from_element/find.py:
  │ FAIL [expected PASS] test_find_element[tag name-a]
  │   → AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ session = <Session fadbd0f1-8acf-4ef8-bab5-4ad5109b6a8a>, using = 'tag name'
  │ value = 'a'
  │ 
  │     @pytest.mark.parametrize("using,value",
  │                              [("css selector", "#linkText"),
  │                               ("link text", "full link text"),
  │                               ("partial link text", "link text"),
  │                               ("tag name", "a"),
  │                               ("xpath", "//a")])
  │     def test_find_element(session, using, value):
  │         # Step 8 - 9
  │         session.url = inline("<div><a href=# id=linkText>full link text</a></div>")
  │         element = session.find.css("div", all=False)
  │ >       response = find_element(session, element.id, using, value)
  │ E       AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ element    = None
  │ session    = <Session fadbd0f1-8acf-4ef8-bab5-4ad5109b6a8a>
  │ using      = 'tag name'
  │ value      = 'a'
  │ 
  └ tests/wpt/web-platform-tests/webdriver/tests/find_element_from_element/find.py:56: AttributeError

  ▶ Unexpected subtest result in /webdriver/tests/find_element_from_element/find.py:
  │ FAIL [expected PASS] test_null_parameter_value
  │   → AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ session = <Session fadbd0f1-8acf-4ef8-bab5-4ad5109b6a8a>
  │ http = <tests.support.http_request.HTTPRequest object at 0x7f129101f610>
  │ 
  │     def test_null_parameter_value(session, http):
  │         session.url = inline("<div><a href=# id=linkText>full link text</a></div>")
  │         element = session.find.css("div", all=False)
  │     
  │         path = "/session/{session_id}/element/{element_id}/element".format(
  │ >           session_id=session.session_id, element_id=element.id)
  │ E       AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ element    = None
  │ http       = <tests.support.http_request.HTTPRequest object at 0x7f129101f610>
  │ session    = <Session fadbd0f1-8acf-4ef8-bab5-4ad5109b6a8a>
  │ 
  └ tests/wpt/web-platform-tests/webdriver/tests/find_element_from_element/find.py:22: AttributeError

  ▶ Unexpected subtest result in /webdriver/tests/find_elements_from_element/find.py:
  │ FAIL [expected PASS] test_find_elements[tag name-a]
  │   → AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ session = <Session 8e27bf6d-03f2-4d06-994d-ffc6bf4f4d74>, using = 'tag name'
  │ value = 'a'
  │ 
  │     @pytest.mark.parametrize("using,value",
  │                              [("css selector", "#linkText"),
  │                               ("link text", "full link text"),
  │                               ("partial link text", "link text"),
  │                               ("tag name", "a"),
  │                               ("xpath", "//a")])
  │     def test_find_elements(session, using, value):
  │         # Step 8 - 9
  │         session.url = inline("<div><a href=# id=linkText>full link text</a></div>")
  │         element = session.find.css("div", all=False)
  │ >       response = find_elements(session, element.id, using, value)
  │ E       AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ element    = None
  │ session    = <Session 8e27bf6d-03f2-4d06-994d-ffc6bf4f4d74>
  │ using      = 'tag name'
  │ value      = 'a'
  │ 
  └ tests/wpt/web-platform-tests/webdriver/tests/find_elements_from_element/find.py:56: AttributeError

  ▶ Unexpected subtest result in /webdriver/tests/find_elements_from_element/find.py:
  │ FAIL [expected PASS] test_no_element[css selector-#wontExist]
  │   → AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ session = <Session 8e27bf6d-03f2-4d06-994d-ffc6bf4f4d74>, using = 'css selector'
  │ value = '#wontExist'
  │ 
  │     @pytest.mark.parametrize("using,value", [("css selector", "#wontExist")])
  │     def test_no_element(session, using, value):
  │         # Step 8 - 9
  │         session.url = inline("<div></div>")
  │         element = session.find.css("div", all=False)
  │ >       response = find_elements(session, element.id, using, value)
  │ E       AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ element    = None
  │ session    = <Session 8e27bf6d-03f2-4d06-994d-ffc6bf4f4d74>
  │ using      = 'css selector'
  │ value      = '#wontExist'
  │ 
  └ tests/wpt/web-platform-tests/webdriver/tests/find_elements_from_element/find.py:112: AttributeError

  ▶ Unexpected subtest result in /webdriver/tests/find_elements_from_element/find.py:
  │ FAIL [expected PASS] test_find_elements[css selector-#linkText]
  │   → AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ session = <Session 8e27bf6d-03f2-4d06-994d-ffc6bf4f4d74>, using = 'css selector'
  │ value = '#linkText'
  │ 
  │     @pytest.mark.parametrize("using,value",
  │                              [("css selector", "#linkText"),
  │                               ("link text", "full link text"),
  │                               ("partial link text", "link text"),
  │                               ("tag name", "a"),
  │                               ("xpath", "//a")])
  │     def test_find_elements(session, using, value):
  │         # Step 8 - 9
  │         session.url = inline("<div><a href=# id=linkText>full link text</a></div>")
  │         element = session.find.css("div", all=False)
  │ >       response = find_elements(session, element.id, using, value)
  │ E       AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ element    = None
  │ session    = <Session 8e27bf6d-03f2-4d06-994d-ffc6bf4f4d74>
  │ using      = 'css selector'
  │ value      = '#linkText'
  │ 
  └ tests/wpt/web-platform-tests/webdriver/tests/find_elements_from_element/find.py:56: AttributeError

  ▶ Unexpected subtest result in /webdriver/tests/find_elements_from_element/find.py:
  │ FAIL [expected PASS] test_null_parameter_value
  │   → AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ session = <Session 8e27bf6d-03f2-4d06-994d-ffc6bf4f4d74>
  │ http = <tests.support.http_request.HTTPRequest object at 0x7f1281fdb150>
  │ 
  │     def test_null_parameter_value(session, http):
  │         session.url = inline("<div><a href=# id=linkText>full link text</a></div>")
  │         element = session.find.css("div", all=False)
  │     
  │         path = "/session/{session_id}/element/{element_id}/elements".format(
  │ >           session_id=session.session_id, element_id=element.id)
  │ E       AttributeError: 'NoneType' object has no attribute 'id'
  │ 
  │ element    = None
  │ http       = <tests.support.http_request.HTTPRequest object at 0x7f1281fdb150>
  │ session    = <Session 8e27bf6d-03f2-4d06-994d-ffc6bf4f4d74>
  │ 
  └ tests/wpt/web-platform-tests/webdriver/tests/find_elements_from_element/find.py:22: AttributeError
@georgeroman
Copy link
Contributor Author

georgeroman commented Jun 17, 2019

Hmm, this is weird, these tests are passing locally.

@jdm
Copy link
Member

jdm commented Jun 17, 2019

What operating system are you using?

@georgeroman
Copy link
Contributor Author

georgeroman commented Jun 17, 2019

I'm using Arch Linux.

@jdm
Copy link
Member

jdm commented Jul 4, 2019

@georgeroman What's the plan for this PR?

@georgeroman
Copy link
Contributor Author

georgeroman commented Jul 4, 2019

Once I'm finished with the current work on returning arrays and objects from ExecuteScript I will come back to it and dive deeper into what might cause the tests fail on the CI.

@georgeroman
Copy link
Contributor Author

georgeroman commented Jul 11, 2019

I rebased this, it will hopefully pass the tests now.

@jdm
Copy link
Member

jdm commented Jul 11, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Jul 11, 2019

Trying commit 3deb1f3 with merge ce5b643...

bors-servo added a commit that referenced this pull request Jul 11, 2019
…_wd_commands, r=<try>

Implement tag name selector for FindElement and related WebDriver commands

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23585)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 11, 2019

💔 Test failed - linux-rel-wpt

@georgeroman
Copy link
Contributor Author

georgeroman commented Jul 12, 2019

I suspect that something is going wrong with the way the fixture html files are provided:

session.url = inline("<a href=# id=linkText>full link text</a>")

Could I add some debug prints and then test them in the CI server?

@jdm
Copy link
Member

jdm commented Jul 12, 2019

Sure! Add yourself to https://github.com/servo/saltfs/blob/master/homu/files/cfg.toml so we can grant you access to do try runs when you need to.

@georgeroman
Copy link
Contributor Author

georgeroman commented Jul 18, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Jul 18, 2019

Trying commit 03a0018 with merge 67cccdf...

bors-servo added a commit that referenced this pull request Jul 18, 2019
…_wd_commands, r=<try>

Implement tag name selector for FindElement and related WebDriver commands

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23585)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 18, 2019

💔 Test failed - linux-rel-wpt

@jdm
Copy link
Member

jdm commented Jul 19, 2019

@bors-servo delegate+

@bors-servo
Copy link
Contributor

bors-servo commented Jul 19, 2019

✌️ @georgeroman can now approve this pull request

@jdm jdm removed the S-awaiting-review label Jul 19, 2019
@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2019

The latest upstream changes (presumably #23808) made this pull request unmergeable. Please resolve the merge conflicts.

@georgeroman
Copy link
Contributor Author

georgeroman commented Jul 21, 2019

@bors-servo try=wpt

@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2019

Trying commit bf6ea64 with merge 583ee37...

bors-servo added a commit that referenced this pull request Jul 21, 2019
…_wd_commands, r=<try>

Implement tag name selector for FindElement and related WebDriver commands

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23585)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
State: approved= try=True

@jdm
Copy link
Member

jdm commented Jul 21, 2019

@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2019

📌 Commit bf6ea64 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2019

Testing commit bf6ea64 with merge 7527596...

bors-servo added a commit that referenced this pull request Jul 21, 2019
…_wd_commands, r=jdm

Implement tag name selector for FindElement and related WebDriver commands

<!-- Please describe your changes on the following line: -->

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- Either: -->
- [X] There are tests for these changes

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23585)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Jul 21, 2019

☀️ Test successful - linux-rel-css, linux-rel-wpt, status-taskcluster
Approved by: jdm
Pushing 7527596 to master...

@bors-servo bors-servo merged commit bf6ea64 into servo:master Jul 21, 2019
3 checks passed
3 checks passed
Taskcluster (pull_request) TaskGroup: success
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.