jhedstrom / drupalextension

An integration layer between Behat, Mink Extension, and Drupal.
GNU General Public License v2.0
209 stars 192 forks source link

Allow creation of entities of any type with base field value parsing #661

Open chrisolof opened 4 months ago

chrisolof commented 4 months ago

Resolves #194.

This was built and tested in a D10 environment. Pairs really well with jhedstrom/DrupalDriver/pull/271.

Opens up stuff like this:

Given "commerce_product_variation" entities:
  | title | type     | field_manufacturer | sku      | field_category | price:number | price:currency_code | status |
  | TNT   | product  | ACME               | TNT-01   | Excavation     | 200          | USD                 | 1      |
  | Anvil | product  | ACME               | ANVIL-01 | Metal          | 450          | USD                 | 1      |
  And "commerce_product" entities:
    | title | type     | variations | stores         | status |
    | TNT   | product  | TNT        | ACME Web Store | 1      |
    | Anvil | product  | Anvil      | ACME Web Store | 1      |

Deletes the entities out after scenario in reverse order so as to respect dependent entity setups.

Otherwise pretty much follows the node/term/user creation and cleanup patterns. But now we can set up entities of any type.