protected function CartBrowserTestTrait::assertAttributeExists in Commerce Core 8.2
Asserts that an attribute option does exist.
Parameters
string $selector: The element selector.
string $option: The option.
3 calls to CartBrowserTestTrait::assertAttributeExists()
- AddToCartFormTest::testRenderedAttributeElement in modules/
cart/ tests/ src/ Functional/ AddToCartFormTest.php - Tests that the add to cart form renders an attribute entity.
- AddToCartMultiAttributeTest::testMultipleVariations in modules/
cart/ tests/ src/ FunctionalJavascript/ AddToCartMultiAttributeTest.php - Tests adding a product to the cart when there are multiple variations.
- AddToCartMultilingualTest::testProductVariationAttributesWidget in modules/
cart/ tests/ src/ FunctionalJavascript/ AddToCartMultilingualTest.php - Tests that the attribute widget uses translated items.
File
- modules/
cart/ tests/ src/ Traits/ CartBrowserTestTrait.php, line 52
Class
- CartBrowserTestTrait
- Defines a trait for commerce_cart functional tests.
Namespace
Drupal\Tests\commerce_cart\TraitsCode
protected function assertAttributeExists($selector, $option) {
$this
->assertSession()
->elementExists('xpath', '//select[@name="' . $selector . '"]//option[@value="' . $option . '"]');
}