Imagine:

$this->drupalGet('user/register')
$this->assertQP('body.not-logged-in')->assertQP('h2')->assertTest('User account');

Linking QueryPath's syntax ease of use with SimpleTest's assertions.

Comments

boombatower’s picture

Status: Active » Postponed (maintainer needs more info)

Already supports xpath(). Since this is developed in Drupla 7 core and just backported here it would need to be done in a way that it was simply an addon/plugin that was optional.

So, not sure how that would be done, but QueryPath could also provide a test case that extends DrupalWebTestCase to provide this.

boombatower’s picture

Version: 6.x-2.x-dev » 7.x-2.x-dev

Open season, lets look into making this pluggable or something, although it may just be best to make a custom test case provided by your module.

boombatower’s picture

Project: SimpleTest » Drupal core
Version: 7.x-2.x-dev » 8.x-dev
Component: Code » simpletest.module
Status: Postponed (maintainer needs more info) » Active
pfrenssen’s picture

Status: Active » Closed (duplicate)

This is similar to #1959660: Replace xpath() with WebTestBase::cssSelect() by leveraging Symfony CssSelector. Marking this as a duplicate since that issue has working code and is based on \PHPUnit_Util_XML::cssSelect which is already in D8.