AssertLegacyTrait::assertFieldById() is now deprecated (even though there is no @trigger_error() to alert developers) and will be removed from Drupal 9.0.0.

The replacements are
$this->assertSession()->fieldExists() API doc for fieldExists
$this->assertSession()->buttonExists() API doc or
$this->assertSession()->fieldValueEquals() API doc

Here is the API documentation for assertFieldById

Comments

jonathan1055 created an issue. See original summary.

jonathan1055’s picture

Issue summary: View changes

Added links to replacement functions documentation

peterlemmens’s picture

Here is a patch to replace AssertLegacyTrait::assertFieldById() with $this->assertSession()->fieldExists().

peterlemmens’s picture

Status: Active » Needs review
kristen pol’s picture

Issue tags: +Drupal 9 compatibility

Per a Slack discussion with Gábor Hojtsy regarding usage of D9 tags (Drupal 9, Drupal 9 compatibility, Drupal 9 readiness, etc.), "Drupal 9 compatibility" should be used for contributed projects that need updating and "Drupal 9" was the old tag for D8 issues before the D9 branch was ready. Doing tag cleanup here based on that discussion.

jonathan1055’s picture

Status: Needs review » Fixed

Thank you PeterLemmens. Committed and fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.