File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change 11<html >
22<body >
3+
34<div >
4- <button >The Button</button >
5+ <form action = " /form/button" method = " POST" id = " form-id" >
6+ <input type = " hidden" name = " text" value = " val" />
7+ <button type = " submit" name = " btn0" >Submit</button >
8+ </form >
9+ </div >
10+
11+ <div >
12+ <input type = " submit" form = " form-id" value = " Submit 2" />
513 </div >
614</body >
715</html >
Original file line number Diff line number Diff line change 11<?php
22
3+ use Codeception \Exception \TestRuntimeException ;
34use Codeception \Util \Stub ;
45
56require_once 'tests/data/app/data.php ' ;
@@ -604,9 +605,10 @@ public function testClickSelectsClickableElementFromMatchesUsingCssLocator()
604605
605606 public function testClickingOnButtonOutsideFormDoesNotCauseFatalError ()
606607 {
607- $ this ->expectException (AssertionFailedError::class);
608+ $ this ->expectException (TestRuntimeException::class);
609+ $ this ->expectExceptionMessage ('Button is not inside a link or a form ' );
608610 $ this ->module ->amOnPage ('/form/button-not-in-form ' );
609- $ this ->module ->click (' The Button ' );
611+ $ this ->module ->click ([ ' xpath ' => ' //input[@type="submit"][@form="form-id"] ' ] );
610612 }
611613
612614 public function testSubmitFormWithoutEmptyOptionsInSelect ()
You can’t perform that action at this time.
0 commit comments