properties.php 5.88 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php

//This syntax is a workaround for creating a const array. Array constants
//are allowed from php 5.6 on, so once mahara upgrades, this code can be changed
//to take advantage of this.

//This table can take css and xpath locators, e.g:
//'Groups dropdown' => array("li.managegroups", "css_element"),
//OR
//'Groups dropdown' => array("//li[@class='managegroups']", "xpath_element"),
define ("LOCATOR_CONSTANTS", json_encode(array(
    'Admin home sub-menu'         => array(".adminhome", "css_element"),
    'Arrow-bar nav'               => array(".arrow-bar", "css_element"),
    'My portfolios'               => array(".bt-myviews", "css_element"),
    'Latest changes I can view'   => array(".bt-newviews", "css_element"),
16
    'Resume field block'          => array(".bt-resumefield", "css_element"),
17
    'Watched pages'               => array(".bt-watchlist", "css_element"),
18
    'Select'                      => array(".btn[title='Select']", "css_element"),
19
20
21
22
23
24
25
    'Comment preview'             => array(".commentreplyview", "css_element"),
    'Comment text'                => array(".comment-text", "css_element"),
    'Extensions sub-menu'         => array(".configextensions ul", "css_element"),
    'Configure site sub-menu'     => array(".configsite", "css_element"),
    'Users sub-menu'              => array(".configusers", "css_element"),
    'Content sub-menu'            => array(".content", "css_element"),
    'Comment feedbacktable'       => array(".feedbacktable", "css_element"),
26
27
    'File download heading 1'     => array(".filedownload-item:nth-of-type(1)>h4", "css_element"),
    'File download heading 2'     => array(".filedownload-item:nth-of-type(2)>h4", "css_element"),
28
    'Filelist table'              => array(".filelist", "css_element"),
29
    'Footer'                      => array(".footer", "css_element"),
30
31
32
33
34
35
    'Pages and Collections boxes' => array(".grouppageswrap", "css_element"),
    'Groups sub-menu'             => array(".groups", "css_element"),
    'Admin Groups sub-menu'       => array(".managegroups ul", "css_element"),
    'Institutions sub-menu'       => array(".manageinstitutions ul", "css_element"),
    'Options dialog'              => array(".modal-header", "css_element"),
    'Portfolio sub-menu'          => array(".myportfolio", "css_element"),
36
    'Web services sub-menu'       => array(".webservices", "css_element"),
37
38
    'H1 heading'                  => array("h1", "css_element"),
    'Collections text-box'        => array(".select2-selection__rendered", "css_element"),
39
    'Videojs time remaining'      =>  array(".vjs-remaining-time-display", "css_element"),
40
41
42
43
44
45
    'Annotation'                  => array("#activate_blocktype_annotation", "css_element"),
    'Smartevidence'               => array("#activate_module_framework", "css_element"),
    'Make comment public status'  => array("#add_feedback_form_ispublic_container", "css_element"),
    'Submissions to this group'   => array("#allsubmissionlist", "css_element"),
    'Blocktype sidebar'           => array("#content-editor-foldable", "css_element"),
    'Tags section'                => array("#edit_tags_container", "css_element"),
46
    'My tags list'                => array(".mytags", "css_element"),
47
48
49
50
51
52
53
54
55
56
    'Upload dialog'               => array("#editgoalsandskills_filebrowser_upload_browse", "css_element"),
    'Filter by first name'        => array("#firstnamelist", "css_element"),
    'Find people results'         => array("#friendslist_pagination", "css_element"),
    'My groups box'               => array("#groups", "css_element"),
    'Group portfolios'            => array("#groupviewlist", "css_element"),
    'Main menu'                   => array("#main-nav", "css_element"),
    'Administration menu'         => array("#main-nav-admin", "css_element"),
    'Members without a submission to the group' => array("#nosubmissionslist", "css_element"),
    'Collections shared with this group' => array("#sharedcollectionlist", "css_element"),
    'Pages shared with this group'=> array("#sharedviewlist", "css_element"),
57
    'Shared with this group report'=> array("#sharedviewsreport", "css_element"),
58
59
    'Matrix table'                => array("#tablematrix", "css_element"),
    'Toolbar buttons'             => array("#toolbar-buttons", "css_element"),
60
61
62
63
    'User menu'         => array(".icon-chevron-down.collapsed", "css_element"),
    'Settings sub-menu'         => array("//span[@innertext='Settings']", "xpath_element"),
    'Settings'         => array("//ul[#'userchildmenu-8']/?/?/a[@innertext='Settings']", "xpath_element"),
     'Legal'         => array("//ul[#'userchildmenu-8']/?/?/a[@innertext='Legal']", "xpath_element"),
64
    #xpath_elements
65
    'Secret urls - table row 1'   => array("//table/tbody/tr[1]/td[4]/a", "xpath_element"),
66
    'File Size'   => array("//table[@id='files_filebrowser_filelist']/tbody/tr[1]/td[4]", "xpath_element"),
67
    'Multirecipientnotification'  => array("//li[@id='module.multirecipientnotification']", "xpath_element"),
68
69
70
71
    // xpath related to participation report
    'Group views report tr1 tc1'  => array("//*[@id='groupviewsreport']/tbody/tr[1]/td[1]", "xpath_element"),
    'Group views report tr1 tc2'  => array("//*[@id='groupviewsreport']/tbody/tr[1]/td[2]", "xpath_element"),
    'Group views report tr1 tc3'  => array("//*[@id='groupviewsreport']/tbody/tr[1]/td[3]", "xpath_element"),
72
73
    'First Legal'     => array("//a[contains(@href, 'fs=privacy')]/b", "xpath_element"),
    'Second Legal'    => array("//a[contains(@href, 'fs=termsandconditions')]/b", "xpath_element"),
74
    'Group views report tr3 tc1'  => array("//*[@id='groupviewsreport']/tbody/tr[3]/td[1]", "xpath_element"),
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    )));

/**
* @param string $property
*/
function get_property($property, $location = null) {
  if (!$location) {
    $location = LOCATOR_CONSTANTS;
  }
  $location = json_decode($location, true);
  if (isset($location[ucfirst($property)])) {
     return $location[ucfirst($property)];
  }
  else {
    return null;
  }
}

 ?>