diff --git a/src/stubs/test-feature-simple.stub b/src/stubs/test-feature-simple.stub index a7aa55f..35eb75c 100644 --- a/src/stubs/test-feature-simple.stub +++ b/src/stubs/test-feature-simple.stub @@ -31,9 +31,10 @@ class ManageMastersTest extends TestCase $this->click(trans('master.create')); $this->seePageIs(route('masters.index', ['action' => 'create'])); - $this->type('Master 1 name', 'name'); - $this->type('Master 1 description', 'description'); - $this->press(trans('master.create')); + $this->submitForm(trans('master.create'), [ + 'name' => 'Master 1 name', + 'description' => 'Master 1 description', + ]); $this->seePageIs(route('masters.index')); @@ -53,9 +54,10 @@ class ManageMastersTest extends TestCase $this->click('edit-master-'.$singleMstr->id); $this->seePageIs(route('masters.index', ['action' => 'edit', 'id' => $singleMstr->id, 'q' => '123'])); - $this->type('Master 1 name', 'name'); - $this->type('Master 1 description', 'description'); - $this->press(trans('master.update')); + $this->submitForm(trans('master.update'), [ + 'name' => 'Master 1 name', + 'description' => 'Master 1 description', + ]); $this->seePageIs(route('masters.index', ['q' => '123'])); diff --git a/tests/Generators/Simple/FeatureTestGeneratorTest.php b/tests/Generators/Simple/FeatureTestGeneratorTest.php index 666c08b..2816484 100644 --- a/tests/Generators/Simple/FeatureTestGeneratorTest.php +++ b/tests/Generators/Simple/FeatureTestGeneratorTest.php @@ -82,9 +82,10 @@ class Manage{$this->plural_model_name}Test extends TestCase \$this->click(trans('{$this->lang_name}.create')); \$this->seePageIs(route('{$this->table_name}.index', ['action' => 'create'])); - \$this->type('{$this->model_name} 1 name', 'name'); - \$this->type('{$this->model_name} 1 description', 'description'); - \$this->press(trans('{$this->lang_name}.create')); + \$this->submitForm(trans('{$this->lang_name}.create'), [ + 'name' => '{$this->model_name} 1 name', + 'description' => '{$this->model_name} 1 description', + ]); \$this->seePageIs(route('{$this->table_name}.index')); @@ -104,9 +105,10 @@ class Manage{$this->plural_model_name}Test extends TestCase \$this->click('edit-{$this->lang_name}-'.\${$this->single_model_var_name}->id); \$this->seePageIs(route('{$this->table_name}.index', ['action' => 'edit', 'id' => \${$this->single_model_var_name}->id, 'q' => '123'])); - \$this->type('{$this->model_name} 1 name', 'name'); - \$this->type('{$this->model_name} 1 description', 'description'); - \$this->press(trans('{$this->lang_name}.update')); + \$this->submitForm(trans('{$this->lang_name}.update'), [ + 'name' => '{$this->model_name} 1 name', + 'description' => '{$this->model_name} 1 description', + ]); \$this->seePageIs(route('{$this->table_name}.index', ['q' => '123'])); @@ -226,9 +228,10 @@ class Manage{$this->plural_model_name}Test extends TestCase \$this->click(trans('{$this->lang_name}.create')); \$this->seePageIs(route('{$this->table_name}.index', ['action' => 'create'])); - \$this->type('{$this->model_name} 1 name', 'name'); - \$this->type('{$this->model_name} 1 description', 'description'); - \$this->press(trans('{$this->lang_name}.create')); + \$this->submitForm(trans('{$this->lang_name}.create'), [ + 'name' => '{$this->model_name} 1 name', + 'description' => '{$this->model_name} 1 description', + ]); \$this->seePageIs(route('{$this->table_name}.index')); @@ -248,9 +251,10 @@ class Manage{$this->plural_model_name}Test extends TestCase \$this->click('edit-{$this->lang_name}-'.\${$this->single_model_var_name}->id); \$this->seePageIs(route('{$this->table_name}.index', ['action' => 'edit', 'id' => \${$this->single_model_var_name}->id, 'q' => '123'])); - \$this->type('{$this->model_name} 1 name', 'name'); - \$this->type('{$this->model_name} 1 description', 'description'); - \$this->press(trans('{$this->lang_name}.update')); + \$this->submitForm(trans('{$this->lang_name}.update'), [ + 'name' => '{$this->model_name} 1 name', + 'description' => '{$this->model_name} 1 description', + ]); \$this->seePageIs(route('{$this->table_name}.index', ['q' => '123']));