|
20 | 20 | */ |
21 | 21 | class JoomlaBrowser extends WebDriver |
22 | 22 | { |
| 23 | + use ElementIsVisibleTrait; |
| 24 | + |
23 | 25 | /** |
24 | 26 | * The module required fields, to be set in the suite .yml configuration file. |
25 | 27 | * |
@@ -287,16 +289,18 @@ public function installJoomlaRemovingInstallationFolder() |
287 | 289 | { |
288 | 290 | $this->installJoomla(); |
289 | 291 |
|
290 | | - // TODO: This will not show in stable mode. Tests need to handle this accordingly |
291 | | - $this->debug('Removing Installation Folder'); |
292 | | - $this->click(['id' => 'removeInstallationFolder']); |
| 292 | + if (!$this->haveVisible('#removeInstallationFolder')) |
| 293 | + { |
| 294 | + $this->debug('Removing Installation Folder'); |
| 295 | + $this->click(['id' => 'removeInstallationFolder']); |
293 | 296 |
|
294 | | - // Accept the confirmation alert |
295 | | - $this->seeInPopup('Are you sure you want to delete?'); |
296 | | - $this->acceptPopup(); |
| 297 | + // Accept the confirmation alert |
| 298 | + $this->seeInPopup('Are you sure you want to delete?'); |
| 299 | + $this->acceptPopup(); |
297 | 300 |
|
298 | | - // Wait until the installation folder is gone and the "customize installation" box has been removed |
299 | | - $this->waitForElementNotVisible(['id' => 'installAddFeatures']); |
| 301 | + // Wait until the installation folder is gone and the "customize installation" box has been removed |
| 302 | + $this->waitForElementNotVisible(['id' => 'installAddFeatures']); |
| 303 | + } |
300 | 304 |
|
301 | 305 | $this->debug('Joomla is now installed'); |
302 | 306 | $this->click(['button' => "Complete & Open Admin"]); |
@@ -343,11 +347,15 @@ public function installJoomlaMultilingualSite($languages = array()) |
343 | 347 | $this->click(['link' => 'Next']); |
344 | 348 |
|
345 | 349 | $this->waitForText('Congratulations! Joomla! is now installed.', $this->config['timeout'], ['xpath' => '//h2']); |
346 | | - $this->debug('Removing Installation Folder'); |
347 | | - $this->click(['xpath' => "//input[@value='Remove \"installation\" folder']"]); |
348 | 350 |
|
349 | | - // @todo https://github.com/joomla-projects/joomla-browser/issues/45 |
350 | | - $this->wait(2); |
| 351 | + if (!$this->haveVisible('#removeInstallationFolder')) |
| 352 | + { |
| 353 | + $this->debug('Removing Installation Folder'); |
| 354 | + $this->click(['xpath' => "//input[@value='Remove \"installation\" folder']"]); |
| 355 | + |
| 356 | + // Wait until the installation folder is gone and the "customize installation" box has been removed |
| 357 | + $this->waitForElementNotVisible(['id' => 'installAddFeatures']); |
| 358 | + } |
351 | 359 |
|
352 | 360 | $this->debug('Joomla is now installed'); |
353 | 361 | $this->see('Congratulations! Joomla! is now installed.', ['xpath' => '//h2']); |
|
0 commit comments