diff --git a/components/alert_component.py b/components/alert_component.py index 194f483..dd0fcdc 100644 --- a/components/alert_component.py +++ b/components/alert_component.py @@ -39,7 +39,7 @@ class AlertComponent(BaseComponent): self.text = Text(page, f"//div[@class='v-alert {self.alert_type}']/div", "Alert message") # Действия: - def get_text(self): + def get_text(self) -> str: """Получение текста сообщения из alert-окна. Returns: @@ -48,7 +48,7 @@ class AlertComponent(BaseComponent): return self.text.get_text(0) # Проверки: - def check_presence(self, text): + def check_presence(self, text: str): """Проверка наличия alert-окна с заданным текстом. Args: @@ -63,7 +63,7 @@ class AlertComponent(BaseComponent): else: expect(self.page.get_by_role("alert").filter(has_text=text)).to_be_visible(), msg - def check_absence(self, text, timeout=30000): + def check_absence(self, text: str, timeout: int = 30000): """Проверка отсутствия alert-окна с заданным текстом. Args: @@ -77,7 +77,7 @@ class AlertComponent(BaseComponent): msg = f"Alert {self.alert_type} window should disappear after {seconds} seconds" expect(self.page.get_by_role("alert").filter(has_text=text)).to_be_hidden(timeout=timeout), msg - def check_text(self, alert_text): + def check_text(self, alert_text: str): """Проверка точного соответствия текста в alert-окне. Args: