/** * Check the contact page for templatefields * * @param \AcceptanceTester $I */ public function checkContactPageTest(\AcceptanceTester $I, \Codeception\Scenario $scenario) { $I->wantTo('see that the contact page and templatefields works'); $scenario->skip('Update Required'); $I->amOnPage('/contact'); $I->seeInSource('This is the contact text'); }
/** * @param \CliTester $I * @param \Codeception\Scenario $scenario */ public function testDocumentValidHtml(\CliTester $I, \Codeception\Scenario $scenario) { $I->wantTo('verify that the default template produces valid HTML'); if (!class_exists('Tidy')) { $scenario->skip('Tidy is not available. See http://php.net/manual/en/tidy.installation.php'); } $template = dirname(dirname(__DIR__)) . '/src/Task/CodeSniffer/codestyle.html'; $outfile = dirname(__DIR__) . '/_output/codestyle.html'; if (file_exists($outfile)) { unlink($outfile); } $I->dontSeeFileFound($outfile); $I->runShellCommand('vendor/bin/robo document:codestyle --outfile ' . $outfile . ' --template ' . $template); $I->seeFileFound($outfile); $tidy = new \Tidy(); $tidy->parseFile($outfile); $I->assertEquals(0, $tidy->getStatus()); unlink($outfile); }
/** * 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."); $scenario->skip('Update Required'); // 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('tester-events.bolt.yml', Locator::href('/bolt/file/edit/config/extensions/tester-events.bolt.yml')); $I->click('tester-events.bolt.yml', Locator::href('/bolt/file/edit/config/extensions/tester-events.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/tester-events.bolt.yml', ['form[_token]' => $token, 'form[contents]' => $twig]); $I->amOnPage('/bolt/file/edit/config/extensions/tester-events.bolt.yml'); $I->see("# Let's make this perfectly clear", 'textarea'); $I->see('theres_no_secrets_this_year: true', 'textarea'); }
protected function skipIfNoXdebug($I, \Codeception\Scenario $s) { if (!extension_loaded('xdebug')) { $s->skip("Xdebug not loaded"); } }
/** * ATTENTION 後続のテストが失敗するため、最後に実行する必要がある */ public function systeminfo_セキュリティ管理IP制限(\AcceptanceTester $I, \Codeception\Scenario $scenario) { $I->wantTo('EA0804-UC01-T03 セキュリティ管理 - IP制限'); $findPlugins = Fixtures::get('findPlugins'); $Plugins = $findPlugins(); if (is_array($Plugins) && count($Plugins) > 0) { $scenario->skip('プラグインのアンインストールが必要なため、テストをスキップします'); } // 表示 $config = Fixtures::get('config'); $I->amOnPage('/' . $config['admin_route'] . '/setting/system/security'); $I->see('システム設定セキュリティ管理', '#main .page-header'); $I->fillField(['id' => 'admin_security_admin_allow_host'], '1.1.1.1'); $I->click('#aside_column div div div div div button'); $I->amOnPage('/' . $config['admin_route']); $I->see('アクセスできません。', '#main .container-fluid h1'); $test_config = Fixtures::get('test_config'); $eccube = $test_config['eccube_path']; $configfile = $eccube . "/app/config/eccube/config.yml"; $lines = file($configfile); $fh = fopen($configfile, 'w'); foreach ($lines as $line) { if (preg_match('/1\\.1\\.1\\.1/', $line)) { continue; } fwrite($fh, $line); } fclose($fh); }
/** * Create a contact page with templatefields * * @param \AcceptanceTester $I */ public function checkTemplateFieldsTest(\AcceptanceTester $I, \Codeception\Scenario $scenario) { $I->wantTo('Create a contact page with templatefields'); $scenario->skip('Update Required'); // 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'); $I->see('New Page'); $I->click('New Page'); $I->fillField('#title', 'Contact Page'); $I->fillField('#slug', 'contact'); $I->selectOption('#template', 'extrafields.twig'); $I->click('Save Page', '#savecontinuebutton'); $I->see('The new Page has been saved.'); $I->click('CONTACT PAGE'); // Page has been saved, fill templatefields $I->see('Template', 'a[data-toggle=tab]'); $I->fillField('#templatefields-section_1', 'This is the contact text'); $I->click('Save Page'); $I->click('CONTACT PAGE'); /* * In v2.0.13 Codeception made the awesome decision to refactor their * PHP Browser code — in a patch release no less — and it doesn't * properly handle URL queries parameters in POSTs. For now we'll just * pretend that seeing the data is good enough… */ $I->seeInSource('This is the contact text'); // $I->seeInField('#templatefields-section_1', 'This is the contact text'); }
/** * Publish the 'Contact' page. * * @param \AcceptanceTester $I */ public function publishContactPageTest(\AcceptanceTester $I, \Codeception\Scenario $scenario) { $I->wantTo("Publish the 'Contact' page with 'templatefields' as 'manager' user"); $scenario->skip('Update Required'); // 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/editcontent/pages/3'); $I->seeInSource('This is the contact text'); $I->selectOption('#statusselect', 'published'); $I->click('Save', '#savecontinuebutton'); $I->see('The changes to the Page have been saved.'); }