From 28da15c7b766f9ee8ea6497c1dbf12db15e615dc Mon Sep 17 00:00:00 2001 From: Jelle Kok Date: Wed, 16 Dec 2015 11:59:49 +0100 Subject: [PATCH 1/3] Add wait time, to support tests on windows with wamp. We need to add some wait times after the choosen, because else the tests will fail on wamp. --- src/JoomlaBrowser.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index 1accaef..9399043 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -133,11 +133,12 @@ public function installJoomla() $I->debug('I select dk-DK as installation language'); // Select a random language to force reloading of the lang strings after selecting English $I->selectOptionInChosen('#jform_language', 'Danish (DK)'); + $I->wait(5); $I->waitForText('Generel konfiguration', 10, 'h3'); // Wait for chosen to render the field - $I->wait(1); $I->debug('I select en-GB as installation language'); $I->selectOptionInChosen('#jform_language', 'English (United Kingdom)'); + $I->wait(5); $I->waitForText('Main Configuration', 10, 'h3'); $this->debug('I fill Site Name'); $I->fillField(['id' => 'jform_site_name'], 'Joomla CMS test'); @@ -157,6 +158,7 @@ public function installJoomla() $I->click(['xpath' => "//fieldset[@id='jform_site_offline']/label[@for='jform_site_offline1']"]); // ['No Site Offline'] $this->debug('I click Next'); $I->click(['link' => 'Next']); + $I->wait(1); $this->debug('I Fill the form for creating the Joomla site Database'); $I->waitForText('Database Configuration',60,['css' => 'h3']); @@ -192,6 +194,7 @@ public function installJoomla() //endif; $I->selectOption(['id' => 'jform_sample_file'], ['id' => 'jform_sample_file0']); // No sample data $I->click(['link' => 'Install']); + $I->wait(1); // Wait while Joomla gets installed $this->debug('I wait for Joomla being installed'); From 172437cb8e626058a9079f9e1b0de3433c18f59c Mon Sep 17 00:00:00 2001 From: Jelle Kok Date: Wed, 16 Dec 2015 13:14:20 +0100 Subject: [PATCH 2/3] Add disablestatistics --- src/JoomlaBrowser.php | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index 9399043..6082fe8 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -133,13 +133,11 @@ public function installJoomla() $I->debug('I select dk-DK as installation language'); // Select a random language to force reloading of the lang strings after selecting English $I->selectOptionInChosen('#jform_language', 'Danish (DK)'); - $I->wait(5); - $I->waitForText('Generel konfiguration', 10, 'h3'); + $I->waitForText('Generel konfiguration', 20, 'h3'); // Wait for chosen to render the field $I->debug('I select en-GB as installation language'); $I->selectOptionInChosen('#jform_language', 'English (United Kingdom)'); - $I->wait(5); - $I->waitForText('Main Configuration', 10, 'h3'); + $I->waitForText('Main Configuration', 20, 'h3'); $this->debug('I fill Site Name'); $I->fillField(['id' => 'jform_site_name'], 'Joomla CMS test'); $this->debug('I fill Site Description'); @@ -858,4 +856,16 @@ public function verifyAvailableTabs($expectedTabs, $tabsLocator = ['xpath' => "/ $I->assertEquals($expectedTabs, $actualArrayOfTabs, "Tab Labels do not match on edit view of" . $url); $I->debug('Verify the Tabs'); } + + /** + * Hide the statistics info message + * + * @note: doAdminLogin() before + */ + public function disablestatistics() + { + $I = $this; + $this->debug('I click on never'); + $I->click(['link' => 'Never']); + } } From d32db0b09c7793c41ea8cc39c3b518203f0c374a Mon Sep 17 00:00:00 2001 From: Jelle Kok Date: Fri, 18 Dec 2015 13:28:15 +0100 Subject: [PATCH 3/3] Update code --- src/JoomlaBrowser.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/JoomlaBrowser.php b/src/JoomlaBrowser.php index 6082fe8..ee8983f 100644 --- a/src/JoomlaBrowser.php +++ b/src/JoomlaBrowser.php @@ -129,15 +129,14 @@ public function installJoomla() $this->debug('I wait for Main Configuration'); $I->waitForElement('#jform_language', 10); // Wait for chosen to render the field - $I->wait(1); $I->debug('I select dk-DK as installation language'); // Select a random language to force reloading of the lang strings after selecting English $I->selectOptionInChosen('#jform_language', 'Danish (DK)'); - $I->waitForText('Generel konfiguration', 20, 'h3'); + $I->waitForText('Generel konfiguration', 60, 'h3'); // Wait for chosen to render the field $I->debug('I select en-GB as installation language'); $I->selectOptionInChosen('#jform_language', 'English (United Kingdom)'); - $I->waitForText('Main Configuration', 20, 'h3'); + $I->waitForText('Main Configuration', 60, 'h3'); $this->debug('I fill Site Name'); $I->fillField(['id' => 'jform_site_name'], 'Joomla CMS test'); $this->debug('I fill Site Description'); @@ -156,7 +155,6 @@ public function installJoomla() $I->click(['xpath' => "//fieldset[@id='jform_site_offline']/label[@for='jform_site_offline1']"]); // ['No Site Offline'] $this->debug('I click Next'); $I->click(['link' => 'Next']); - $I->wait(1); $this->debug('I Fill the form for creating the Joomla site Database'); $I->waitForText('Database Configuration',60,['css' => 'h3']); @@ -192,7 +190,6 @@ public function installJoomla() //endif; $I->selectOption(['id' => 'jform_sample_file'], ['id' => 'jform_sample_file0']); // No sample data $I->click(['link' => 'Install']); - $I->wait(1); // Wait while Joomla gets installed $this->debug('I wait for Joomla being installed'); @@ -862,10 +859,11 @@ public function verifyAvailableTabs($expectedTabs, $tabsLocator = ['xpath' => "/ * * @note: doAdminLogin() before */ - public function disablestatistics() + public function disableStatistics() { $I = $this; $this->debug('I click on never'); + $I->waitForElement(['link' => 'Never'], 60); $I->click(['link' => 'Never']); } }