jest-puppeteer
jest-puppeteer copied to clipboard
ability toClick() radioButtons
🚀 Feature Proposal
Please provide the ability to select radioButtons and checkBoxes via .toClick() function
Motivation
There is no easy way to target Radio Buttons and Check Boxes based on their values like there is a function to select values from Dropdowns
Example
something like
await expect(page).toClick('radio', { value: 'Yes' });
for the element:
<input id="taxClient" type="radio" value="Yes">
Hi, so I haven't tried this but does await expect(page).toClick('input[type="radio"][value="Yes"]');
work?
I use this for radio buttons until the feature is ready:
await page.evaluate(() => { let radio = document.querySelector("#myRadio"); radio.click(); });
Using the correct selector it works, so I close this issue.