forked from pkp/ojs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContentBaseTestCase.inc.php
More file actions
59 lines (52 loc) · 1.56 KB
/
Copy pathContentBaseTestCase.inc.php
File metadata and controls
59 lines (52 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* @file tests/ContentBaseTestCase.inc.php
*
* Copyright (c) 2014-2017 Simon Fraser University
* Copyright (c) 2000-2017 John Willinsky
* Distributed under the GNU GPL v2. For full terms see the file docs/COPYING.
*
* @class ContentBaseTestCase
* @ingroup tests_data
*
* @brief Data build suite: Base class for content creation tests
*/
import('lib.pkp.tests.PKPContentBaseTestCase');
class ContentBaseTestCase extends PKPContentBaseTestCase {
/**
* Handle any section information on submission step 1
* @return string
*/
protected function _handleStep1($data) {
$section = 'Articles'; // Default
if (isset($data['section'])) $section = $data['section'];
// Page 1
$this->waitForElementPresent('id=sectionId');
$this->select('id=sectionId', 'label=' . $this->escapeJS($section));
}
/**
* Get the number of items in the default submission checklist
* @return int
*/
protected function _getChecklistLength() {
return 5;
}
/**
* Get the submission element's name
* @return string
*/
protected function _getSubmissionElementName() {
return 'Article Text';
}
/**
* Send to review.
*/
protected function sendToReview() {
$this->waitForElementPresent($selector = 'css=[id^=externalReview-button-]');
$this->click($selector);
$this->waitForElementPresent('//form[@id=\'initiateReview\']//input[@type=\'checkbox\']');
$this->waitForElementPresent($selector = '//form[@id=\'initiateReview\']//button[contains(., \'Send to Review\')]');
$this->click($selector);
$this->waitForElementNotPresent('css=div.pkp_modal_panel');
}
}