diff options
Diffstat (limited to 'ui/tests/selenium/services/testPageServicesServicesMassUpdate.php')
-rw-r--r-- | ui/tests/selenium/services/testPageServicesServicesMassUpdate.php | 230 |
1 files changed, 71 insertions, 159 deletions
diff --git a/ui/tests/selenium/services/testPageServicesServicesMassUpdate.php b/ui/tests/selenium/services/testPageServicesServicesMassUpdate.php index 2bb574cfde8..ceadc649ee4 100644 --- a/ui/tests/selenium/services/testPageServicesServicesMassUpdate.php +++ b/ui/tests/selenium/services/testPageServicesServicesMassUpdate.php @@ -18,15 +18,15 @@ ** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. **/ + require_once dirname(__FILE__).'/../../include/CWebTest.php'; -require_once dirname(__FILE__).'/../../include/helpers/CDataHelper.php'; require_once dirname(__FILE__).'/../traits/TableTrait.php'; require_once dirname(__FILE__).'/../behaviors/CMessageBehavior.php'; /** * @backup services * - * @onBefore prepareServicesTagsData + * @dataSource Services */ class testPageServicesServicesMassUpdate extends CWebTest { @@ -43,110 +43,6 @@ class testPageServicesServicesMassUpdate extends CWebTest { return [CMessageBehavior::class]; } - public static function prepareServicesTagsData() { - CDataHelper::call('service.create', [ - [ - 'name' => '1_Service_Tags_Preprocessing', - 'algorithm' => 1, - 'sortorder' => 1, - 'tags' => [ - [ - 'tag' => 'old_tag_1', - 'value' => 'old_value_1' - ] - ] - ], - [ - 'name' => '2_Service_Tags_Preprocessing', - 'algorithm' => 1, - 'sortorder' => 2, - 'tags' => [ - [ - 'tag' => 'old_tag_2', - 'value' => 'old_value_2' - ], - [ - 'tag' => 'old_tag_3', - 'value' => 'old_value_3' - ] - ] - ], - [ - 'name' => '1_Service_No_Tags_Preprocessing', - 'algorithm' => 1, - 'sortorder' => 3 - ], - [ - 'name' => '2_Service_No_Tags_Preprocessing', - 'algorithm' => 1, - 'sortorder' => 4 - ], - [ - 'name' => '1_Service_Tags_replace', - 'algorithm' => 1, - 'sortorder' => 5, - 'tags' => [ - [ - 'tag' => 'Replace_tag_1', - 'value' => 'replace_value_1' - ], - [ - 'tag' => 'Replace_tag_2', - 'value' => 'Replace_value_2' - ] - ] - ], - [ - 'name' => '2_Service_Tags_replace', - 'algorithm' => 1, - 'sortorder' => 6, - 'tags' => [ - [ - 'tag' => 'Replace_tag_3', - 'value' => 'Replace_value_3' - ] - ] - ], - [ - 'name' => '1_Service_Tags_remove', - 'algorithm' => 1, - 'sortorder' => 7, - 'tags' => [ - [ - 'tag' => 'remove_tag_1', - 'value' => 'remove_value_1' - ], - [ - 'tag' => 'remove_tag_2', - 'value' => 'remove_value_2' - ] - ] - ], - [ - 'name' => '2_Service_Tags_remove', - 'algorithm' => 1, - 'sortorder' => 8, - 'tags' => [ - [ - 'tag' => 'remove_tag_2', - 'value' => 'remove_value_2' - ] - ] - ], - [ - 'name' => '3_Service_Tags_remove', - 'algorithm' => 1, - 'sortorder' => 9, - 'tags' => [ - [ - 'tag' => 'remove_tag_3', - 'value' => 'remove_value_3' - ] - ] - ] - ]); - } - public function getTagsData() { return [ // Empty tag name. @@ -154,8 +50,8 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ 'expected' => TEST_BAD, 'names' => [ - '1_Service_Tags_Preprocessing', - '1_Service_No_Tags_Preprocessing' + 'Service with problem', + 'Service with problem tags' ], 'Tags' => [ 'action' => 'Add', @@ -167,7 +63,7 @@ class testPageServicesServicesMassUpdate extends CWebTest { ] ] ], - 'details' => 'Invalid parameter "/1/tags/2/tag": cannot be empty.' + 'details' => 'Invalid parameter "/1/tags/1/tag": cannot be empty.' ] ], // TODO: Uncomment this case when ZBX-19263 is fixed. @@ -177,8 +73,8 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ 'expected' => TEST_BAD, 'names' => [ - '2_Service_Tags_Preprocessing', - '2_Service_No_Tags_Preprocessing' + 'Service with multiple service tags', + 'Service for duplitate check' ], 'Tags' => [ 'action' => 'Add', @@ -202,28 +98,28 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_Tags_Preprocessing', - '2_Service_Tags_Preprocessing' + 'Service with problem', + 'Service with multiple service tags' ], 'Tags' => [ 'action' => 'Add', 'tags' => [] ], 'expected_tags' => [ - '1_Service_Tags_Preprocessing' => [ + 'Service with problem' => [ [ 'tag' => 'old_tag_1', 'value' => 'old_value_1' ] ], - '2_Service_Tags_Preprocessing' => [ + 'Service with multiple service tags' => [ [ - 'tag' => 'old_tag_2', - 'value' => 'old_value_2' + 'tag' => 'problem', + 'value' => 'true' ], [ - 'tag' => 'old_tag_3', - 'value' => 'old_value_3' + 'tag' => 'test', + 'value' => 'test456' ] ] ] @@ -232,8 +128,8 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_Tags_Preprocessing', - '2_Service_Tags_Preprocessing' + 'Service with problem', + 'Service with multiple service tags' ], 'Tags' => [ 'action' => 'Add', @@ -247,7 +143,7 @@ class testPageServicesServicesMassUpdate extends CWebTest { ] ], 'expected_tags' => [ - '1_Service_Tags_Preprocessing' => [ + 'Service with problem' => [ [ 'tag' => 'added_tag_1', 'value' => 'added_value_1' @@ -257,18 +153,18 @@ class testPageServicesServicesMassUpdate extends CWebTest { 'value' => 'old_value_1' ] ], - '2_Service_Tags_Preprocessing' => [ + 'Service with multiple service tags' => [ [ 'tag' => 'added_tag_1', 'value' => 'added_value_1' ], [ - 'tag' => 'old_tag_2', - 'value' => 'old_value_2' + 'tag' => 'problem', + 'value' => 'true' ], [ - 'tag' => 'old_tag_3', - 'value' => 'old_value_3' + 'tag' => 'test', + 'value' => 'test456' ] ] ] @@ -277,21 +173,21 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_Tags_replace', - '2_Service_Tags_replace' + 'Service for mass update', + 'Update service' ], 'Tags' => [ 'action' => 'Replace', 'tags' => [] ], 'expected_tags' => [ - '1_Service_Tags_replace' => [ + 'Service for mass update' => [ [ 'tag' => '', 'value' => '' ] ], - '2_Service_Tags_replace' => [ + 'Update service' => [ [ 'tag' => '', 'value' => '' @@ -303,8 +199,8 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_Tags_replace', - '2_Service_Tags_replace' + 'Service for mass update', + 'Update service' ], 'Tags' => [ 'action' => 'Replace', @@ -318,13 +214,13 @@ class testPageServicesServicesMassUpdate extends CWebTest { ] ], 'expected_tags' => [ - '1_Service_Tags_replace' => [ + 'Service for mass update' => [ [ 'tag' => 'replaced_tag', 'value' => 'replaced_value' ] ], - '2_Service_Tags_replace' => [ + 'Update service' => [ [ 'tag' => 'replaced_tag', 'value' => 'replaced_value' @@ -336,8 +232,8 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_Tags_remove', - '2_Service_Tags_remove' + 'Service for delete 2', + 'Service for delete' ], 'Tags' => [ 'action' => 'Remove', @@ -349,7 +245,15 @@ class testPageServicesServicesMassUpdate extends CWebTest { ] ], 'expected_tags' => [ - '1_Service_Tags_remove' => [ + 'Service for delete 2' => [ + [ + 'tag' => '3rd_tag', + 'value' => '3rd_value' + ], + [ + 'tag' => '4th_tag', + 'value' => '4th_value' + ], [ 'tag' => 'remove_tag_1', 'value' => 'remove_value_1' @@ -359,7 +263,7 @@ class testPageServicesServicesMassUpdate extends CWebTest { 'value' => 'remove_value_2' ] ], - '2_Service_Tags_remove' => [ + 'Service for delete' => [ [ 'tag' => 'remove_tag_2', 'value' => 'remove_value_2' @@ -371,9 +275,9 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_Tags_remove', - '2_Service_Tags_remove', - '3_Service_Tags_remove' + 'Service for delete 2', + 'Service for delete', + 'Parent for child creation' ], 'Tags' => [ 'action' => 'Remove', @@ -387,19 +291,27 @@ class testPageServicesServicesMassUpdate extends CWebTest { ] ], 'expected_tags' => [ - '1_Service_Tags_remove' => [ + 'Service for delete 2' => [ + [ + 'tag' => '3rd_tag', + 'value' => '3rd_value' + ], + [ + 'tag' => '4th_tag', + 'value' => '4th_value' + ], [ 'tag' => 'remove_tag_1', 'value' => 'remove_value_1' ] ], - '2_Service_Tags_remove' => [ + 'Service for delete' => [ [ 'tag' => '', 'value' => '' ] ], - '3_Service_Tags_remove' => [ + 'Parent for child creation' => [ [ 'tag' => 'remove_tag_3', 'value' => 'remove_value_3' @@ -412,8 +324,8 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_No_Tags_Preprocessing', - '2_Service_No_Tags_Preprocessing' + 'Service with problem tags', + 'Service for duplitate check' ], 'Tags' => [ 'action' => 'Add', @@ -451,8 +363,8 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_No_Tags_Preprocessing', - '2_Service_No_Tags_Preprocessing' + 'Service with problem tags', + 'Service for duplitate check' ], 'Tags' => [ 'action' => 'Replace', @@ -475,8 +387,8 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_No_Tags_Preprocessing', - '2_Service_No_Tags_Preprocessing' + 'Service with problem tags', + 'Service for duplitate check' ], 'Tags' => [ 'action' => 'Replace', @@ -499,8 +411,8 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_No_Tags_Preprocessing', - '2_Service_No_Tags_Preprocessing' + 'Service with problem tags', + 'Service for duplitate check' ], 'Tags' => [ 'action' => 'Replace', @@ -520,8 +432,8 @@ class testPageServicesServicesMassUpdate extends CWebTest { [ [ 'names' => [ - '1_Service_No_Tags_Preprocessing', - '2_Service_No_Tags_Preprocessing' + 'Service with problem tags', + 'Service for duplitate check' ], 'Tags' => [ 'action' => 'Replace', @@ -622,10 +534,10 @@ class testPageServicesServicesMassUpdate extends CWebTest { $this->page->login()->open('zabbix.php?action=service.list.edit'); $services = [ - '1_Service_Tags_Preprocessing', - '2_Service_Tags_Preprocessing', - '1_Service_No_Tags_Preprocessing', - '2_Service_No_Tags_Preprocessing' + 'Service with problem', + 'Service with multiple service tags', + 'Service with problem tags', + 'Service for duplitate check' ]; $new_tags = [ |