diff -u b/core/modules/user/tests/src/Functional/UserEditTest.php b/core/modules/user/tests/src/Functional/UserEditTest.php --- b/core/modules/user/tests/src/Functional/UserEditTest.php +++ b/core/modules/user/tests/src/Functional/UserEditTest.php @@ -142,14 +142,14 @@ $config->set('password_strength', TRUE)->save(); $this->drupalGet("user/" . $admin_user->id() . "/edit"); - $this->assertRaw(t('Password strength:'), 'The password strength indicator is displayed.'); - $this->assertFieldByXPath('//input[@type="password"][@name="pass"]', NULL, 'The password field is displayed as masked.'); + $this->assertSession()->responseContains(t('Password strength:'), 'The password strength indicator is displayed.'); + $this->assertSession()->elementExists('xpath', '//input[@type="password"][@name="pass"]'); $edit = []; $edit['pass'] = $this->randomMachineName(); $edit['current_pass'] = $admin_user->pass_raw; - $this->drupalPostForm("user/" . $admin_user->id() . "/edit", $edit, t('Save')); - $this->assertRaw(t("The changes have been saved.")); + $this->submitForm($edit, t('Save')); + $this->assertSession()->responseContains(t("The changes have been saved.")); } /**