head_page_locator.py 8.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. '''
  4. @File : head_page_locator.py
  5. @Time : 2024/11/07 15:19:52
  6. @Author : dulip3ng
  7. @Version : 1.0
  8. @Desc : None
  9. '''
  10. class HeadPageLocator:
  11. #按钮等相关定位
  12. BUTTON_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, '-BILLMENU_TOOLBAR')]/ul/li[contains(@class, 'k-item k-state-default kdmenuitem') and not(contains(@class, 'kd-menubtn-disabled'))]/span/span[text()='%s']"
  13. BUTTON_ARROW_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, '-BILLMENU_TOOLBAR')]/ul/li[contains(@class, 'k-item k-state-default kdmenuitem') and not(contains(@class, 'kd-menubtn-disabled'))]/span/span[text()='%s']/following-sibling::span"
  14. SUB_BUTTON_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, '-BILLMENU_TOOLBAR')]/ul/li[contains(@class, 'k-item k-state-default kdmenuitem') and not(contains(@class, 'kd-menubtn-disabled'))]//span[text()='%s']"
  15. SHEET_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//ul[@class = 'k-tabstrip-items k-reset']/descendant::span[text()='%s']"
  16. #字段赋值相关定位
  17. TEXT_FIELD_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[translate(text(), ' ', '') = translate('%s', ' ', '')]/parent::div/following-sibling::div[1]/descendant::input[1]"
  18. BASE_FIELD_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[translate(text(), ' ', '') = translate('%s', ' ', '')]/parent::div/following-sibling::div[1]/descendant::input[1]"
  19. BASE_FIELD_SPAN_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[translate(text(), ' ', '') = translate('%s', ' ', '')]/parent::div/following-sibling::div[1]/descendant::input/following-sibling::span"
  20. BASE_ITEM_ARGS_LOC = "//div[@class = 'k-animation-container' and contains(@style, 'display: block')]//table[@class = 'k-selectable']/descendant::td[text() = '%s']"
  21. SELECT_FIELD_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[translate(text(), ' ', '') = translate('%s', ' ', '')]/parent::div/following-sibling::div[1]//span[@class = 'k-select']"
  22. SELECT_ITEM_ARGS_LOC = "//div[@class = 'k-animation-container' and contains(@style, 'display: block')]/div/div[2]/ul/li[text() = '%s']"
  23. #获取字段值相关定位
  24. TEXT_VALUE_INPUT_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[@role='kdspanlabel' and @title = '%s']/parent::div/following-sibling::div[contains(@class, 'kdItemContainer_editorct')]//input"
  25. TEXT_VALUE_SPAN_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[@role='kdspanlabel' and @title = '%s']/parent::div/following-sibling::div[1]/descendant::span[@class = 'ui-poplistedit-displayname']"
  26. SELECT_VALUE_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[@role='kdspanlabel' and @title = '%s']/parent::div/following-sibling::div[contains(@class, 'kdItemContainer_editorct')]//*[@class='k-input']"
  27. BASE_VALUE_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[translate(text(), ' ', '') = translate('%s', ' ', '')]/parent::div/following-sibling::div[1]/descendant::span[@class='ui-poplistedit-displayname']"
  28. #字段类型解析相关定位
  29. IS_SELECT_FIELD_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[translate(text(), ' ', '') = translate('%s', ' ', '')]/parent::div/following-sibling::div[1]//span[@class = 'k-icon k-i-arrow-s']"
  30. IS_BASE_FIELD_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[translate(text(), ' ', '') = translate('%s', ' ', '')]/parent::div/following-sibling::div[1]//span[@class = 'k-icon k-i-search']"
  31. PARSE_FIELD_TYPE_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[@role='kdspanlabel' and translate(@title, ' ', '') = translate('%s', ' ', '')]/parent::div/following-sibling::div[contains(@class, 'kdItemContainer_editorct')]/div"
  32. #审核印章
  33. CHECKED_IMAGE_LOC = "//img[@src = '.././images/biz/default/Common/WaterMarks/approved_2052.png' and contains(@style, 'display: block')]"
  34. CHECKBOX_FIELD_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//label[text()='%s']/../input[@class='k-checkbox']/../..";
  35. TEXTAREA_FIELD_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[text() = '%s']/parent::div/following-sibling::div[@class='kdItemContainer_editorct']/descendant::textarea";
  36. MULTISELECT_FIELD_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[translate(text(), ' ', '') = translate('%s', ' ', '')]/parent::div/following-sibling::div[1]/descendant::span[text()='select']";
  37. MULTISELECT_ITEM_ARGS_LOC = "//div[@class = 'k-animation-container' and contains(@style, 'display: block')]/descendant::button[text() = '%s']";
  38. MULTISELECT_OK_BTN_LOC = "//div[@class = 'k-animation-container' and contains(@style, 'display: block')]/descendant::div[text() = '确定']";
  39. TRIGGER_IN_HEAD_BODY_FIELD_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//div[@class='k-grid-content k-auto-scrollable']/descendant::tr/td//*[@data-field = //th[@data-title='%s']/@data-field and @data-rowid = '%d']";
  40. TEXT_FIELD_IN_HEAD_BODY_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//div[@class='k-grid-content k-auto-scrollable']/descendant::tr/td//*[@data-field = //th[@data-title='%s']/@data-field and @data-rowid = '%d']/ancestor::td/descendant::input";
  41. BASE_FIELD_IN_HEAD_BODY_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//div[@class='k-grid-content k-auto-scrollable']/descendant::tr/td//*[@data-field = //th[@data-title='%s']/@data-field and @data-rowid = '%d']/ancestor::td/descendant::input";
  42. MULTISELECT_VALUE_ARGS_LOC = "//div[contains(@id, '-FMAINTAB_c-') and @class='k-content k-state-active']//div[contains(@id, 'SPLITECONTAINER') and @splitter='first']//div[contains(@id, 'TAB') and @class = 'k-content k-state-active']//span[translate(text(), ' ', '') = translate('%s', ' ', '')]/parent::div/following-sibling::div[1]/descendant::span[contains(@class, 'ui-poplistedit-displayname')]"