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

default output for ->find_no_element_ok #335

Open
davewood opened this issue Aug 30, 2017 · 6 comments
Open

default output for ->find_no_element_ok #335

davewood opened this issue Aug 30, 2017 · 6 comments
Assignees

Comments

@davewood
Copy link

davewood commented Aug 30, 2017

shouldnt the default output for find_no_element_ok say something like "element not found", or "find_no_element_ok", ...?

$driver->find_no_element_ok( "testcontact-hzsbvpze", "link_text" );

ok 17 - find_elements'testcontact-hzsbvpze' link_text'
@teodesian
Copy link
Owner

Whoever thought we should provide the assertion text needs to have their heads examined. Anything we can do automatically is guaranteed to be meaningless -- whee, I couldn't find an element with some selector. So? Does that mean I can figure out any better what the actual problem is? No.

Nevertheless, for those desiring useless output, I guess this would be better than what it does already, which is not much. I'll look at adjusting the assert text for this next release.

@teodesian teodesian self-assigned this Sep 3, 2017
@davewood
Copy link
Author

davewood commented Sep 12, 2017

thanks for your reply, this seems a bit missformatted aswell.

note the misbalanced quotes and missing spaces.

my $xpath = q{//contact-relationships//a[text()="testcontact-fiykcqgg"]};
$driver->find_element_ok($xpath, "xpath");

ok 5 - find_element'//contact-relationships//a[text()="testcontact-fiykcqgg"]' xpath'

@teodesian
Copy link
Owner

yep. I'm guessing the DWIM for the above example is to make sure the selector and type printed are copy/pastable without modification. I'll look at ensuring that is the case.

@teodesian
Copy link
Owner

Notes: T::S::R::D::Role::DoesTesting is basically just shooting out the args to _check_ok(), which are basically the args to whatever finder method it's using. It looks so dumb due to it just being an interpolated @Args array.

I'll have to make a new handler sub to try and "do the right thing" in the context. This would have been less work if the module had been designed as straightforward wrappers rather than this too-clever by half use of Sub::Install. But, it's too late to change that now.

@davewood
Copy link
Author

davewood commented Nov 7, 2017

whatever, just make the pain go away. :) nah, seriously, thank you for your work,.

@teodesian
Copy link
Owner

Feel free to ignore my babbling, I tend to leave notes in cases for later use -- It's usually the odd couple of hours every few days I can look at this stuff so I gotta record my findings when I can. It also usually helps to sleep on problems like this. In any case, I think I can make this code even simpler and fix a bug (it looks as though whether or not we find/don't find the element we probably return true (oh no!))

bschmalhofer added a commit to bschmalhofer/Selenium-Remote-Driver that referenced this issue Apr 11, 2021
bschmalhofer added a commit to bschmalhofer/Selenium-Remote-Driver that referenced this issue Apr 11, 2021
as $method is no longer changed in the sub.
Slightly nicer formatting of the generic test name.
bschmalhofer added a commit to bschmalhofer/Selenium-Remote-Driver that referenced this issue Apr 11, 2021
Use early return where possible.
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
as $method is no longer changed in the sub.
Slightly nicer formatting of the generic test name.
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
Use early return where possible.
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
as $method is no longer changed in the sub.
Slightly nicer formatting of the generic test name.
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
Use early return where possible.
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
as $method is no longer changed in the sub.
Slightly nicer formatting of the generic test name.
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
Use early return where possible.
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
as $method is no longer changed in the sub.
Slightly nicer formatting of the generic test name.
KohaAloha pushed a commit to KohaAloha/Selenium-Remote-Driver that referenced this issue Sep 29, 2022
Use early return where possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants