Skip to content

Instantly share code, notes, and snippets.

@lucaschain
Last active May 15, 2019 19:09
Show Gist options
  • Save lucaschain/6b433f843ec0945791f1c4d97331fa6d to your computer and use it in GitHub Desktop.
Save lucaschain/6b433f843ec0945791f1c4d97331fa6d to your computer and use it in GitHub Desktop.
Pseudo-automated Sidekiq retry check
const clickCheckbox = el => el.querySelector('[type=checkbox]').click()
const elementContains = (el, content) => ~el.textContent.indexOf(content)
const elementContainsOneOf = (el, contentList) => (
contentList.map(elementContains.bind(null, el)).some(Boolean)
)
const simulationsOnly = el => elementContainsOneOf(el, [
'Api::ServiceUnavailableException: Credit Score is missing',
'Api::NotImplementedException: Input out of bounds'
])
const allRows = Array.from(document.querySelectorAll('tr'))
allRows.filter(simulationsOnly).forEach(clickCheckbox)
@lucaschain
Copy link
Author

lucaschain commented Mar 6, 2018

Just paste it on the console.

This script only checks the boxes, they won't apply any action

@aureliosaraiva
Copy link

gambi ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment