(self)
| 166 | return element.text, None |
| 167 | |
| 168 | def check_status(self): |
| 169 | statuses = {} |
| 170 | |
| 171 | for thing in self.xpaths: |
| 172 | value = self.xpaths[thing] |
| 173 | element = self.driver.find_element('xpath', value) |
| 174 | |
| 175 | if not element.is_enabled(): |
| 176 | statuses.update({thing: f"{Fore.RED}[OFFLINE]"}) |
| 177 | |
| 178 | else: |
| 179 | statuses.update({thing: f"{Fore.GREEN}[WORKS]"}) |
| 180 | |
| 181 | return statuses |
| 182 | |
| 183 | def _print(self, msg, status = "-"): |
| 184 | return f" {Fore.WHITE}[{self.color}{status}{Fore.WHITE}] {msg}" |