/** * @depends installJoomla */ public function installWeblinks(\AcceptanceTester $I) { $I->doAdministratorLogin(); $I->comment('get Weblinks repository folder from acceptance.suite.yml (see _support/AcceptanceHelper.php)'); $path = $I->getConfiguration('repo_folder'); $I->installExtensionFromFolder($path . 'src/com_weblinks/'); $I->doAdministratorLogout(); }
/** * @depends installJoomla */ public function installWeblinks(\AcceptanceTester $I) { $I->doAdministratorLogin(); $I->comment('get Weblinks repository folder from acceptance.suite.yml (see _support/AcceptanceHelper.php)'); // URL where the package file to install is located (mostly the same as joomla-cms) $url = $I->getConfiguration('url'); $I->installExtensionFromUrl($url . "/pkg-weblinks-current.zip"); $I->doAdministratorLogout(); }
/** * @depends installCmc */ public function initializeCmcSettings(\AcceptanceTester $I) { $I->doAdministratorLogin(); $I->comment('Mailchimp API Key from acceptance.suite.yml (see _support/AcceptanceHelper.php)'); $key = $I->getConfiguration('api_key'); $I->amGoingTo('Navigate to CMC page in /administrator/'); $I->amOnPage('administrator/index.php?option=com_cmc&view=cpanel'); // Wait for text dashboard - wait for text not working $I->waitForElementVisible('#ctitle'); $I->checkForPhpNoticesOrWarnings(); // Options $I->click('Options'); $I->waitForText('Configuration', '30', ['css' => 'h1']); $I->fillField(['id' => 'jform_api_key'], $key); $I->click('Save & Close'); // Basck in the dashboard $I->waitForElementVisible('#ctitle'); $I->doAdministratorLogout(); }
<?php /** * @package redCORE * @subpackage Cept * @copyright Copyright (C) 2008 - 2015 redCOMPONENT.com. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ // Load the Step Object Page $I = new \AcceptanceTester($scenario); $I->wantToTest('Activate the default webservices available in redCORE'); $I->doAdministratorLogin(); $I->comment('I enable basic authentication'); $I->amOnPage('administrator/index.php?option=com_plugins'); $I->waitForText('Plugins', 30, ['css' => 'H1']); $I->fillField(['id' => 'filter_search'], 'redcore - system plugin'); $I->click(['xpath' => "//div[@id='filter-bar']/div[2]/button"]); // search button $I->click(['link' => 'redCORE - System plugin']); $I->waitForText('Plugins: redCORE - System plugin', 30, ['css' => 'h1']); $I->click(['link' => 'Webservice options']); $I->selectOptionInRadioField('Enable webservices', 'Yes'); $I->selectOptionInRadioField('Enable SOAP Server', 'Yes'); $I->selectOptionInChosen('Check user permission against', 'Joomla - Use already defined authorization checks in Joomla'); $I->click(['xpath' => "//div[@id='toolbar-apply']/button"]); $I->waitForText('Plugin successfully saved.', 30, ['id' => 'system-message-container']); $I->amOnPage('administrator/index.php?option=com_redcore&view=webservices'); $I->waitForText('Webservice Manager', 30, ['css' => 'H1']); $I->click(['class' => 'lc-not_installed_webservices']); $I->click(['class' => 'lc-install_all_webservices']); $I->waitForElement(['id' => 'oauthClientsList'], 30);
function loginWrongEmail(AcceptanceTester $I, \Page\Login $loginPage) { $loginPage->login('*****@*****.**', '123456'); $I->see('Invalid login or password.', 'li.error-msg'); $I->comment('Expected result: Please enter a valid email address.'); }
function registerEmptySecondPass(AcceptanceTester $I, \Page\Registration $registerPage) { $registerPage->registerInvalid('alex', 'sereda', '*****@*****.**', '123456', ''); $I->see('This is a required field.', '#advice-required-entry-confirmation'); $I->comment('Expected result: This is a required second field.'); }
/** * Check Paymement * * Checks that passed method present at "payment list" page , * then checks the passed parameters and return his row, * or fail test if something wrong * * @param AcceptanceTester $I controller * @param string $name Name of Payment method * @param string $CurrencyName checks currency name if isset * @param string $CurrencySymbol checks currency symbol if isset * @param bool $active checks that method: true - active || false unactive if isset * @return int return row of passed payment */ protected function CheckInPaymentList(AcceptanceTester $I, $name, $CurrencyName = null, $CurrencySymbol = null, $active = null) { isset($name) ? $I->comment("I search method {$name} in list") : $I->fail("name of payment method must be passed"); $I->amOnPage(PaymentListPage::$URL); $I->waitForText("Список способов оплаты", NULL, ".title"); $present = false; $rows = $I->grabClassCount($I, 'niceCheck') - 1; if ($rows > 0) { for ($row = 1; $row <= $rows; ++$row) { $PaymentMethod = $I->grabTextFrom(PaymentListPage::MethodNameLine($row)); if ($PaymentMethod == $name) { $I->assertEquals($PaymentMethod, $name, "Method {$PaymentMethod} present in row {$row}"); $present = true; break; } } } else { $I->fail("Couldn't find {$name}, there are no created payments"); } if (!$present) { $I->fail("There is no payment {$name} in list"); } if (isset($CurrencyName)) { $grabbedCurrencyName = $I->grabTextFrom(PaymentListPage::CurrencyNameLine($row)); $I->assertEquals($grabbedCurrencyName, $CurrencyName); } if (isset($CurrencySymbol)) { $grabbedCurrencySymbol = $I->grabTextFrom(PaymentListPage::CurrencySymbolLine($row)); $I->assertEquals($grabbedCurrencySymbol, $CurrencySymbol); } if (isset($active)) { $grabbedActiveClass = $I->grabAttributeFrom(PaymentListPage::ActiveLine($row), 'class'); $active ? $I->assertEquals($grabbedActiveClass, 'prod-on_off ') : $I->assertEquals($grabbedActiveClass, 'prod-on_off disable_tovar'); } return $row; }
function loginInvalidEmail(AcceptanceTester $I, \Page\Login $loginPage) { $loginPage->loginInvalid('testemail.com', '123456'); $I->see('Please enter a valid email address. For example johndoe@domain.com.', '#advice-validate-email-email'); $I->comment('Expected result: Please enter a valid email address.'); }