Last active
April 15, 2023 15:07
-
-
Save pingec/fe62920b420174e282c8069bb670258a to your computer and use it in GitHub Desktop.
akos speed test automation
This file contains 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
//https://www.akostest.net/sl/ | |
var oneMinute = 1000 * 60; | |
var oneHour = oneMinute * 60; | |
akosSpeedTest(); | |
setInterval(()=>{ | |
akosSpeedTest(); | |
}, oneHour); | |
async function akosSpeedTest(){ | |
document.querySelector("body > div.flex-wrapper.ng-scope.height-adjust > div > div.header-container > header > a").click(); | |
await new Promise(r => setTimeout(r, 2000)); | |
document.querySelector("#nav > ul > li:nth-child(2) > a").click() | |
await new Promise(r => setTimeout(r, 5000)); | |
await waitForDownloadBtn(); | |
console.log(window.location.href); | |
console.log("clicking download button!") | |
document.querySelector("body > div.flex-wrapper.ng-scope.height-adjust > div > div.flex-wrapper.height-adjust.ng-scope.menu-true > div.aside-container.ng-scope > div > aside > form > fieldset > div > div:nth-child(4) > button").click() | |
} | |
async function waitForDownloadBtn(){ | |
while(!document.querySelector("body > div.flex-wrapper.ng-scope.height-adjust > div > div.flex-wrapper.height-adjust.ng-scope.menu-true > div.aside-container.ng-scope > div > aside > form > fieldset > div > div:nth-child(4) > button")){ | |
console.log("btn not there") | |
await new Promise(r => setTimeout(r, 1000)); | |
} | |
console.log("btn is there!") | |
await new Promise(r => setTimeout(r, 5000)); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment