diff --git a/tests/BrowserTests.php b/tests/BrowserTests.php index d7a52c8..8628559 100644 --- a/tests/BrowserTests.php +++ b/tests/BrowserTests.php @@ -434,6 +434,33 @@ public function select_field(): void ; } + /** + * @test + */ + public function can_submit_form_with_different_submit_buttons(): void + { + // Submit and Submit B, have the same field name but different values + // Submit C has a different field name (and value) + + $this->browser() + ->visit('/page1') + ->click('Submit') + ->assertOn('/submit-form') + ->assertContains('"submit_1":"a"') + ->assertNotContains('submit_2') + ->visit('/page1') + ->click('Submit B') + ->assertOn('/submit-form') + ->assertContains('"submit_1":"b"') + ->assertNotContains('submit_2') + ->visit('/page1') + ->click('Submit C') + ->assertOn('/submit-form') + ->assertContains('"submit_2":"c"') + ->assertNotContains('submit_1') + ; + } + /** * @test */ diff --git a/tests/Fixture/files/page1.html b/tests/Fixture/files/page1.html index 088c674..323fe9d 100644 --- a/tests/Fixture/files/page1.html +++ b/tests/Fixture/files/page1.html @@ -52,7 +52,9 @@