-
Notifications
You must be signed in to change notification settings - Fork 253
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
[WIP] Add double click action #675
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @joshgordon, thank you for proposing this new action and for updating the unit tests too.
Was there a particular scenario that you were trying to test, and couldn't... text selection maybe? I'd be interested in hearing about it. Or if this is more just an altruistic effort to expand the portfolio of Pa11y Actions that's great too.
I've left a few low level comments inline - please let me know your thoughts.
Finally, I'm thinking it could be good to add an integration test, the motivation to do this increasing when I spotted this Stack Overflow comment, even if its content no longer applies or came from a misunderstanding.
Here are some example files for our integration test for click
:
Thanks again Josh. Any questions please ask.
test/unit/lib/action.test.js
Outdated
|
||
}); | ||
|
||
describe('.run(browser, page, options, matches) double click', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is now inconsistent with the sibling above, I think this could all be reorganised into this, or something along these lines:
describe('.run(browser, page, options, matches)', () => { // line 233
// common items
describe('click', ...); // new, to wrap items relevant only to click
describe('double click', ...); // new, to wrap items relevant only to double click
});
test/unit/lib/action.test.js
Outdated
clickElementResolvedValue = await clickElementAction.run(puppeteer.mockBrowser, puppeteer.mockPage, {}, clickElementMatches); | ||
}); | ||
|
||
it('clicks the specified element on the page', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it('clicks the specified element on the page', () => { | |
it('double clicks the specified element on the page', () => { |
Co-authored-by: Danyal Aytekin <danyal@alienpaper.com>
We have an ext.js application that expects double-clicks on data-rows to view/change the remainder of the properties of the object described by the row. I played around with clicking multiple times but none of them got the modal to pop up, and finally came to the conclusion that I just needed to patch it in myself. I went ahead and added all the suggestions made. I'll try to find a couple cycles to put together an integration test - that looks straightforward enough. |
This PR adds the ability to trigger double-clicks on elements.