Skip to content

Commit

Permalink
prevent clicking input when already checked
Browse files Browse the repository at this point in the history
  • Loading branch information
lluisd committed May 20, 2024
1 parent cef99df commit d5c7ac8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions helpers/browserApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ class PuppeteerApi {
await this.page.$eval('button[data-a-target="player-settings-button"]', el => el.click()).catch(() => {})
await this.page.$eval('button[data-a-target="player-settings-menu-item-quality"]', el => el.click()).catch(() => {})
const inputs = await this.page.$$eval('input[name="player-settings-submenu-quality-option"]', elements => {
return elements.map(e => e.id);
return elements.map(e => {
return { id: e.id, checked: e.checked }}
);
}).catch(() => {})
if (inputs && inputs.length > 1) {
const inputId = inputs[1]
if (inputs && inputs.length > 1 && !inputs[1].checked) {
const inputId = inputs[1].id
await this.page.click('#' + inputId).catch(() => {})
}

Expand Down

0 comments on commit d5c7ac8

Please sign in to comment.