Closed Bug 1975161 Opened 3 months ago Closed 25 days ago

[wdspec] Cookie tests for WebDriver classic can leave set cookies behind causing failures in later tests

Categories

(Remote Protocol :: Marionette, defect, P3)

defect

Tracking

(firefox145 fixed)

RESOLVED FIXED
145 Branch
Tracking Status
firefox145 --- fixed

People

(Reporter: whimboo, Assigned: khalid.alhaddad98, Mentored)

Details

(Whiteboard: [webdriver:m18][webdriver:external][lang=py], [wptsync upstream])

Attachments

(1 file)

When doing the review for https://phabricator.services.mozilla.com/D255275 I noticed that the cookie tests like in add_cookie/add.py do not clean-up the set cookie at the end. The only reason why it currently works and doesn't cause side-effects is that for this test file the last tests at the end of the file are invalid scenarios which clean-up the cookie before and then checking that a cookie cannot be set.

So any situation like the following ones can break tests as run later on:

  • If the invalid tests are failing early and the cookies are not deleted
  • If a new test gets added at the end of the file

We should clean-up all the cookies at the end.

Mentor: hskupin
Severity: -- → S3
Priority: -- → P3
Whiteboard: [webdriver:backlog][lang=py]
Assignee: nobody → khalid20098
Status: NEW → ASSIGNED

Hi, I cleared the cookies before and after each test, is that fine? Or did you want me to clear the cookies only in the end of the test file?

Attachment #9513113 - Attachment description: Bug 1975161 - Add autouse fixture to clear cookies before and after each test, r?#webdriver-reviewers → Bug 1975161 - Add autouse fixture to clear cookies before each test, r?#webdriver-reviewers
Attachment #9513113 - Attachment description: Bug 1975161 - Add autouse fixture to clear cookies before each test, r?#webdriver-reviewers → Bug 1975161 - Add _clean_up_cookies logic into the session clean-up steps. Remove all individual calls to clear_all_cookies in add.py. Verify tests only in add.py, r?#webdriver-reviewers
Attachment #9513113 - Attachment description: Bug 1975161 - Add _clean_up_cookies logic into the session clean-up steps. Remove all individual calls to clear_all_cookies in add.py. Verify tests only in add.py, r?#webdriver-reviewers → Bug 1975161 - Add autouse fixture to clear cookies before each test in files that add cookies via the WebDriver classic API. Remove individual calls to clear_all_cookies, r?#webdriver-reviewers
Attachment #9513113 - Attachment description: Bug 1975161 - Add autouse fixture to clear cookies before each test in files that add cookies via the WebDriver classic API. Remove individual calls to clear_all_cookies, r?#webdriver-reviewers → Bug 1975161 - Add autouse fixture to clear cookies before each test in files that add cookies via the WebDriver classic API. Remove clear_all_cookies helper, r?#webdriver-reviewers
Pushed by hskupin@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/b997348cce2c https://hg.mozilla.org/integration/autoland/rev/c29738378183 Add autouse fixture to clear cookies before each test in files that add cookies via the WebDriver classic API. Remove clear_all_cookies helper, r=webdriver-reviewers,whimboo
Status: ASSIGNED → RESOLVED
Closed: 25 days ago
Resolution: --- → FIXED
Target Milestone: --- → 145 Branch

Khalid, thanks again for your contribution! If you have interest to do more please let us know or try to find another bug yourself. You can contact us here or via the #webdriver Matrix channel.

Whiteboard: [webdriver:backlog][lang=py] → [webdriver:m18][webdriver:external][lang=py]
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/55205 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m18][webdriver:external][lang=py] → [webdriver:m18][webdriver:external][lang=py], [wptsync upstream]
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: