Last active
May 15, 2019 19:09
-
-
Save lucaschain/6b433f843ec0945791f1c4d97331fa6d to your computer and use it in GitHub Desktop.
Pseudo-automated Sidekiq retry check
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
gambi ❤️