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
| function generateUUID(){ | |
| let dateTime = new Date().getTime(); | |
| const uuid = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
| const r = (dateTime + Math.random()*16)%16 | 0; | |
| dateTime = Math.floor(dateTime/16); | |
| return (c == 'x' ? r :(r&0x3|0x8)).toString(16); | |
| }); | |
| return uuid; | |
| } |
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
| wait = Selenium::WebDriver::Wait.new ignore: Selenium::WebDriver::Error::NoSuchAlertError | |
| wait.until { page.driver.browser.switch_to.alert } |
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
| wait = Selenium::WebDriver::Wait.new | |
| wait.until { File.file? file } |
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
| wait = Selenium::WebDriver::Wait.new | |
| wait.until { page.evaluate_script('jQuery.active').zero? } |
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
| function precisionRound(number, precision) { | |
| const factor = Math.pow(10, precision); | |
| return Math.round(number * factor) / factor; | |
| } |