Skip to content

Commit 9a3fa44

Browse files
authored
Merge pull request #5553 from Codeception/issue/5547
InnerBrowser: selectOption can match by text when option has no value attribute
2 parents f9927f1 + 1e57f0b commit 9a3fa44

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

tests/data/app/view/form/bug5547.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<html>
2+
<body>
3+
<form action="/form/complex" method="POST">
4+
<select id="_payment_type" name="payment_type" required="" class="form-control">
5+
<option>За показы</option>
6+
<option>За размещение</option>
7+
<option>qwerty</option>
8+
</select>
9+
<input type="submit" value="Submit" />
10+
</form>
11+
</body>
12+
</html>

tests/unit/Codeception/Module/PhpBrowserTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,4 +720,16 @@ public function testIfStatusCodeIsWithin5xxRange()
720720
$this->module->amOnPage('https://httpstat.us/599');
721721
$this->module->seeResponseCodeIsServerError();
722722
}
723+
724+
/**
725+
* @issue https://github.com/Codeception/Codeception/issues/5547
726+
*/
727+
public function testSelectOptionByTextWhenItHasNoValue()
728+
{
729+
$this->module->amOnPage('/form/bug5547');
730+
$this->module->selectOption('#_payment_type', 'qwerty');
731+
$this->module->click('Submit');
732+
$form = data::get('form');
733+
$this->assertEquals('qwerty', $form['payment_type']);
734+
}
723735
}

0 commit comments

Comments
 (0)