<commit_before><?php
/**
 * @group selenium
 * @group AutoForm
 */
class Vps_AutoForm_ErrorTest extends Vps_Test_SeleniumTestCase
{
    public function setUp()
    {
        parent::setUp();
        $this->setTimeout(120000);
    }

    public function testAutoFormAddDisplayErrorsFalse()
    {
        $this->_testAutoForm(false);
    }

    public function testAutoFormAddDisplayErrorsTrue()
    {
        $this->_testAutoForm(true);
    }

    private function _testAutoForm($errors) {

        $this->open('/vps/test/vps_auto-form_test/get-row-count');


        $count = $this->getText('//body');
        $this->assertEquals(1, $count);

        $this->open('/vps/test/vps_auto-form_test');
        $this->waitForConnections();
        $this->type("//input[@name='foo']", "newValue");

        if (!$errors) $this->runScript('function foo() {Vps.Debug.displayErrors = false; Vps.log("selenium: "+Vps.Debug.displayErrors); }; foo();');
        else {
            $this->runScript('function foo() {Vps.Debug.displayErrors = true; Vps.log("selenium: "+Vps.Debug.displayErrors); }; foo();');
        }<commit_msg>formattierung<commit_after><?php
/**
 * @group selenium
 * @group AutoForm
 */
class Vps_AutoForm_ErrorTest extends Vps_Test_SeleniumTestCase
{
    public function setUp()
    {
        parent::setUp();
        $this->setTimeout(120000);
    }

    public function testAutoFormAddDisplayErrorsFalse()
    {
        $this->_testAutoForm(false);
    }

    public function testAutoFormAddDisplayErrorsTrue()
    {
        $this->_testAutoForm(true);
    }

    private function _testAutoForm($errors) {

        $this->open('/vps/test/vps_auto-form_test/get-row-count');
        $count = $this->getText('//body');
        $this->assertEquals(1, $count);

        $this->open('/vps/test/vps_auto-form_test');
        $this->waitForConnections();
        $this->type("//input[@name='foo']", "newValue");

        if (!$errors) $this->runScript('function foo() {Vps.Debug.displayErrors = false; Vps.log("selenium: "+Vps.Debug.displayErrors); }; foo();');
        else {
            $this->runScript('function foo() {Vps.Debug.displayErrors = true; Vps.log("selenium: "+Vps.Debug.displayErrors); }; foo();');
        }
{'fraction_non_alphanumeric': 0.1725067385444744, 'fraction_numerical': 0.006289308176100629, 'mean_word_length': 3.0712979890310788, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5428451', 'n_tokens_mistral': 725, 'n_tokens_neox': 697, 'n_words': 102}