e-nms_qa_automation.1/pages/service_status_tab.py

28 lines
1.3 KiB
Python

from pages.base_page import BasePage
from Locators.configuration_page import ConfigurationPageLocators
from data.assertions import Assertions
from playwright.sync_api import Page
class ServiceStatusTab(BasePage):
def __init__(self, page: Page) -> None:
super().__init__(page)
self.assertion = Assertions(page)
def should_be_service_status_work_area(self):
self.assertion.have_title(ConfigurationPageLocators.WORK_AREA_TITLE, "Статус обслуживания", \
"Expected work area page title is not equal real title")
self.should_be_service_status_table()
def should_be_service_status_table(self):
headers = ['Контейнер', 'Время создания', 'Статус', 'Время работы', 'Image ID', 'Image ТЭГ']
service_status_table = self.read_table_data(ConfigurationPageLocators.WORK_AREA_TABLE)
service_status_table_headers = service_status_table[0]
self.assertion.check_equals(service_status_table_headers, headers, \
f"Expected table headers {service_status_table_headers} are not equal {headers}")
self.assertion.check_not_equals(len(service_status_table) - 1, 0, \
"Service status table is empty")