Skip to content

Instantly share code, notes, and snippets.

@adam-acosta
Last active July 30, 2018 04:25
Show Gist options
  • Select an option

  • Save adam-acosta/01e5e2c45766f45238bba1ceefa3580a to your computer and use it in GitHub Desktop.

Select an option

Save adam-acosta/01e5e2c45766f45238bba1ceefa3580a to your computer and use it in GitHub Desktop.
fully automated script to load all coaches then add as recipient
var i = 0;
function waitForElementToDisplay(selector, time) {
if(document.querySelector(selector)!=null) {
if (i === 6) {
console.log('loaded all coaches or internet issue encountered');
return;
}
document.querySelector(selector).click();
i++;
setTimeout(function() {
waitForElementToDisplay(selector, time);
}, time);
}
else {
setTimeout(function() {
waitForElementToDisplay(selector, time);
}, time);
}
}
waitForElementToDisplay('#main-app-content-container > div > ui-view > promote-container > div > div > div > div:nth-child(1) > promote-recipient-select > div > div.promote-recipient-select-pager.ng-scope > button', 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment