ConfirmComponent
Модуль компонента окна подтверждения действий.
Содержит класс ConfirmComponent для взаимодействия с окном подтверждения, включая кнопки подтверждения, отмены и закрытия, а также проверки текста.
ConfirmComponent
Bases: BaseComponent
Компонент окна подтверждения действий.
Source code in components\confirm_component.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |
__init__(page, cancel_button_text, allow_button_text)
Инициализация компонента.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
page
|
Page
|
Экземпляр страницы Playwright. |
required |
cancel_button_text
|
str
|
Текст кнопки отмены. |
required |
allow_button_text
|
str
|
Текст кнопки подтверждения. |
required |
Source code in components\confirm_component.py
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | |
check_allow_button_text(expected_text)
Проверяет текст кнопки Подтверждения.
Source code in components\confirm_component.py
110 111 112 | |
check_cancel_button_text(expected_text)
Проверяет текст кнопки Отмены.
Source code in components\confirm_component.py
106 107 108 | |
check_text(text, msg)
Проверяет текст сообщения в окне подтверждения.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
Ожидаемый текст сообщения. |
required |
msg
|
str
|
Сообщение при ошибке. |
required |
Source code in components\confirm_component.py
83 84 85 86 87 88 89 90 91 | |
check_title(title, msg)
Проверяет текст заголовка окна подтверждения.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
title
|
str
|
Ожидаемый текст заголовка. |
required |
msg
|
str
|
Сообщение при ошибке. |
required |
Source code in components\confirm_component.py
73 74 75 76 77 78 79 80 81 | |
check_window_horizontal_scrolling()
Проверяет возможность горизонтальной прокрутки окна.
Source code in components\confirm_component.py
93 94 95 96 | |
click_allow_button()
Нажимает кнопку подтверждения действия.
Source code in components\confirm_component.py
47 48 49 50 | |
click_cancel_button()
Нажимает кнопку отмены действия.
Source code in components\confirm_component.py
52 53 54 55 | |
click_close_button()
Нажимает кнопку закрытия окна подтверждения.
Source code in components\confirm_component.py
57 58 59 60 | |
scroll_window_left()
Прокручивает содержимое окна влево.
Source code in components\confirm_component.py
62 63 64 65 | |
scroll_window_right()
Прокручивает содержимое окна вправо.
Source code in components\confirm_component.py
67 68 69 70 | |
should_be_allow_button()
Проверяет наличие и видимость кнопки Подтверждения.
Source code in components\confirm_component.py
102 103 104 | |
should_be_cancel_button()
Проверяет наличие и видимость кнопки Отмены.
Source code in components\confirm_component.py
98 99 100 | |