Add helper to assert and transform browsing and user contexts in emulation commands
Categories
(Remote Protocol :: WebDriver BiDi, task, P3)
Tracking
(firefox148 fixed)
| Tracking | Status | |
|---|---|---|
| firefox148 | --- | fixed |
People
(Reporter: Sasha, Assigned: sameembaba, Mentored)
Details
(Whiteboard: [webdriver:m18][lang=js][webdriver:external])
Attachments
(1 file)
In the emulation commands such "setGeolocationOverride" and "setLocaleOverride" we repeat the following steps:
- assert that at least one of the contexts or user contexts are provided (and not both);
- for browsing contexts, check if it exists and top level, extract to set of navigables;
- for user contexts, check if exists, get navigables and extract to set of internal user contexts.
We could create a helper (or multiple helpers) to avoid repetition.
There is a similar algorithm in "browsingContext.setViewport" command, with the only difference that there can be only one browsing context as an argument, but the rest is similar to emulation commands, so we could probably simplify it as well.
| Reporter | ||
Updated•5 months ago
|
Hello, I would like to work on this issue, can I get assigned to it?
| Reporter | ||
Comment 2•5 months ago
|
||
(In reply to sabina from comment #1)
Hello, I would like to work on this issue, can I get assigned to it?
Sure, done. Let me know if you need more information :)
| Reporter | ||
Comment 3•5 months ago
|
||
Hi Sabina!
How is it going with the bug? Do you maybe need some help?
Let us know :)
Hello, sorry for disappearing, I was busy lately. I will work on this issue this week.
| Reporter | ||
Comment 5•4 months ago
|
||
Hey, Sabina!
Just checking again if it's going fine with the bug :)
There is a similar algorithm in "browsingContext.setViewport" command, with the only difference that there can be only one browsing context as an argument, but the rest is similar to emulation commands, so we could probably simplify it as well.
Should helpers created for "setGeolocationOverride" and "setLocaleOverride" cases be applicable to "browsingContext.setViewport" as well?
| Reporter | ||
Comment 7•3 months ago
|
||
(In reply to sabina from comment #6)
Should helpers created for "setGeolocationOverride" and "setLocaleOverride" cases be applicable to "browsingContext.setViewport" as well?
Ideally, yes :) But if it gets too complicated we can move this part to follow-up.
| Reporter | ||
Comment 8•1 month ago
|
||
Hey @sabina,
do you still have time to work on the bug? If not, it's no problem, just let us know so we can reset the assignee.
| Reporter | ||
Updated•20 days ago
|
| Reporter | ||
Updated•20 days ago
|
| Assignee | ||
Comment 9•17 days ago
|
||
hey there! Can i work on this issue?
| Assignee | ||
Comment 10•17 days ago
|
||
I’d be happy to take this issue if it’s available. I’ve been reviewing the description and understand the repeated logic in the emulation commands (setGeolocationOverride, setLocaleOverride). I’m setting up the build environment now
| Reporter | ||
Comment 11•16 days ago
|
||
Hi Sameem, sure, go ahead! I assigned the bug to you. Please let me know if you have any questions.
Just a note that since the bug was created, we added more emulation commands that share the same assertion logic, and it would be great to update them as well.
| Assignee | ||
Comment 12•15 days ago
|
||
| Assignee | ||
Comment 13•14 days ago
|
||
Hi Sasha,
I’ve addressed the issues mentioned earlier and updated the patch accordingly. The refactor preserves existing behavior and validation. Please let me know if anything else needs adjustment.
Comment 14•14 days ago
|
||
| Assignee | ||
Comment 15•14 days ago
|
||
Hi Sasha,
Thanks for guiding me through this first patch! I really enjoyed working on the WebDriver BiDi module and learning about how the emulation commands work.
Since I have my build environment set up and familiarized myself with the code structure, I would love to contribute more to this component.
Do you have any other "good first bugs" or backlog tasks in WebDriver BiDi (or related remote modules) that I could tackle next?
Comment 16•13 days ago
|
||
| bugherder | ||
Comment 17•9 days ago
|
||
Sameem thanks a lot! Great to see that we are now able to get rid of this massive code duplication.
Description
•