Conversation
case teodesian#76: It occurred to me that it would be helpful to have something which can replace Selenium::Remote::Driver usage without having to rewrite a bunch of existing tests. The added code here seeks to acccomplish this.
| sub new ( $class, %opts ) { | ||
| _ensure_playwright(); | ||
|
|
||
| my $browser_name = delete $opts{browser_name} // 'firefox'; |
There was a problem hiding this comment.
seems silly to do all this assignment when we just bless underscored versions of the opt keys later
There was a problem hiding this comment.
yea, kind of went off the cob here
| firefox_profile pageLoadStrategy error_handler | ||
| webelement_class ua proxy debug}) { | ||
| if (exists $opts{$ignored}) { | ||
| carp "Playwright::SeleniumMigrator: ignoring Selenium option '$ignored'" |
There was a problem hiding this comment.
Probably should print $class here
| return bless { | ||
| _driver => $opts{_driver}, | ||
| _element => $opts{_element}, | ||
| _id => $opts{_id} // _generate_id(), |
There was a problem hiding this comment.
Anything creating WEs should already have a PW element with a GUID that we can pass as the _id
As such we can just die rather than providing a useless guess
| # avoids ElementHandle disposal issues with type(). | ||
| $eh->click(); | ||
|
|
||
| for my $key_string (@keys) { |
There was a problem hiding this comment.
Seems like a lot of work when you could map the keys to their unicode counterparts, join and fill()
teodesian
left a comment
There was a problem hiding this comment.
Approach seems generally sound, most of the nits to pick here are QoL
|
|
||
| sub get_element_location ($self) { | ||
| my $box = $self->{_element}->boundingBox(); | ||
| return { |
|
Pushed commit with a bit of cleanup based on commentary; comrade toboritsky seemed to pick up on the PR comments mostly like I'd hoped. |
case #76: It occurred to me that it would be helpful to have something which can replace Selenium::Remote::Driver usage without having to rewrite a bunch of existing tests. The added code here seeks to acccomplish this.