<commit_before><?php
/**
 * @group slow
 * @group selenium
 * @group Vpc_FormDynamic
 *
 * http://vps.vps.niko.vivid/vps/vpctest/Vpc_FormDynamic_Basic_Root/form
 * http://vps.vps.niko.vivid/vps/vpctest/Vpc_FormDynamic_Basic_Root/form2
 */
class Vpc_FormDynamic_Basic_SeleniumTest extends Vps_Test_SeleniumTestCase
{
    public function setUp()
    {
        parent::setUp();
        Vps_Component_Data_Root::setComponentClass('Vpc_FormDynamic_Basic_Root');
    }

    public function testTextField()
    {
        //default value
        $this->openVpc('/form');
        $this->assertElementValueEquals('css=#form_root_form-paragraphs-4', 'Def');
        $this->clickAndWait('css=button');
        $this->assertElementValueEquals('css=#form_root_form-paragraphs-4', 'Def');

        //required
        $this->openVpc('/form');
        $this->assertElementPresent('css=#form_root_form-paragraphs-2');
        $this->assertElementNotPresent('css=.vpsFieldError #form_root_form-paragraphs-2');
        $this->clickAndWait('css=button');
        $this->assertTextPresent('Required: Please fill out');
        $this->assertElementPresent('css=.vpsFieldError #form_root_form-paragraphs-2');

        //vtype email
        $this->openVpc('/form');
        $this->type('css=#form_root_form-paragraphs-3', 'foo');
        $this->clickAndWait('css=button');
        $this->assertTextPresent('EMail: \'foo\' is not a valid');
        $this->assertElementPresent('css=.vpsFieldError #form_root_form-paragraphs-3');
    }

    public function testCheckbox()
    {
        //default value
        $this->openVpc('/form');
        $this->assertNotChecked('css=#form_root_form-paragraphs-5');
        $this->assertChecked('css=#form_root_form-paragraphs-6');
    }

    public function testFile()
    {
        //required
        $this->openVpc('/form2');
        $this->markTestIncomplete('file ist noch nicht fertig implementiert');
        $this->clickAndWait('css=button');
        $this->assertTextPresent('Required: Please fill out');
        $this->assertElementPresent('css=.vpsFieldError #form_root_form-paragraphs-8');
    }

    public function testAdmin()<commit_msg>test fix: dynamic forms upload<commit_after><?php
/**
 * @group slow
 * @group selenium
 * @group Vpc_FormDynamic
 *
 * http://vps.vps.niko.vivid/vps/vpctest/Vpc_FormDynamic_Basic_Root/form
 * http://vps.vps.niko.vivid/vps/vpctest/Vpc_FormDynamic_Basic_Root/form2
 */
class Vpc_FormDynamic_Basic_SeleniumTest extends Vps_Test_SeleniumTestCase
{
    public function setUp()
    {
        parent::setUp();
        Vps_Component_Data_Root::setComponentClass('Vpc_FormDynamic_Basic_Root');
    }

    public function testTextField()
    {
        //default value
        $this->openVpc('/form');
        $this->assertElementValueEquals('css=#form_root_form-paragraphs-4', 'Def');
        $this->clickAndWait('css=button');
        $this->assertElementValueEquals('css=#form_root_form-paragraphs-4', 'Def');

        //required
        $this->openVpc('/form');
        $this->assertElementPresent('css=#form_root_form-paragraphs-2');
        $this->assertElementNotPresent('css=.vpsFieldError #form_root_form-paragraphs-2');
        $this->clickAndWait('css=button');
        $this->assertTextPresent('Required: Please fill out');
        $this->assertElementPresent('css=.vpsFieldError #form_root_form-paragraphs-2');

        //vtype email
        $this->openVpc('/form');
        $this->type('css=#form_root_form-paragraphs-3', 'foo');
        $this->clickAndWait('css=button');
        $this->assertTextPresent('EMail: \'foo\' is not a valid');
        $this->assertElementPresent('css=.vpsFieldError #form_root_form-paragraphs-3');
    }

    public function testCheckbox()
    {
        //default value
        $this->openVpc('/form');
        $this->assertNotChecked('css=#form_root_form-paragraphs-5');
        $this->assertChecked('css=#form_root_form-paragraphs-6');
    }

    public function testFile()
    {
        //required
        $this->openVpc('/form2');
        $this->clickAndWait('css=button');
        $this->assertTextPresent('Required: Please fill out');
        $this->assertElementPresent('css=.vpsFieldError #form_root_form2-paragraphs-8');
    }

    public function testAdmin()
{'fraction_non_alphanumeric': 0.1545134818288394, 'fraction_numerical': 0.005861664712778429, 'mean_word_length': 3.40702479338843, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 48, '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': '1691', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1331, 'n_words': 165}