Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatalja Romancaka <natalja.romancaka@zabbix.com>2022-11-07 14:16:45 +0300
committerNatalja Romancaka <natalja.romancaka@zabbix.com>2022-11-07 14:16:45 +0300
commiteb5829901f649034d39cda76ac26448037a02f8b (patch)
tree557a6568daf19fa74c4b17e0e523a13e79f71d51
parent3a9b3ff3b3a9b5cdf0f72910e461816436fd58e3 (diff)
.......... [ZBXNEXT-7469] fixed Selenium tests, code simplified
-rw-r--r--ui/tests/selenium/testPageAdministrationGeneralModules.php5
-rw-r--r--ui/tests/selenium/users/testFormUserPermissions.php5
2 files changed, 2 insertions, 8 deletions
diff --git a/ui/tests/selenium/testPageAdministrationGeneralModules.php b/ui/tests/selenium/testPageAdministrationGeneralModules.php
index 4ea9799f49e..982918cc1c3 100644
--- a/ui/tests/selenium/testPageAdministrationGeneralModules.php
+++ b/ui/tests/selenium/testPageAdministrationGeneralModules.php
@@ -88,16 +88,13 @@ class testPageAdministrationGeneralModules extends CWebTest {
// Create an array with widgt modules that should be present by default.
$widget_modules = [];
- $i = 0;
- foreach (self::$widget_names as $name) {
+ foreach (self::$widget_names as $i => $name) {
$widget_modules[$i]['Name'] = $name;
$widget_modules[$i]['Version'] = '1.0';
$widget_modules[$i]['Author'] = 'Zabbix SIA';
$widget_modules[$i]['Description'] = '';
$widget_modules[$i]['Status'] = 'Enabled';
-
- $i++;
}
// Open modules page and check header.
diff --git a/ui/tests/selenium/users/testFormUserPermissions.php b/ui/tests/selenium/users/testFormUserPermissions.php
index 85607986122..99f0128f9b2 100644
--- a/ui/tests/selenium/users/testFormUserPermissions.php
+++ b/ui/tests/selenium/users/testFormUserPermissions.php
@@ -473,10 +473,7 @@ class testFormUserPermissions extends CWebTest {
// Check that the default modules are present in form.
$modules_selector = 'xpath://h4[text()="Access to modules"]/../../following::li[1]//span';
$modules = $this->query($modules_selector)->all()->asText();
-
- foreach (array_values($modules) as $module_name) {
- $this->assertTrue(in_array($module_name, $widget_modules));
- }
+ $this->assertEquals($widget_modules, array_values($modules));
$this->page->open('zabbix.php?action=module.list')->waitUntilReady();
$this->query('button:Scan directory')->one()->click();