fieldValueEquals fails on textarea with goutte driver
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.6k
- Forks
- 286
- PR merge metrics
- No merged PRs in 30d
Description
Assuming you have HTML with textarea containing a value:
<textarea id="comment" class="form-control" rows="3">Very well done with a few typos</textarea>
And you run the following in the step:
$this->assertSession()->fieldValueEquals('comment', $comment);
It would fail with Goutte driver as the value is null. This would work fine with Selenium driver. In my opinion it should work in both cases as you're not using any JS and the markup is correct.
Bellow is the dumps of the following lines:
$commentField = $this->assertSession()->elementExists('css', '#comment');
var_dump($commentField->getText());
var_dump($commentField->getValue());
# with goutte driver
/home/vagrant/peerfeedback/features/bootstrap/StudentFeedbackContext.php:89:
string(31) "Very well done with a few typos"
/home/vagrant/peerfeedback/features/bootstrap/StudentFeedbackContext.php:90:
NULL
# with selenium driver
/home/vagrant/peerfeedback/features/bootstrap/StudentFeedbackContext.php:89:
string(31) "Very well done with a few typos"
/home/vagrant/peerfeedback/features/bootstrap/StudentFeedbackContext.php:90:
string(31) "Very well done with a few typos"
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing assertSession()->fieldValueEquals() and the element getValue() behavior for textarea elements under the Goutte driver, then compare it with the Selenium driver behavior shown in the report. Confirm the existing behavior with a focused test using the supplied textarea markup; done means the field value is returned consistently for both drivers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100