From 61df5af0b3b758a1a08e8bb6c4e5bf1a4ea61409 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 2 Nov 2026 04:03:26 +0100 Subject: [PATCH 1/2] Run setup commands in a single process in tests Co-Authored-By: Claude Opus 5.5 --- features/import.feature | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/features/import.feature b/features/import.feature index a18082d2..890887fa 100644 --- a/features/import.feature +++ b/features/import.feature @@ -157,9 +157,11 @@ Feature: Import content. And I run `mkdir export` # NOTE: The Hello World page ID is 2. - When I run `wp menu create "My Menu"` - And I run `wp menu item add-post my-menu 2` - And I run `wp menu item list my-menu --format=count` + Given these setup commands: + | command | + | wp menu create "My Menu" | + | wp menu item add-post my-menu 2 | + When I run `wp menu item list my-menu --format=count` Then STDOUT should be: """ 1 @@ -234,9 +236,11 @@ Feature: Import content. And I run `mkdir export` # NOTE: The Hello World page ID is 2. - When I run `wp menu create "My Menu"` - And I run `wp menu item add-post my-menu 2` - And I run `wp menu item list my-menu --format=count` + Given these setup commands: + | command | + | wp menu create "My Menu" | + | wp menu item add-post my-menu 2 | + When I run `wp menu item list my-menu --format=count` Then STDOUT should be: """ 1 From e6596a3982eb2d28d9bf7969b25307658f9f896b Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Mon, 2 Nov 2026 04:10:10 +0100 Subject: [PATCH 2/2] Use And for setup commands following other steps Co-Authored-By: Claude Opus 5.5 --- features/import.feature | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/features/import.feature b/features/import.feature index 890887fa..a585457b 100644 --- a/features/import.feature +++ b/features/import.feature @@ -157,7 +157,7 @@ Feature: Import content. And I run `mkdir export` # NOTE: The Hello World page ID is 2. - Given these setup commands: + And these setup commands: | command | | wp menu create "My Menu" | | wp menu item add-post my-menu 2 | @@ -236,7 +236,7 @@ Feature: Import content. And I run `mkdir export` # NOTE: The Hello World page ID is 2. - Given these setup commands: + And these setup commands: | command | | wp menu create "My Menu" | | wp menu item add-post my-menu 2 |