Skip to content

Commit

Permalink
Replace locators with hostdetailscard and remove unnecessary and unus…
Browse files Browse the repository at this point in the history
…ed entity methods
  • Loading branch information
sambible committed Oct 24, 2023
1 parent 8c1e7eb commit 411e10a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 78 deletions.
37 changes: 0 additions & 37 deletions airgun/entities/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,43 +399,6 @@ def get_tracer(self, entity_name):
self.browser.plugin.ensure_page_safe()
return view.traces.read()

def get_os_info(self, entity_name):
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
self.browser.plugin.ensure_page_safe()
return view.details.operating_system.read()

def get_provisioning_info(self, entity_name):
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
self.browser.plugin.ensure_page_safe()
return view.details.provisioning.read()

def get_bios_info(self, entity_name):
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
self.browser.plugin.ensure_page_safe()
return view.details.bios.read()

def get_registration_details(self, entity_name):
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
self.browser.plugin.ensure_page_safe()
return view.details.registration_details.read()

def get_hw_properties(self, entity_name):
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
self.browser.plugin.ensure_page_safe()
return view.details.hw_properties.read()

def get_provisioning_templates(self, entity_name):
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
self.browser.plugin.ensure_page_safe()
d = view.details.read()
return d['provisioning_templates']['templates_table']

def get_networking_interfaces(self, entity_name):
view = self.navigate_to(self, 'NewDetails', entity_name=entity_name)
view.wait_displayed()
Expand Down
48 changes: 7 additions & 41 deletions airgun/views/host_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,7 @@ class system_purpose(Card):
'.//button[@data-ouia-component-id="syspurpose-edit-button"]'
)

role = Text('.//dd[contains(@class, "pf-c-description-list__description")][1]')
sla = Text('.//dd[contains(@class, "pf-c-description-list__description")][2]')
usage_type = Text('.//dd[contains(@class, "pf-c-description-list__description")][3]')
release_version = Text(
'.//dd[contains(@class, "pf-c-description-list__description")][4]'
)
addons = Text('.//dd[contains(@class, "pf-c-description-list__description")][5]')
details = HostDetailsCard()

@View.nested
class details(Tab):
Expand All @@ -232,60 +226,32 @@ class operating_system(Card):
'.//a[contains(@data-ouia-component-id, "OUIA-Generated-Button-link-1")]'
)
os = Text('.//a[contains(@data-ouia-component-id, "OUIA-Generated-Button-link-2")]')
boot_time = Text('.//div[contains(@class, "pf-c-description-list__group")][3]/dd/div')
kernel_release = Text(
'.//div[contains(@class, "pf-c-description-list__group")][4]/dd/div'
)

details = HostDetailsCard()

@View.nested
class provisioning(Card):
ROOT = './/article[.//div[text()="Provisioning"]]'

build_duration = Text(
'.//div[contains(@class, "pf-c-description-list__group")][1]/dd/div'
)
token = Text('.//div[contains(@class, "pf-c-description-list__group")][2]/dd/div')
pxe_loader = Text('.//div[contains(@class, "pf-c-description-list__group")][3]/dd/div')
details = HostDetailsCard()

@View.nested
class bios(Card):
ROOT = './/article[.//div[text()="BIOS"]]'

vendor = Text('.//div[contains(@class, "pf-c-description-list__group")][1]/dd/div')
version = Text('.//div[contains(@class, "pf-c-description-list__group")][2]/dd/div')
release_date = Text(
'.//div[contains(@class, "pf-c-description-list__group")][3]/dd/div'
)
details = HostDetailsCard()

@View.nested
class registration_details(Card):
ROOT = './/article[.//div[text()="Registration details"]]'

registered_on = Text(
'.//div[contains(@class, "pf-c-description-list__group")][1]/dd/div'
)
registration_type = Text(
'.//div[contains(@class, "pf-c-description-list__group")][2]/ul/h4'
)
activation_key_name = Text(
'.//div[contains(@class, "pf-c-description-list__group")][2]//a'
)
registered_through = Text(
'.//div[contains(@class, "pf-c-description-list__group")][3]/dd/div'
)
details = HostDetailsCard()

@View.nested
class hw_properties(Card):
ROOT = './/article[.//div[text()="HW properties"]]'

model = Text('.//div[contains(@class, "pf-c-description-list__group")][1]//dd')
number_of_cpus = Text('.//div[contains(@class, "pf-c-description-list__group")][2]//dd')
sockets = Text('.//div[contains(@class, "pf-c-description-list__group")][3]//dd')
cores_per_socket = Text(
'.//div[contains(@class, "pf-c-description-list__group")][4]//dd'
)
ram = Text('.//div[contains(@class, "pf-c-description-list__group")][5]//dd')
storage = Text('.//div[contains(@class, "pf-c-description-list__group")][6]//h4')
details = HostDetailsCard()

@View.nested
class provisioning_templates(Card):
Expand Down

0 comments on commit 411e10a

Please sign in to comment.