/** * Test that a user with no access rights to Dashboard gets redirected to * the hmoepage. * * Inspired by the Atari game Lemmings and the Eddie Vedder commment: * "Longest song title in the Pearl Jam catalogue", referencing the song * "Elderly Woman Behind the Counter in a Small Town", and the name of the * particular unit test method until Bolt 2.3… * * @param \AcceptanceTester $I */ public function dashboardWithoutPermissionRedirectsToHomepageTest(\AcceptanceTester $I) { $I->wantTo('Set permissions/global/dashboard to empty and be redirected to the homepage'); // Set up the browser $I->setCookie($this->tokenNames['authtoken'], $this->cookies[$this->tokenNames['authtoken']]); $I->setCookie($this->tokenNames['session'], $this->cookies[$this->tokenNames['session']]); $I->amOnPage('/bolt/file/edit/config/permissions.yml'); $yaml = $I->getLemmingsPermissions(); $I->fillField('#form_contents', $yaml); $token = $I->grabValueFrom('#form__token'); $I->sendAjaxPostRequest('/bolt/file/edit/config/permissions.yml', ['form[_token]' => $token, 'form[contents]' => $yaml]); // Verify we go to the dashboard and end up on the homepage $I->amOnPage('/bolt'); $I->see('A sample site'); $I->see('Recent Pages'); $I->dontSee('Recent Resources'); $I->see('A Page I Made', 'h1'); $I->see('Built with Bolt, tested with Codeception', 'footer'); }
/** * Test that the 'developer' user can configure installed extensions. * * @param \AcceptanceTester $I */ public function configureInstalledExtensions(\AcceptanceTester $I, \Codeception\Scenario $scenario) { $I->wantTo("See that the 'developer' user can configure installed extensions."); // Set up the browser $I->setCookie($this->tokenNames['authtoken'], $this->cookies[$this->tokenNames['authtoken']]); $I->setCookie($this->tokenNames['session'], $this->cookies[$this->tokenNames['session']]); $I->amOnPage('/bolt/files/config/extensions'); $I->see('testerevents.bolt.yml', Locator::href('/bolt/file/edit/config/extensions/testerevents.bolt.yml')); $I->click('testerevents.bolt.yml', Locator::href('/bolt/file/edit/config/extensions/testerevents.bolt.yml')); $I->see('# Sit back and breathe', 'textarea'); $I->see('its_nice_to_know_you_work_alone: true', 'textarea'); // Edit the field $twig = $I->grabTextFrom('#form_contents', 'textarea'); $twig .= PHP_EOL . "# Let's make this perfectly clear"; $twig .= PHP_EOL . 'theres_no_secrets_this_year: true' . PHP_EOL; $I->fillField('#form_contents', $twig); $token = $I->grabValueFrom('#form__token'); $I->sendAjaxPostRequest('/bolt/file/edit/config/extensions/testerevents.bolt.yml', ['form[_token]' => $token, 'form[contents]' => $twig]); $I->amOnPage('/bolt/file/edit/config/extensions/testerevents.bolt.yml'); $I->see("# Let's make this perfectly clear", 'textarea'); $I->see('theres_no_secrets_this_year: true', 'textarea'); }
<?php //tests\acceptance\003_SimilarOrganizationName.php $I = new AcceptanceTester($scenario); $I->wantTo('Check similar organization name function'); $I->amOnPage('/register/staff'); $I->fillField("#staff_registration_organization_orgName", "Glenshire Maronite Fund"); $I->pressKey("#staff_registration_organization_orgName", ""); $I->waitForJS("return \$.active == 0;", 3); $I->see("Glenshire Marmot Fund"); $I->checkOption("#orgNotListed"); $I->waitForJS("return \$.active == 0;", 3); $I->dontSee("Glenshire Marmot Fund"); $orgName = $I->grabValueFrom("#staff_registration_organization_orgName"); $this->assertEquals($orgName, "Glenshire Maronite Fund");
public function systeminfo_ログ表示(\AcceptanceTester $I) { $I->wantTo('EA0806-UC01-T01 ログ表示'); // 表示 $config = Fixtures::get('config'); $I->amOnPage('/' . $config['admin_route'] . '/setting/system/log'); $I->see('システム設定EC-CUBE ログ表示', '#main .page-header'); $log = $I->grabValueFrom(['id' => 'admin_system_log_files']); $expect = "site_" . date('Y-m-d') . ".log"; $I->assertEquals($expect, $log); $I->fillField(['id' => 'line-max'], '1'); $I->click(['css' => '#form1 button']); $I->dontSeeElement(['css' => '#main .container-fluid .box table tbody tr:nth-child(2)']); }
/** * @depends deleteCategoryNoTickConfirmation */ public function deleteCategoryTickConfirmation(AcceptanceTester $I) { $I->logInAsAnAdmin(); $I->makeCategoryAvailable(CI_EDITABLE_CATEGORY_ID); $I->amOnEditCategory(CI_EDITABLE_CATEGORY_ID); $title = $I->grabValueFrom('title'); $I->amOnAdminHome(); $I->see($title); $I->amOnPage('/challenges'); $I->see($title); $I->amOnPage('/scores'); $I->see($title); $I->amOnEditCategory(CI_EDITABLE_CATEGORY_ID); $I->checkOption('#delete_confirmation'); $I->click('Delete category'); $I->amOnAdminHome(); $I->dontSee($title); $I->amOnPage('/challenges'); $I->dontSee($title); $I->amOnPage('/scores'); $I->dontSee($title); $I->amOnEditCategory(CI_EDITABLE_CATEGORY_ID); $I->see('Error'); $I->see('No category found with this ID'); }