WP Acceptance runs tests against a snapshot which is configured with the environment we want to test again. For many plugins, we'll actually want to test against multiple environments. For example, on the Distributor plugin where we are using WP Acceptance, we would like to test against WordPress 4.9 and 5.0, with or without the Gutenberg plugin enabled, with or without the Classic Editor plugin enabled. By testing against every environment, we can ensure changes made for one configuration don't break other configurations.
Desired Behavior
[x] wpacceptance.json should accept an array of snapshot ids (ideally a keyed array named for easy reference, eg { wp49: [SNAPSHOT_ID], WP50: [SNAPSHOT_ID] }
[x] wpacceptance run command should run all tests against all snapshots
[x] wpacceptance run command should include an option to run against a single snapshot (by name or id)
[x] the wpacceptance run --save flag should be snapshot specific, requiring passing a snapshot id or name when the config file contains more than one snapshot
[ ] possible follow up feature - enable support in test files to exclude certain tests from snapshots
Current Behavior
WP Acceptance only accepts a single snapshot id, making it difficult to to test against multiple configurations.
Summary
WP Acceptance runs tests against a snapshot which is configured with the environment we want to test again. For many plugins, we'll actually want to test against multiple environments. For example, on the Distributor plugin where we are using WP Acceptance, we would like to test against WordPress 4.9 and 5.0, with or without the Gutenberg plugin enabled, with or without the Classic Editor plugin enabled. By testing against every environment, we can ensure changes made for one configuration don't break other configurations.
Desired Behavior
wpacceptance.json
should accept an array of snapshot ids (ideally a keyed array named for easy reference, eg{ wp49: [SNAPSHOT_ID], WP50: [SNAPSHOT_ID] }
wpacceptance run
command should run all tests against all snapshotswpacceptance run
command should include an option to run against a single snapshot (by name or id)--save
flag should be snapshot specific, requiring passing a snapshot id or name when the config file contains more than one snapshotCurrent Behavior
WP Acceptance only accepts a single snapshot id, making it difficult to to test against multiple configurations.