/tests/system/webdriver/Pages/Components/ContactEditPage.php

https://github.com/dextercowley/joomla-cms · PHP · 142 lines · 96 code · 8 blank · 38 comment · 0 complexity · fea1daa7761af5d12124e4c4e8063817 MD5 · raw file

  1. <?php
  2. use SeleniumClient\By;
  3. use SeleniumClient\SelectElement;
  4. use SeleniumClient\WebDriver;
  5. use SeleniumClient\WebDriverWait;
  6. use SeleniumClient\DesiredCapabilities;
  7. use SeleniumClient\WebElement;
  8. /**
  9. * @package Joomla.Test
  10. * @subpackage Webdriver
  11. *
  12. * @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All rights reserved.
  13. * @license GNU General Public License version 2 or later; see LICENSE
  14. */
  15. /**
  16. * Page class for the back-end menu items manager screen.
  17. *
  18. * @package Joomla.Test
  19. * @subpackage Webdriver
  20. * @since 3.2
  21. */
  22. class ContactEditPage extends AdminEditPage
  23. {
  24. /**
  25. * XPath string used to uniquely identify this page
  26. *
  27. * @var string
  28. * @since 3.2
  29. */
  30. protected $waitForXpath = "//form[@id='contact-form']";
  31. /**
  32. * URL used to uniquely identify this page
  33. *
  34. * @var string
  35. * @since 3.2
  36. */
  37. protected $url = 'administrator/index.php?option=com_contact&view=contact&layout=edit';
  38. /**
  39. * Array of tabs present on this page
  40. *
  41. * @var array
  42. * @since 3.2
  43. */
  44. public $tabs = array('details', 'misc', 'publishing', 'attrib-display', 'attrib-email');
  45. /**
  46. * Array of all the field Details of the Edit page, along with the ID and tab value they are present on
  47. *
  48. * @var array
  49. * @since 3.2
  50. */
  51. public $inputFields = array (
  52. array('label' => 'Name', 'id' => 'jform_name', 'type' => 'input', 'tab' => 'header'),
  53. array('label' => 'Alias', 'id' => 'jform_alias', 'type' => 'input', 'tab' => 'header'),
  54. array('label' => 'Linked User', 'id' => 'jform_user_id', 'type' => 'input', 'tab' => 'details'),
  55. array('label' => 'Image', 'id' => 'jform_image', 'type' => 'input', 'tab' => 'details'),
  56. array('label' => 'Position', 'id' => 'jform_con_position', 'type' => 'input', 'tab' => 'details'),
  57. array('label' => 'Email', 'id' => 'jform_email_to', 'type' => 'input', 'tab' => 'details'),
  58. array('label' => 'Address', 'id' => 'jform_address', 'type' => 'textarea', 'tab' => 'details'),
  59. array('label' => 'City or Suburb', 'id' => 'jform_suburb', 'type' => 'input', 'tab' => 'details'),
  60. array('label' => 'State or Province', 'id' => 'jform_state', 'type' => 'input', 'tab' => 'details'),
  61. array('label' => 'Postal / ZIP Code', 'id' => 'jform_postcode', 'type' => 'input', 'tab' => 'details'),
  62. array('label' => 'Country', 'id' => 'jform_country', 'type' => 'input', 'tab' => 'details'),
  63. array('label' => 'Telephone', 'id' => 'jform_telephone', 'type' => 'input', 'tab' => 'details'),
  64. array('label' => 'Mobile', 'id' => 'jform_mobile', 'type' => 'input', 'tab' => 'details'),
  65. array('label' => 'Fax', 'id' => 'jform_fax', 'type' => 'input', 'tab' => 'details'),
  66. array('label' => 'Website', 'id' => 'jform_webpage', 'type' => 'input', 'tab' => 'details'),
  67. array('label' => 'First Sort Field', 'id' => 'jform_sortname1', 'type' => 'input', 'tab' => 'details'),
  68. array('label' => 'Second Sort Field', 'id' => 'jform_sortname2', 'type' => 'input', 'tab' => 'details'),
  69. array('label' => 'Third Sort Field', 'id' => 'jform_sortname3', 'type' => 'input', 'tab' => 'details'),
  70. array('label' => 'Category', 'id' => 'jform_catid', 'type' => 'select', 'tab' => 'details'),
  71. array('label' => 'Tags', 'id' => 'jform_tags', 'type' => 'select', 'tab' => 'details'),
  72. array('label' => 'Status', 'id' => 'jform_published', 'type' => 'select', 'tab' => 'details'),
  73. array('label' => 'Featured', 'id' => 'jform_featured', 'type' => 'fieldset', 'tab' => 'details'),
  74. array('label' => 'Access', 'id' => 'jform_access', 'type' => 'select', 'tab' => 'details'),
  75. array('label' => 'Language', 'id' => 'jform_language', 'type' => 'select', 'tab' => 'details'),
  76. array('label' => 'Version Note', 'id' => 'jform_version_note', 'type' => 'input', 'tab' => 'details'),
  77. array('label' => 'Miscellaneous Information', 'id' => 'jform_misc', 'type' => 'textarea', 'tab' => 'misc'),
  78. array('label' => 'Start Publishing', 'id' => 'jform_publish_up', 'type' => 'input', 'tab' => 'publishing'),
  79. array('label' => 'Finish Publishing', 'id' => 'jform_publish_down', 'type' => 'input', 'tab' => 'publishing'),
  80. array('label' => 'Created date', 'id' => 'jform_created', 'type' => 'input', 'tab' => 'publishing'),
  81. array('label' => 'Created by', 'id' => 'jform_created_by', 'type' => 'input', 'tab' => 'publishing'),
  82. array('label' => 'Created By Alias', 'id' => 'jform_created_by_alias', 'type' => 'input', 'tab' => 'publishing'),
  83. array('label' => 'Modified Date', 'id' => 'jform_modified', 'type' => 'input', 'tab' => 'publishing'),
  84. array('label' => 'Modified by', 'id' => 'jform_modified_by', 'type' => 'input', 'tab' => 'publishing'),
  85. array('label' => 'Revision', 'id' => 'jform_version', 'type' => 'input', 'tab' => 'publishing'),
  86. array('label' => 'Hits', 'id' => 'jform_hits', 'type' => 'input', 'tab' => 'publishing'),
  87. array('label' => 'ID', 'id' => 'jform_id', 'type' => 'input', 'tab' => 'publishing'),
  88. array('label' => 'Meta Description', 'id' => 'jform_metadesc', 'type' => 'textarea', 'tab' => 'publishing'),
  89. array('label' => 'Meta Keywords', 'id' => 'jform_metakey', 'type' => 'textarea', 'tab' => 'publishing'),
  90. array('label' => 'Robots', 'id' => 'jform_metadata_robots', 'type' => 'select', 'tab' => 'publishing'),
  91. array('label' => 'Rights', 'id' => 'jform_metadata_rights', 'type' => 'input', 'tab' => 'publishing'),
  92. array('label' => 'Show Category', 'id' => 'jform_params_show_contact_category', 'type' => 'select', 'tab' => 'attrib-display'),
  93. array('label' => 'Show Contact List', 'id' => 'jform_params_show_contact_list', 'type' => 'select', 'tab' => 'attrib-display'),
  94. array('label' => 'Display format', 'id' => 'jform_params_presentation_style', 'type' => 'select', 'tab' => 'attrib-display'),
  95. array('label' => 'Show Tags', 'id' => 'jform_params_show_tags', 'type' => 'select', 'tab' => 'attrib-display'),
  96. array('label' => 'Name', 'id' => 'jform_params_show_name', 'type' => 'select', 'tab' => 'attrib-display'),
  97. array('label' => 'Contact\'s Position', 'id' => 'jform_params_show_position', 'type' => 'select', 'tab' => 'attrib-display'),
  98. array('label' => 'Email', 'id' => 'jform_params_show_email', 'type' => 'select', 'tab' => 'attrib-display'),
  99. array('label' => 'Street Address', 'id' => 'jform_params_show_street_address', 'type' => 'select', 'tab' => 'attrib-display'),
  100. array('label' => 'City or Suburb', 'id' => 'jform_params_show_suburb', 'type' => 'select', 'tab' => 'attrib-display'),
  101. array('label' => 'State or County', 'id' => 'jform_params_show_state', 'type' => 'select', 'tab' => 'attrib-display'),
  102. array('label' => 'Postal Code', 'id' => 'jform_params_show_postcode', 'type' => 'select', 'tab' => 'attrib-display'),
  103. array('label' => 'Country', 'id' => 'jform_params_show_country', 'type' => 'select', 'tab' => 'attrib-display'),
  104. array('label' => 'Telephone', 'id' => 'jform_params_show_telephone', 'type' => 'select', 'tab' => 'attrib-display'),
  105. array('label' => 'Mobile phone', 'id' => 'jform_params_show_mobile', 'type' => 'select', 'tab' => 'attrib-display'),
  106. array('label' => 'Fax', 'id' => 'jform_params_show_fax', 'type' => 'select', 'tab' => 'attrib-display'),
  107. array('label' => 'Webpage', 'id' => 'jform_params_show_webpage', 'type' => 'select', 'tab' => 'attrib-display'),
  108. array('label' => 'Misc. Information', 'id' => 'jform_params_show_misc', 'type' => 'select', 'tab' => 'attrib-display'),
  109. array('label' => 'Image', 'id' => 'jform_params_show_image', 'type' => 'select', 'tab' => 'attrib-display'),
  110. array('label' => 'vCard', 'id' => 'jform_params_allow_vcard', 'type' => 'select', 'tab' => 'attrib-display'),
  111. array('label' => 'Show User Articles', 'id' => 'jform_params_show_articles', 'type' => 'select', 'tab' => 'attrib-display'),
  112. array('label' => 'Show Profile', 'id' => 'jform_params_show_profile', 'type' => 'select', 'tab' => 'attrib-display'),
  113. array('label' => 'Show Links', 'id' => 'jform_params_show_links', 'type' => 'select', 'tab' => 'attrib-display'),
  114. array('label' => 'Link A Label', 'id' => 'jform_params_linka_name', 'type' => 'input', 'tab' => 'attrib-display'),
  115. array('label' => 'Link A URL', 'id' => 'jform_params_linka', 'type' => 'input', 'tab' => 'attrib-display'),
  116. array('label' => 'Link B Label', 'id' => 'jform_params_linkb_name', 'type' => 'input', 'tab' => 'attrib-display'),
  117. array('label' => 'Link B URL', 'id' => 'jform_params_linkb', 'type' => 'input', 'tab' => 'attrib-display'),
  118. array('label' => 'Link C Label', 'id' => 'jform_params_linkc_name', 'type' => 'input', 'tab' => 'attrib-display'),
  119. array('label' => 'Link C URL', 'id' => 'jform_params_linkc', 'type' => 'input', 'tab' => 'attrib-display'),
  120. array('label' => 'Link D Label', 'id' => 'jform_params_linkd_name', 'type' => 'input', 'tab' => 'attrib-display'),
  121. array('label' => 'Link D URL', 'id' => 'jform_params_linkd', 'type' => 'input', 'tab' => 'attrib-display'),
  122. array('label' => 'Link E Label', 'id' => 'jform_params_linke_name', 'type' => 'input', 'tab' => 'attrib-display'),
  123. array('label' => 'Link E URL', 'id' => 'jform_params_linke', 'type' => 'input', 'tab' => 'attrib-display'),
  124. array('label' => 'Alternative Layout', 'id' => 'jform_params_contact_layout', 'type' => 'select', 'tab' => 'attrib-display'),
  125. array('label' => 'Show Contact Form', 'id' => 'jform_params_show_email_form', 'type' => 'select', 'tab' => 'attrib-email'),
  126. array('label' => 'Send Copy to Submitter', 'id' => 'jform_params_show_email_copy', 'type' => 'select', 'tab' => 'attrib-email'),
  127. array('label' => 'Banned Email', 'id' => 'jform_params_banned_email', 'type' => 'textarea', 'tab' => 'attrib-email'),
  128. array('label' => 'Banned Subject', 'id' => 'jform_params_banned_subject', 'type' => 'textarea', 'tab' => 'attrib-email'),
  129. array('label' => 'Banned Text', 'id' => 'jform_params_banned_text', 'type' => 'textarea', 'tab' => 'attrib-email'),
  130. array('label' => 'Session Check', 'id' => 'jform_params_validate_session', 'type' => 'select', 'tab' => 'attrib-email'),
  131. array('label' => 'Custom Reply', 'id' => 'jform_params_custom_reply', 'type' => 'select', 'tab' => 'attrib-email'),
  132. array('label' => 'Contact Redirect', 'id' => 'jform_params_redirect', 'type' => 'input', 'tab' => 'attrib-email'),
  133. );
  134. }