@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | { |
| 31 | 31 | $els = self::$driver->findElements($by); |
| 32 | 32 | if (count($els)) { |
| 33 | - $this->fail("Unexpectedly element was found by " . $by . PHP_EOL); |
|
| 33 | + $this->fail("Unexpectedly element was found by ".$by.PHP_EOL); |
|
| 34 | 34 | } |
| 35 | 35 | // increment assertion counter |
| 36 | 36 | $this->assertTrue(true); |
@@ -45,16 +45,16 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | protected function selectDropdownItem(string $name, string $value): void |
| 47 | 47 | { |
| 48 | - $xpath = '//select[@name="' . $name . '"]/ancestor::div[contains(@class, "ui") and contains(@class ,"dropdown")]'; |
|
| 49 | - $xpath .='| //div[@id="' . $name . '" and contains(@class, "ui") and contains(@class ,"dropdown") ]'; |
|
| 48 | + $xpath = '//select[@name="'.$name.'"]/ancestor::div[contains(@class, "ui") and contains(@class ,"dropdown")]'; |
|
| 49 | + $xpath .= '| //div[@id="'.$name.'" and contains(@class, "ui") and contains(@class ,"dropdown") ]'; |
|
| 50 | 50 | try { |
| 51 | 51 | $selectItem = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 52 | 52 | $selectItem->click(); |
| 53 | 53 | $this->waitForAjax(); |
| 54 | 54 | |
| 55 | 55 | // If search field exists input them before select |
| 56 | - $xpath = '//select[@name="' . $name . '"]/ancestor::div[contains(@class, "ui") and contains(@class ,"dropdown")]/input[contains(@class,"search")]'; |
|
| 57 | - $xpath .='| //div[@id="' . $name . '" and contains(@class, "ui") and contains(@class ,"dropdown") ]/input[contains(@class,"search")]'; |
|
| 56 | + $xpath = '//select[@name="'.$name.'"]/ancestor::div[contains(@class, "ui") and contains(@class ,"dropdown")]/input[contains(@class,"search")]'; |
|
| 57 | + $xpath .= '| //div[@id="'.$name.'" and contains(@class, "ui") and contains(@class ,"dropdown") ]/input[contains(@class,"search")]'; |
|
| 58 | 58 | $inputItems = self::$driver->findElements(WebDriverBy::xpath($xpath)); |
| 59 | 59 | foreach ($inputItems as $inputItem) { |
| 60 | 60 | $inputItem->click(); |
@@ -63,17 +63,17 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | // Находим строчку с нужной опцией по значению |
| 66 | - $xpath = '//div[contains(@class, "menu") and contains(@class ,"visible")]/div[@data-value="' . $value . '"]'; |
|
| 66 | + $xpath = '//div[contains(@class, "menu") and contains(@class ,"visible")]/div[@data-value="'.$value.'"]'; |
|
| 67 | 67 | $menuItem = self::$driver->wait()->until( |
| 68 | 68 | WebDriverExpectedCondition::presenceOfElementLocated(WebDriverBy::xpath($xpath)) |
| 69 | 69 | ); |
| 70 | 70 | $menuItem->click(); |
| 71 | 71 | } catch (NoSuchElementException $e) { |
| 72 | - $this->fail('Not found select with name ' . $name . 'on selectDropdownItem'. PHP_EOL); |
|
| 72 | + $this->fail('Not found select with name '.$name.'on selectDropdownItem'.PHP_EOL); |
|
| 73 | 73 | } catch (TimeoutException $e) { |
| 74 | - $this->fail('Not found menuitem ' . $value . PHP_EOL); |
|
| 74 | + $this->fail('Not found menuitem '.$value.PHP_EOL); |
|
| 75 | 75 | } catch (Exception $e) { |
| 76 | - $this->fail('Unknown error ' . $e->getMessage() . PHP_EOL); |
|
| 76 | + $this->fail('Unknown error '.$e->getMessage().PHP_EOL); |
|
| 77 | 77 | } |
| 78 | 78 | } |
| 79 | 79 | |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | { |
| 85 | 85 | while (true) // Handle timeout somewhere |
| 86 | 86 | { |
| 87 | - $ajaxIsComplete = (bool)(self::$driver->executeScript("return jQuery.active == 0")); |
|
| 87 | + $ajaxIsComplete = (bool) (self::$driver->executeScript("return jQuery.active == 0")); |
|
| 88 | 88 | if ($ajaxIsComplete) { |
| 89 | 89 | break; |
| 90 | 90 | } |
@@ -99,17 +99,17 @@ discard block |
||
| 99 | 99 | * @param $checkedValue string checked value |
| 100 | 100 | * @param bool $skipIfNotExist |
| 101 | 101 | */ |
| 102 | - protected function assertMenuItemSelected(string $name, string $checkedValue, $skipIfNotExist=false): void |
|
| 102 | + protected function assertMenuItemSelected(string $name, string $checkedValue, $skipIfNotExist = false): void |
|
| 103 | 103 | { |
| 104 | - $xpath = '//select[@name="' . $name . '"]/option[@selected="selected"]'; |
|
| 104 | + $xpath = '//select[@name="'.$name.'"]/option[@selected="selected"]'; |
|
| 105 | 105 | $selectedExtensions = self::$driver->findElements(WebDriverBy::xpath($xpath)); |
| 106 | 106 | foreach ($selectedExtensions as $element) { |
| 107 | 107 | $currentValue = $element->getAttribute('value'); |
| 108 | 108 | $message = "{$name} check failure, because {$checkedValue} != {$currentValue}"; |
| 109 | 109 | $this->assertEquals($checkedValue, $currentValue, $message); |
| 110 | 110 | } |
| 111 | - if (!$skipIfNotExist && count($selectedExtensions)===0){ |
|
| 112 | - $this->fail('Not found select with name ' . $name .' in assertMenuItemSelected'. PHP_EOL); |
|
| 111 | + if (!$skipIfNotExist && count($selectedExtensions) === 0) { |
|
| 112 | + $this->fail('Not found select with name '.$name.' in assertMenuItemSelected'.PHP_EOL); |
|
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | |
@@ -120,17 +120,17 @@ discard block |
||
| 120 | 120 | * @param string $value |
| 121 | 121 | * @param bool $skipIfNotExist |
| 122 | 122 | */ |
| 123 | - protected function changeTextAreaValue(string $name, string $value, bool $skipIfNotExist=false): void |
|
| 123 | + protected function changeTextAreaValue(string $name, string $value, bool $skipIfNotExist = false): void |
|
| 124 | 124 | { |
| 125 | - $xpath = ('//textarea[@name="' . $name . '"]'); |
|
| 125 | + $xpath = ('//textarea[@name="'.$name.'"]'); |
|
| 126 | 126 | $textAreaItems = self::$driver->findElements(WebDriverBy::xpath($xpath)); |
| 127 | 127 | foreach ($textAreaItems as $textAreaItem) { |
| 128 | 128 | $textAreaItem->click(); |
| 129 | 129 | $textAreaItem->clear(); |
| 130 | 130 | $textAreaItem->sendKeys($value); |
| 131 | 131 | } |
| 132 | - if (!$skipIfNotExist && count($textAreaItems)===0){ |
|
| 133 | - $this->fail('Not found textarea with name ' . $name .' in changeTextAreaValue'. PHP_EOL); |
|
| 132 | + if (!$skipIfNotExist && count($textAreaItems) === 0) { |
|
| 133 | + $this->fail('Not found textarea with name '.$name.' in changeTextAreaValue'.PHP_EOL); |
|
| 134 | 134 | } |
| 135 | 135 | } |
| 136 | 136 | |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | */ |
| 143 | 143 | protected function assertTextAreaValueIsEqual(string $name, string $checkedValue): void |
| 144 | 144 | { |
| 145 | - $xpath = '//textarea[@name="' . $name . '"]'; |
|
| 145 | + $xpath = '//textarea[@name="'.$name.'"]'; |
|
| 146 | 146 | $textAreaItem = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 147 | 147 | $currentValue = $textAreaItem->getAttribute('value'); |
| 148 | 148 | $message = "{$name} check failure, because {$checkedValue} != {$currentValue}"; |
@@ -156,15 +156,15 @@ discard block |
||
| 156 | 156 | * @param string $value |
| 157 | 157 | * @param bool $skipIfNotExist |
| 158 | 158 | */ |
| 159 | - protected function changeFileField(string $name, string $value, bool $skipIfNotExist=false): void |
|
| 159 | + protected function changeFileField(string $name, string $value, bool $skipIfNotExist = false): void |
|
| 160 | 160 | { |
| 161 | - $xpath = '//input[@name="' . $name . '" and (@type = "file")]'; |
|
| 161 | + $xpath = '//input[@name="'.$name.'" and (@type = "file")]'; |
|
| 162 | 162 | $inputItems = self::$driver->findElements(WebDriverBy::xpath($xpath)); |
| 163 | 163 | foreach ($inputItems as $inputItem) { |
| 164 | 164 | $inputItem->sendKeys($value); |
| 165 | 165 | } |
| 166 | - if (!$skipIfNotExist && count($inputItems)===0){ |
|
| 167 | - $this->fail('Not found input with type FILE and with name ' . $name .' in changeFileField'. PHP_EOL); |
|
| 166 | + if (!$skipIfNotExist && count($inputItems) === 0) { |
|
| 167 | + $this->fail('Not found input with type FILE and with name '.$name.' in changeFileField'.PHP_EOL); |
|
| 168 | 168 | } |
| 169 | 169 | } |
| 170 | 170 | |
@@ -175,17 +175,17 @@ discard block |
||
| 175 | 175 | * @param string $value |
| 176 | 176 | * @param bool $skipIfNotExist |
| 177 | 177 | */ |
| 178 | - protected function changeInputField(string $name, string $value, bool $skipIfNotExist=false): void |
|
| 178 | + protected function changeInputField(string $name, string $value, bool $skipIfNotExist = false): void |
|
| 179 | 179 | { |
| 180 | - $xpath = '//input[@name="' . $name . '" and (@type="text" or @type="password" or @type="hidden" or @type="number")]'; |
|
| 180 | + $xpath = '//input[@name="'.$name.'" and (@type="text" or @type="password" or @type="hidden" or @type="number")]'; |
|
| 181 | 181 | $inputItems = self::$driver->findElements(WebDriverBy::xpath($xpath)); |
| 182 | 182 | foreach ($inputItems as $inputItem) { |
| 183 | 183 | $inputItem->click(); |
| 184 | 184 | $inputItem->clear(); |
| 185 | 185 | $inputItem->sendKeys($value); |
| 186 | 186 | } |
| 187 | - if (!$skipIfNotExist && count($inputItems)===0){ |
|
| 188 | - $this->fail('Not found input with name ' . $name .' in changeInputField'. PHP_EOL); |
|
| 187 | + if (!$skipIfNotExist && count($inputItems) === 0) { |
|
| 188 | + $this->fail('Not found input with name '.$name.' in changeInputField'.PHP_EOL); |
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
@@ -196,17 +196,17 @@ discard block |
||
| 196 | 196 | * @param string $checkedValue |
| 197 | 197 | * @param bool $skipIfNotExist |
| 198 | 198 | */ |
| 199 | - protected function assertInputFieldValueEqual(string $name, string $checkedValue, $skipIfNotExist=false): void |
|
| 199 | + protected function assertInputFieldValueEqual(string $name, string $checkedValue, $skipIfNotExist = false): void |
|
| 200 | 200 | { |
| 201 | - $xpath = '//input[@name="' . $name . '" and (@type="text" or @type="number" or @type="password" or @type="hidden")]'; |
|
| 201 | + $xpath = '//input[@name="'.$name.'" and (@type="text" or @type="number" or @type="password" or @type="hidden")]'; |
|
| 202 | 202 | $inputItems = self::$driver->findElements(WebDriverBy::xpath($xpath)); |
| 203 | 203 | foreach ($inputItems as $inputItem) { |
| 204 | 204 | $currentValue = $inputItem->getAttribute('value'); |
| 205 | 205 | $message = "input field: '{$name}' check failure, because {$checkedValue} != {$currentValue}"; |
| 206 | 206 | $this->assertEquals($checkedValue, $currentValue, $message); |
| 207 | 207 | } |
| 208 | - if (!$skipIfNotExist && count($inputItems)===0){ |
|
| 209 | - $this->fail('Not found input with name ' . $name .' in assertInputFieldValueEqual'. PHP_EOL); |
|
| 208 | + if (!$skipIfNotExist && count($inputItems) === 0) { |
|
| 209 | + $this->fail('Not found input with name '.$name.' in assertInputFieldValueEqual'.PHP_EOL); |
|
| 210 | 210 | } |
| 211 | 211 | } |
| 212 | 212 | |
@@ -217,23 +217,23 @@ discard block |
||
| 217 | 217 | * @param bool $enabled |
| 218 | 218 | * @param bool $skipIfNotExist |
| 219 | 219 | */ |
| 220 | - protected function changeCheckBoxState(string $name, bool $enabled, $skipIfNotExist=false): void |
|
| 220 | + protected function changeCheckBoxState(string $name, bool $enabled, $skipIfNotExist = false): void |
|
| 221 | 221 | { |
| 222 | - $xpath = '//input[@name="' . $name . '" and @type="checkbox"]'; |
|
| 222 | + $xpath = '//input[@name="'.$name.'" and @type="checkbox"]'; |
|
| 223 | 223 | $checkBoxItems = self::$driver->findElements(WebDriverBy::xpath($xpath)); |
| 224 | 224 | foreach ($checkBoxItems as $checkBoxItem) { |
| 225 | 225 | if ( |
| 226 | - ($enabled && ! $checkBoxItem->isSelected()) |
|
| 226 | + ($enabled && !$checkBoxItem->isSelected()) |
|
| 227 | 227 | || |
| 228 | - ( ! $enabled && $checkBoxItem->isSelected()) |
|
| 228 | + (!$enabled && $checkBoxItem->isSelected()) |
|
| 229 | 229 | ) { |
| 230 | - $xpath = '//input[@name="' . $name . '" and @type="checkbox"]/parent::div'; |
|
| 230 | + $xpath = '//input[@name="'.$name.'" and @type="checkbox"]/parent::div'; |
|
| 231 | 231 | $checkBoxItem = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 232 | 232 | $checkBoxItem->click(); |
| 233 | 233 | } |
| 234 | 234 | } |
| 235 | - if (!$skipIfNotExist && count($checkBoxItems)===0){ |
|
| 236 | - $this->fail('Not found checkbox with name ' . $name .' in changeCheckBoxState'. PHP_EOL); |
|
| 235 | + if (!$skipIfNotExist && count($checkBoxItems) === 0) { |
|
| 236 | + $this->fail('Not found checkbox with name '.$name.' in changeCheckBoxState'.PHP_EOL); |
|
| 237 | 237 | } |
| 238 | 238 | } |
| 239 | 239 | |
@@ -244,19 +244,19 @@ discard block |
||
| 244 | 244 | * @param bool $enabled checked state |
| 245 | 245 | * @param bool $skipIfNotExist |
| 246 | 246 | */ |
| 247 | - protected function assertCheckBoxStageIsEqual(string $name, bool $enabled, $skipIfNotExist=false): void |
|
| 247 | + protected function assertCheckBoxStageIsEqual(string $name, bool $enabled, $skipIfNotExist = false): void |
|
| 248 | 248 | { |
| 249 | - $xpath = '//input[@name="' . $name . '" and @type="checkbox"]'; |
|
| 249 | + $xpath = '//input[@name="'.$name.'" and @type="checkbox"]'; |
|
| 250 | 250 | $checkBoxItems = self::$driver->findElements(WebDriverBy::xpath($xpath)); |
| 251 | 251 | foreach ($checkBoxItems as $checkBoxItem) { |
| 252 | 252 | if ($enabled) { |
| 253 | - $this->assertTrue($checkBoxItem->isSelected(), "{$name} must be checked" . PHP_EOL); |
|
| 253 | + $this->assertTrue($checkBoxItem->isSelected(), "{$name} must be checked".PHP_EOL); |
|
| 254 | 254 | } else { |
| 255 | - $this->assertFalse($checkBoxItem->isSelected(), "{$name} must be unchecked" . PHP_EOL); |
|
| 255 | + $this->assertFalse($checkBoxItem->isSelected(), "{$name} must be unchecked".PHP_EOL); |
|
| 256 | 256 | } |
| 257 | 257 | } |
| 258 | - if (!$skipIfNotExist && count($checkBoxItems)===0){ |
|
| 259 | - $this->fail('Not found checkbox with name ' . $name .' in assertCheckBoxStageIsEqual'. PHP_EOL); |
|
| 258 | + if (!$skipIfNotExist && count($checkBoxItems) === 0) { |
|
| 259 | + $this->fail('Not found checkbox with name '.$name.' in assertCheckBoxStageIsEqual'.PHP_EOL); |
|
| 260 | 260 | } |
| 261 | 261 | } |
| 262 | 262 | |
@@ -268,24 +268,24 @@ discard block |
||
| 268 | 268 | */ |
| 269 | 269 | protected function submitForm(string $formId): void |
| 270 | 270 | { |
| 271 | - $xpath = '//form[@id="' . $formId . '"]//ancestor::div[@id="submitbutton"]'; |
|
| 271 | + $xpath = '//form[@id="'.$formId.'"]//ancestor::div[@id="submitbutton"]'; |
|
| 272 | 272 | try { |
| 273 | 273 | $button_Submit = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 274 | 274 | $button_Submit->click(); |
| 275 | 275 | $this->waitForAjax(); |
| 276 | 276 | self::$driver->wait(10, 500)->until( |
| 277 | - function ($driver) use ($xpath) { |
|
| 277 | + function($driver) use ($xpath) { |
|
| 278 | 278 | $button_Submit = $driver->findElement(WebDriverBy::xpath($xpath)); |
| 279 | 279 | |
| 280 | 280 | return $button_Submit->isEnabled(); |
| 281 | 281 | } |
| 282 | 282 | ); |
| 283 | 283 | } catch (NoSuchElementException $e) { |
| 284 | - $this->fail('Not found submit button on this page' . PHP_EOL); |
|
| 284 | + $this->fail('Not found submit button on this page'.PHP_EOL); |
|
| 285 | 285 | } catch (TimeoutException $e) { |
| 286 | - $this->fail('Form doesn\'t send after 10 seconds timeout' . PHP_EOL); |
|
| 286 | + $this->fail('Form doesn\'t send after 10 seconds timeout'.PHP_EOL); |
|
| 287 | 287 | } catch (Exception $e) { |
| 288 | - $this->fail('Unknown error ' . $e->getMessage() . PHP_EOL); |
|
| 288 | + $this->fail('Unknown error '.$e->getMessage().PHP_EOL); |
|
| 289 | 289 | } |
| 290 | 290 | } |
| 291 | 291 | |
@@ -297,14 +297,14 @@ discard block |
||
| 297 | 297 | protected function clickSidebarMenuItemByHref(string $href): void |
| 298 | 298 | { |
| 299 | 299 | try { |
| 300 | - $xpath = '//div[@id="sidebar-menu"]//ancestor::a[contains(@class, "item") and contains(@href ,"' . $href . '")]'; |
|
| 300 | + $xpath = '//div[@id="sidebar-menu"]//ancestor::a[contains(@class, "item") and contains(@href ,"'.$href.'")]'; |
|
| 301 | 301 | $sidebarItem = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 302 | 302 | $sidebarItem->click(); |
| 303 | 303 | $this->waitForAjax(); |
| 304 | 304 | } catch (NoSuchElementException $e) { |
| 305 | - $this->fail('Not found sidebar item with href=' . $href . ' on this page' . PHP_EOL); |
|
| 305 | + $this->fail('Not found sidebar item with href='.$href.' on this page'.PHP_EOL); |
|
| 306 | 306 | } catch (Exception $e) { |
| 307 | - $this->fail('Unknown error ' . $e->getMessage() . PHP_EOL); |
|
| 307 | + $this->fail('Unknown error '.$e->getMessage().PHP_EOL); |
|
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | |
@@ -315,15 +315,15 @@ discard block |
||
| 315 | 315 | */ |
| 316 | 316 | protected function clickModifyButtonOnRowWithText(string $text): void |
| 317 | 317 | { |
| 318 | - $xpath = ('//td[contains(text(),"' . $text . '")]/parent::tr[contains(@class, "row")]//a[contains(@href,"modify")]'); |
|
| 318 | + $xpath = ('//td[contains(text(),"'.$text.'")]/parent::tr[contains(@class, "row")]//a[contains(@href,"modify")]'); |
|
| 319 | 319 | try { |
| 320 | 320 | $tableButtonModify = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 321 | 321 | $tableButtonModify->click(); |
| 322 | 322 | $this->waitForAjax(); |
| 323 | 323 | } catch (NoSuchElementException $e) { |
| 324 | - $this->fail('Not found row with text=' . $text . ' on this page' . PHP_EOL); |
|
| 324 | + $this->fail('Not found row with text='.$text.' on this page'.PHP_EOL); |
|
| 325 | 325 | } catch (Exception $e) { |
| 326 | - $this->fail('Unknown error ' . $e->getMessage() . PHP_EOL); |
|
| 326 | + $this->fail('Unknown error '.$e->getMessage().PHP_EOL); |
|
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | |
@@ -334,15 +334,15 @@ discard block |
||
| 334 | 334 | */ |
| 335 | 335 | protected function clickModifyButtonOnRowWithID(string $id): void |
| 336 | 336 | { |
| 337 | - $xpath = ('//tr[contains(@class, "row") and @id="' . $id . '"]//a[contains(@href,"modify")]'); |
|
| 337 | + $xpath = ('//tr[contains(@class, "row") and @id="'.$id.'"]//a[contains(@href,"modify")]'); |
|
| 338 | 338 | try { |
| 339 | 339 | $tableButtonModify = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 340 | 340 | $tableButtonModify->click(); |
| 341 | 341 | $this->waitForAjax(); |
| 342 | 342 | } catch (NoSuchElementException $e) { |
| 343 | - $this->fail('Not found row with id=' . $id . ' on this page' . PHP_EOL); |
|
| 343 | + $this->fail('Not found row with id='.$id.' on this page'.PHP_EOL); |
|
| 344 | 344 | } catch (Exception $e) { |
| 345 | - $this->fail('Unknown error ' . $e->getMessage() . PHP_EOL); |
|
| 345 | + $this->fail('Unknown error '.$e->getMessage().PHP_EOL); |
|
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | */ |
| 354 | 354 | protected function clickDeleteButtonOnRowWithText(string $text): void |
| 355 | 355 | { |
| 356 | - $xpath = ('//td[contains(text(),"' . $text . '")]/ancestor::tr[contains(@class, "row")]//a[contains(@href,"delete")]'); |
|
| 356 | + $xpath = ('//td[contains(text(),"'.$text.'")]/ancestor::tr[contains(@class, "row")]//a[contains(@href,"delete")]'); |
|
| 357 | 357 | try { |
| 358 | 358 | $deleteButton = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 359 | 359 | $deleteButton->click(); |
@@ -361,9 +361,9 @@ discard block |
||
| 361 | 361 | $deleteButton->click(); |
| 362 | 362 | $this->waitForAjax(); |
| 363 | 363 | } catch (NoSuchElementException $e) { |
| 364 | - echo('Not found row with text=' . $text . ' on this page in clickDeleteButtonOnRowWithText'. PHP_EOL); |
|
| 364 | + echo('Not found row with text='.$text.' on this page in clickDeleteButtonOnRowWithText'.PHP_EOL); |
|
| 365 | 365 | } catch (Exception $e) { |
| 366 | - $this->fail('Unknown error ' . $e->getMessage() . PHP_EOL); |
|
| 366 | + $this->fail('Unknown error '.$e->getMessage().PHP_EOL); |
|
| 367 | 367 | } |
| 368 | 368 | } |
| 369 | 369 | |
@@ -380,9 +380,9 @@ discard block |
||
| 380 | 380 | $button_AddNew->click(); |
| 381 | 381 | $this->waitForAjax(); |
| 382 | 382 | } catch (NoSuchElementException $e) { |
| 383 | - $this->fail('Not found button with href=' . $href . ' on this page on clickButtonByHref' . PHP_EOL); |
|
| 383 | + $this->fail('Not found button with href='.$href.' on this page on clickButtonByHref'.PHP_EOL); |
|
| 384 | 384 | } catch (Exception $e) { |
| 385 | - $this->fail('Unknown error ' . $e->getMessage() . PHP_EOL); |
|
| 385 | + $this->fail('Unknown error '.$e->getMessage().PHP_EOL); |
|
| 386 | 386 | } |
| 387 | 387 | } |
| 388 | 388 | |
@@ -398,9 +398,9 @@ discard block |
||
| 398 | 398 | $tab = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 399 | 399 | $tab->click(); |
| 400 | 400 | } catch (NoSuchElementException $e) { |
| 401 | - $this->fail('Not found tab with anchor=' . $anchor . ' on this page in changeTabOnCurrentPage' . PHP_EOL); |
|
| 401 | + $this->fail('Not found tab with anchor='.$anchor.' on this page in changeTabOnCurrentPage'.PHP_EOL); |
|
| 402 | 402 | } catch (Exception $e) { |
| 403 | - $this->fail('Unknown error ' . $e->getMessage() . PHP_EOL); |
|
| 403 | + $this->fail('Unknown error '.$e->getMessage().PHP_EOL); |
|
| 404 | 404 | } |
| 405 | 405 | } |
| 406 | 406 | |
@@ -414,9 +414,9 @@ discard block |
||
| 414 | 414 | $tab = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 415 | 415 | $tab->click(); |
| 416 | 416 | } catch (NoSuchElementException $e) { |
| 417 | - $this->fail('Not found usual accordion element on this page on openAccordionOnThePage' . PHP_EOL); |
|
| 417 | + $this->fail('Not found usual accordion element on this page on openAccordionOnThePage'.PHP_EOL); |
|
| 418 | 418 | } catch (Exception $e) { |
| 419 | - $this->fail('Unknown error ' . $e->getMessage() .' on openAccordionOnThePage'. PHP_EOL); |
|
| 419 | + $this->fail('Unknown error '.$e->getMessage().' on openAccordionOnThePage'.PHP_EOL); |
|
| 420 | 420 | } |
| 421 | 421 | } |
| 422 | 422 | |
@@ -430,11 +430,11 @@ discard block |
||
| 430 | 430 | try { |
| 431 | 431 | $xpath = '//input[@name="id" and (@type="hidden")]'; |
| 432 | 432 | $input = self::$driver->findElement(WebDriverBy::xpath($xpath)); |
| 433 | - return $input->getAttribute('value')??''; |
|
| 433 | + return $input->getAttribute('value') ?? ''; |
|
| 434 | 434 | } catch (NoSuchElementException $e) { |
| 435 | - $this->fail('Not found input with name ID on this page getCurrentRecordID' . PHP_EOL); |
|
| 435 | + $this->fail('Not found input with name ID on this page getCurrentRecordID'.PHP_EOL); |
|
| 436 | 436 | } catch (Exception $e) { |
| 437 | - $this->fail('Unknown error ' . $e->getMessage() . PHP_EOL); |
|
| 437 | + $this->fail('Unknown error '.$e->getMessage().PHP_EOL); |
|
| 438 | 438 | } |
| 439 | 439 | } |
| 440 | 440 | |
@@ -447,7 +447,7 @@ discard block |
||
| 447 | 447 | */ |
| 448 | 448 | protected function deleteAllRecordsOnTable(string $tableId): void |
| 449 | 449 | { |
| 450 | - $xpath = '//table[@id="' . $tableId . '"]//a[contains(@href,"delete")]'; |
|
| 450 | + $xpath = '//table[@id="'.$tableId.'"]//a[contains(@href,"delete")]'; |
|
| 451 | 451 | $deleteButtons = self::$driver->findElements(WebDriverBy::xpath($xpath)); |
| 452 | 452 | while (count($deleteButtons) > 0) { |
| 453 | 453 | try { |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | public static function setUpBeforeClass():void |
| 18 | 18 | { |
| 19 | 19 | parent::setUpBeforeClass(); |
| 20 | - $basic= new MikoPBXTestsBase(); |
|
| 20 | + $basic = new MikoPBXTestsBase(); |
|
| 21 | 21 | $basic->deleteAllRecordsOnTable('firewall-table'); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -31,17 +31,17 @@ discard block |
||
| 31 | 31 | { |
| 32 | 32 | $this->clickSidebarMenuItemByHref("/admin-cabinet/firewall/index/"); |
| 33 | 33 | |
| 34 | - $this->changeCheckBoxState('status',$params['status']); |
|
| 34 | + $this->changeCheckBoxState('status', $params['status']); |
|
| 35 | 35 | $this->clickButtonByHref('/admin-cabinet/firewall/modify'); |
| 36 | - $this->changeInputField('description',$params['description']); |
|
| 37 | - $this->changeInputField('network',$params['network']); |
|
| 38 | - $this->selectDropdownItem('subnet',$params['subnet']); |
|
| 36 | + $this->changeInputField('description', $params['description']); |
|
| 37 | + $this->changeInputField('network', $params['network']); |
|
| 38 | + $this->selectDropdownItem('subnet', $params['subnet']); |
|
| 39 | 39 | |
| 40 | - foreach ($params['rules'] as $key=>$value){ |
|
| 40 | + foreach ($params['rules'] as $key=>$value) { |
|
| 41 | 41 | $this->changeCheckBoxState('rule_'.$key, $value); |
| 42 | 42 | } |
| 43 | - $this->changeCheckBoxState('local_network',$params['local_network']); |
|
| 44 | - $this->changeCheckBoxState('newer_block_ip',$params['newer_block_ip']); |
|
| 43 | + $this->changeCheckBoxState('local_network', $params['local_network']); |
|
| 44 | + $this->changeCheckBoxState('newer_block_ip', $params['newer_block_ip']); |
|
| 45 | 45 | |
| 46 | 46 | $this->submitForm('firewall-form'); |
| 47 | 47 | |
@@ -52,16 +52,16 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | //asserts |
| 55 | - $this->assertCheckBoxStageIsEqual('status',$params['status']); |
|
| 56 | - $this->assertInputFieldValueEqual('description',$params['description']); |
|
| 57 | - $this->assertInputFieldValueEqual('network',$params['network']); |
|
| 58 | - $this->assertMenuItemSelected('subnet',$params['subnet']); |
|
| 55 | + $this->assertCheckBoxStageIsEqual('status', $params['status']); |
|
| 56 | + $this->assertInputFieldValueEqual('description', $params['description']); |
|
| 57 | + $this->assertInputFieldValueEqual('network', $params['network']); |
|
| 58 | + $this->assertMenuItemSelected('subnet', $params['subnet']); |
|
| 59 | 59 | |
| 60 | - foreach ($params['rules'] as $key=>$value){ |
|
| 60 | + foreach ($params['rules'] as $key=>$value) { |
|
| 61 | 61 | $this->assertCheckBoxStageIsEqual('rule_'.$key, $value); |
| 62 | 62 | } |
| 63 | - $this->assertCheckBoxStageIsEqual('local_network',$params['local_network']); |
|
| 64 | - $this->assertCheckBoxStageIsEqual('newer_block_ip',$params['newer_block_ip']); |
|
| 63 | + $this->assertCheckBoxStageIsEqual('local_network', $params['local_network']); |
|
| 64 | + $this->assertCheckBoxStageIsEqual('newer_block_ip', $params['newer_block_ip']); |
|
| 65 | 65 | |
| 66 | 66 | } |
| 67 | 67 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | |
| 38 | 38 | $this->clickSidebarMenuItemByHref('/admin-cabinet/extensions/index/'); |
| 39 | 39 | $this->clickModifyButtonOnRowWithText($params['username']); |
| 40 | - $this->assertInputFieldValueEqual('number', $params['number']); |
|
| 40 | + $this->assertInputFieldValueEqual('number', $params['number']); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | $this->changeTabOnCurrentPage('general'); |
| 72 | 72 | // Раскрываем расширенные опции |
| 73 | 73 | $this->openAccordionOnThePage(); |
| 74 | - $this->assertInputFieldValueEqual('mobile_dialstring', $params['mobile']); |
|
| 74 | + $this->assertInputFieldValueEqual('mobile_dialstring', $params['mobile']); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | // Раскрываем расширенные опции |
| 106 | 106 | $this->changeTabOnCurrentPage('general'); |
| 107 | 107 | $this->openAccordionOnThePage(); |
| 108 | - $this->assertInputFieldValueEqual('mobile_dialstring', ''); |
|
| 108 | + $this->assertInputFieldValueEqual('mobile_dialstring', ''); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | $this->clickSidebarMenuItemByHref('/admin-cabinet/extensions/index/'); |
| 133 | 133 | $this->clickModifyButtonOnRowWithText($params['username']); |
| 134 | - $this->assertInputFieldValueEqual('user_email', $params['email']); |
|
| 134 | + $this->assertInputFieldValueEqual('user_email', $params['email']); |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | |
| 158 | 158 | $this->clickSidebarMenuItemByHref('/admin-cabinet/extensions/index/'); |
| 159 | 159 | $this->clickModifyButtonOnRowWithText($params['username']); |
| 160 | - $this->assertInputFieldValueEqual('user_email', ''); |
|
| 160 | + $this->assertInputFieldValueEqual('user_email', ''); |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | /** |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | $this->selectDropdownItem('sip_networkfilterid', $params['sip_networkfilterid']); |
| 223 | 223 | |
| 224 | 224 | $this->changeInputField('sip_busylevel', $params['sip_busylevel']); |
| 225 | - foreach ($params['codecs'] as $key=>$value){ |
|
| 225 | + foreach ($params['codecs'] as $key=>$value) { |
|
| 226 | 226 | $this->changeCheckBoxState('codec_'.$key, $value); |
| 227 | 227 | } |
| 228 | 228 | $this->changeTextAreaValue('sip_manualattributes', $params['manualattributes']); |
@@ -247,9 +247,9 @@ discard block |
||
| 247 | 247 | |
| 248 | 248 | $this->clickSidebarMenuItemByHref('/admin-cabinet/extensions/index/'); |
| 249 | 249 | $this->clickModifyButtonOnRowWithText($params['username']); |
| 250 | - $this->assertInputFieldValueEqual('user_username', $params['username']); |
|
| 251 | - $this->assertInputFieldValueEqual('number', $params['number']); |
|
| 252 | - $this->assertInputFieldValueEqual('user_email', $params['email']); |
|
| 250 | + $this->assertInputFieldValueEqual('user_username', $params['username']); |
|
| 251 | + $this->assertInputFieldValueEqual('number', $params['number']); |
|
| 252 | + $this->assertInputFieldValueEqual('user_email', $params['email']); |
|
| 253 | 253 | // $this->assertInputFieldValueEqual('mobile_number', $params['mobile']); |
| 254 | 254 | |
| 255 | 255 | $this->changeTabOnCurrentPage('routing'); |
@@ -259,16 +259,16 @@ discard block |
||
| 259 | 259 | $this->assertMenuItemSelected('fwd_forwardingonunavailable', $params['fwd_forwardingonunavailable']); |
| 260 | 260 | $this->changeTabOnCurrentPage('general'); |
| 261 | 261 | $this->assertMenuItemSelected('user_language', $params['user_language']); |
| 262 | - $this->assertInputFieldValueEqual('sip_secret', $params['secret']); |
|
| 262 | + $this->assertInputFieldValueEqual('sip_secret', $params['secret']); |
|
| 263 | 263 | |
| 264 | 264 | |
| 265 | 265 | // Раскрываем расширенные опции |
| 266 | 266 | $this->openAccordionOnThePage(); |
| 267 | - $this->assertInputFieldValueEqual('mobile_dialstring', $params['mobile']); |
|
| 267 | + $this->assertInputFieldValueEqual('mobile_dialstring', $params['mobile']); |
|
| 268 | 268 | $this->assertInputFieldValueEqual('sip_busylevel', $params['sip_busylevel']); |
| 269 | 269 | $this->assertMenuItemSelected('sip_networkfilterid', $params['sip_networkfilterid']); |
| 270 | 270 | |
| 271 | - foreach ($params['codecs'] as $key=>$value){ |
|
| 271 | + foreach ($params['codecs'] as $key=>$value) { |
|
| 272 | 272 | $this->assertCheckBoxStageIsEqual('codec_'.$key, $value); |
| 273 | 273 | } |
| 274 | 274 | $this->assertTextAreaValueIsEqual('sip_manualattributes', $params['manualattributes']); |
@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | $this->clickSidebarMenuItemByHref('/admin-cabinet/time-settings/modify/'); |
| 26 | 26 | $this->selectDropdownItem('PBXTimezone', $params['PBXTimezone']); |
| 27 | 27 | $this->changeCheckBoxState('PBXManualTimeSettings', $params['PBXManualTimeSettings']); |
| 28 | - if ($params['PBXManualTimeSettings']){ |
|
| 28 | + if ($params['PBXManualTimeSettings']) { |
|
| 29 | 29 | self::$driver->executeScript("$('div#CalendarBlock div.input.calendar').calendar('set startDate', new Date())"); |
| 30 | 30 | } else { |
| 31 | 31 | $this->changeInputField('NTPServer', $params['NTPServer']); |
@@ -34,9 +34,9 @@ discard block |
||
| 34 | 34 | $this->submitForm('time-settings-form'); |
| 35 | 35 | $this->clickSidebarMenuItemByHref('/admin-cabinet/time-settings/modify/'); |
| 36 | 36 | |
| 37 | - $this->assertMenuItemSelected('PBXTimezone',$params['PBXTimezone']); |
|
| 37 | + $this->assertMenuItemSelected('PBXTimezone', $params['PBXTimezone']); |
|
| 38 | 38 | |
| 39 | - if ($params['PBXManualTimeSettings']){ |
|
| 39 | + if ($params['PBXManualTimeSettings']) { |
|
| 40 | 40 | $setupDate = self::$driver->executeScript("$('div#CalendarBlock div.input.calendar').calendar('get date')"); |
| 41 | 41 | } else { |
| 42 | 42 | $this->assertInputFieldValueEqual('NTPServer', $params['NTPServer']); |