From 00c4eca93c717981d989ec11d782019b77d26a1e Mon Sep 17 00:00:00 2001 From: Nikita Sineok Date: Wed, 28 May 2025 16:48:30 +0300 Subject: [PATCH 1/6] #416: created the Delete Term step --- STEPS.md | 14 +++++++++++ src/Drupal/TaxonomyTrait.php | 25 ++++++++++++++++++++ tests/behat/features/drupal_taxonomy.feature | 8 +++++++ 3 files changed, 47 insertions(+) diff --git a/STEPS.md b/STEPS.md index 0be59ef..9a6fe56 100644 --- a/STEPS.md +++ b/STEPS.md @@ -2513,6 +2513,20 @@ When I edit the "fruits" vocabulary "Apple" term page +
+ @When I delete the :vocabulary_machine_name vocabulary :term_name term page + +
+Remove taxonomy term +

+ +```gherkin +When I delete the "tags" vocabulary "[TEST] Remove" term page + +``` + +
+
@Then the vocabulary :machine_name with the name :name should exist diff --git a/src/Drupal/TaxonomyTrait.php b/src/Drupal/TaxonomyTrait.php index 88513ac..3826226 100644 --- a/src/Drupal/TaxonomyTrait.php +++ b/src/Drupal/TaxonomyTrait.php @@ -242,4 +242,29 @@ protected function taxonomyLoadMultiple(string $vocabulary_machine_name, array $ return $query->execute(); } + /** + * Remove taxonomy term. + * + * @code + * When I delete the "tags" vocabulary "[TEST] Remove" term page + * @endcode + * + * @When I delete the :vocabulary_machine_name vocabulary :term_name term page + */ + public function taxonomyDeleteTerm(string $vocabulary_machine_name, string $term_name): void { + $terms = \Drupal::entityTypeManager() + ->getStorage('taxonomy_term') + ->loadByProperties([ + 'name' => $term_name, + 'vid' => $vocabulary_machine_name, + ]); + + $term = reset($terms); + + if (!$term) { + throw new \Exception("The term '$term_name' in vocabulary '$vocabulary_machine_name' was not found."); + } + $term->delete(); + } + } diff --git a/tests/behat/features/drupal_taxonomy.feature b/tests/behat/features/drupal_taxonomy.feature index f8f2fbc..db91064 100644 --- a/tests/behat/features/drupal_taxonomy.feature +++ b/tests/behat/features/drupal_taxonomy.feature @@ -222,3 +222,11 @@ Feature: Check that TaxonomyTrait works """ Unable to find the term "Nonexisting" in the vocabulary "tags". """ + + @api + Scenario: Assert "When I delete the :vocabulary_machine_name vocabulary :term_name term page" works + Given "tags" terms: + | name | + | [TEST] Remove | + When I delete the "tags" vocabulary "[TEST] Remove" term page + Then the taxonomy term "[TEST] Remove" from the vocabulary "tags" should not exist From c0439f8a52c3736f44d4d02158c4088108ccf44b Mon Sep 17 00:00:00 2001 From: Nikita Sineok Date: Wed, 28 May 2025 16:57:22 +0300 Subject: [PATCH 2/6] #416: negative assertion --- src/Drupal/TaxonomyTrait.php | 7 ++++- tests/behat/features/drupal_taxonomy.feature | 28 ++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/Drupal/TaxonomyTrait.php b/src/Drupal/TaxonomyTrait.php index 3826226..f8b2e77 100644 --- a/src/Drupal/TaxonomyTrait.php +++ b/src/Drupal/TaxonomyTrait.php @@ -252,6 +252,11 @@ protected function taxonomyLoadMultiple(string $vocabulary_machine_name, array $ * @When I delete the :vocabulary_machine_name vocabulary :term_name term page */ public function taxonomyDeleteTerm(string $vocabulary_machine_name, string $term_name): void { + $vocabulary = Vocabulary::load($vocabulary_machine_name); + if (!$vocabulary) { + throw new \RuntimeException(sprintf('The vocabulary "%s" does not exist.', $vocabulary_machine_name)); + } + $terms = \Drupal::entityTypeManager() ->getStorage('taxonomy_term') ->loadByProperties([ @@ -262,7 +267,7 @@ public function taxonomyDeleteTerm(string $vocabulary_machine_name, string $term $term = reset($terms); if (!$term) { - throw new \Exception("The term '$term_name' in vocabulary '$vocabulary_machine_name' was not found."); + throw new \Exception(sprintf('Unable to find the term "%s" in the vocabulary "%s".', $term_name, $vocabulary_machine_name)); } $term->delete(); } diff --git a/tests/behat/features/drupal_taxonomy.feature b/tests/behat/features/drupal_taxonomy.feature index db91064..c44ff7a 100644 --- a/tests/behat/features/drupal_taxonomy.feature +++ b/tests/behat/features/drupal_taxonomy.feature @@ -230,3 +230,31 @@ Feature: Check that TaxonomyTrait works | [TEST] Remove | When I delete the "tags" vocabulary "[TEST] Remove" term page Then the taxonomy term "[TEST] Remove" from the vocabulary "tags" should not exist + + @api @trait:Drupal\TaxonomyTrait + Scenario: Assert negative assertion for "When I delete the :vocabulary_machine_name vocabulary :term_name term page" fails with non-existing vocabulary + Given some behat configuration + And scenario steps: + """ + Given I am logged in as a user with the "administrator" role + When I delete the "nonexisting" vocabulary "Tag1" term page + """ + When I run "behat --no-colors" + Then it should fail with an exception: + """ + The vocabulary "nonexisting" does not exist. + """ + + @api @trait:Drupal\TaxonomyTrait + Scenario: Assert negative assertion for "When I delete the :vocabulary_machine_name vocabulary :term_name term page" fails with non-existing term + Given some behat configuration + And scenario steps: + """ + Given I am logged in as a user with the "administrator" role + When I delete the "tags" vocabulary "Nonexisting" term page + """ + When I run "behat --no-colors" + Then it should fail with an exception: + """ + Unable to find the term "Nonexisting" in the vocabulary "tags". + """ From 383e824bb2f35061c201e16e4e6449c82341f3f4 Mon Sep 17 00:00:00 2001 From: Nikita Sineok Date: Thu, 29 May 2025 12:21:57 +0300 Subject: [PATCH 3/6] #416: corrected Exception thowing --- src/Drupal/TaxonomyTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Drupal/TaxonomyTrait.php b/src/Drupal/TaxonomyTrait.php index f8b2e77..3773e92 100644 --- a/src/Drupal/TaxonomyTrait.php +++ b/src/Drupal/TaxonomyTrait.php @@ -267,7 +267,7 @@ public function taxonomyDeleteTerm(string $vocabulary_machine_name, string $term $term = reset($terms); if (!$term) { - throw new \Exception(sprintf('Unable to find the term "%s" in the vocabulary "%s".', $term_name, $vocabulary_machine_name)); + throw new \RuntimeException(sprintf('Unable to find the term "%s" in the vocabulary "%s".', $term_name, $vocabulary_machine_name)); } $term->delete(); } From 0220bb41f50458b3beafea23283a0adb8493e4ab Mon Sep 17 00:00:00 2001 From: Nikita Sineok Date: Thu, 29 May 2025 13:34:46 +0300 Subject: [PATCH 4/6] #416: alignined term selection logic with other methods --- src/Drupal/TaxonomyTrait.php | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/Drupal/TaxonomyTrait.php b/src/Drupal/TaxonomyTrait.php index 3773e92..64f4182 100644 --- a/src/Drupal/TaxonomyTrait.php +++ b/src/Drupal/TaxonomyTrait.php @@ -257,14 +257,20 @@ public function taxonomyDeleteTerm(string $vocabulary_machine_name, string $term throw new \RuntimeException(sprintf('The vocabulary "%s" does not exist.', $vocabulary_machine_name)); } - $terms = \Drupal::entityTypeManager() - ->getStorage('taxonomy_term') - ->loadByProperties([ - 'name' => $term_name, - 'vid' => $vocabulary_machine_name, - ]); + $tids = $this->taxonomyLoadMultiple($vocabulary_machine_name, [ + 'name' => $term_name, + ]); - $term = reset($terms); + if (empty($tids)) { + throw new \RuntimeException(sprintf('Unable to find the term "%s" in the vocabulary "%s".', $term_name, $vocabulary_machine_name)); + } + + // Use the term created last. + ksort($tids); + $tid = end($tids); + $term = \Drupal::entityTypeManager() + ->getStorage('taxonomy_term') + ->load($tid); if (!$term) { throw new \RuntimeException(sprintf('Unable to find the term "%s" in the vocabulary "%s".', $term_name, $vocabulary_machine_name)); From 5bd318a5e62f80897841c0fe5731d794f6f4d948 Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Sat, 31 May 2025 10:14:25 +1000 Subject: [PATCH 5/6] Updated step names. --- src/Drupal/TaxonomyTrait.php | 80 ++++++++++---------- tests/behat/features/drupal_taxonomy.feature | 43 ++++++----- 2 files changed, 61 insertions(+), 62 deletions(-) diff --git a/src/Drupal/TaxonomyTrait.php b/src/Drupal/TaxonomyTrait.php index 64f4182..0671227 100644 --- a/src/Drupal/TaxonomyTrait.php +++ b/src/Drupal/TaxonomyTrait.php @@ -156,10 +156,10 @@ public function taxonomyAssertTermNotExistsByName(string $term_name, string $voc * Visit specified vocabulary term page. * * @code - * When I visit the "fruits" vocabulary "Apple" term page + * When I visit the "fruits" term page with the name "Apple" * @endcode * - * @When I visit the :vocabulary_machine_name vocabulary :term_name term page + * @When I visit the :vocabulary_machine_name term page with the name :term_name */ public function taxonomyVisitTermPageWithName(string $vocabulary_machine_name, string $term_name): void { $vocab = Vocabulary::load($vocabulary_machine_name); @@ -186,15 +186,15 @@ public function taxonomyVisitTermPageWithName(string $vocabulary_machine_name, s } /** - * Edit specified vocabulary term page. + * Visit specified vocabulary term edit page. * * @code - * When I edit the "fruits" vocabulary "Apple" term page + * When I visit the "fruits" term edit page with the name "Apple" * @endcode * - * @When I edit the :vocabulary_machine_name vocabulary :term_name term page + * @When I visit the :vocabulary_machine_name term edit page with the name :term_name */ - public function taxonomyEditTermPageWithName(string $vocabulary_machine_name, string $term_name): void { + public function taxonomyVisitTermEditPageWithName(string $vocabulary_machine_name, string $term_name): void { $vocab = Vocabulary::load($vocabulary_machine_name); if (!$vocab) { @@ -217,6 +217,38 @@ public function taxonomyEditTermPageWithName(string $vocabulary_machine_name, st $this->getSession()->visit($path); } + /** + * Visit specified vocabulary term delete page. + * + * @code + * When I visit the "tags" term delete page with the name "[TEST] Remove" + * @endcode + * + * @When I visit the :vocabulary_machine_name term delete page with the name :term_name + */ + public function taxonomyVisitTermDeletePageWithName(string $vocabulary_machine_name, string $term_name): void { + $vocab = Vocabulary::load($vocabulary_machine_name); + + if (!$vocab) { + throw new \RuntimeException(sprintf('The vocabulary "%s" does not exist.', $vocabulary_machine_name)); + } + + $tids = $this->taxonomyLoadMultiple($vocabulary_machine_name, [ + 'name' => $term_name, + ]); + + if (empty($tids)) { + throw new \RuntimeException(sprintf('Unable to find the term "%s" in the vocabulary "%s".', $term_name, $vocabulary_machine_name)); + } + + ksort($tids); + $tid = end($tids); + + $path = $this->locatePath('/taxonomy/term/' . $tid . '/delete'); + + $this->getSession()->visit($path); + } + /** * Load multiple terms with specified vocabulary and conditions. * @@ -242,40 +274,4 @@ protected function taxonomyLoadMultiple(string $vocabulary_machine_name, array $ return $query->execute(); } - /** - * Remove taxonomy term. - * - * @code - * When I delete the "tags" vocabulary "[TEST] Remove" term page - * @endcode - * - * @When I delete the :vocabulary_machine_name vocabulary :term_name term page - */ - public function taxonomyDeleteTerm(string $vocabulary_machine_name, string $term_name): void { - $vocabulary = Vocabulary::load($vocabulary_machine_name); - if (!$vocabulary) { - throw new \RuntimeException(sprintf('The vocabulary "%s" does not exist.', $vocabulary_machine_name)); - } - - $tids = $this->taxonomyLoadMultiple($vocabulary_machine_name, [ - 'name' => $term_name, - ]); - - if (empty($tids)) { - throw new \RuntimeException(sprintf('Unable to find the term "%s" in the vocabulary "%s".', $term_name, $vocabulary_machine_name)); - } - - // Use the term created last. - ksort($tids); - $tid = end($tids); - $term = \Drupal::entityTypeManager() - ->getStorage('taxonomy_term') - ->load($tid); - - if (!$term) { - throw new \RuntimeException(sprintf('Unable to find the term "%s" in the vocabulary "%s".', $term_name, $vocabulary_machine_name)); - } - $term->delete(); - } - } diff --git a/tests/behat/features/drupal_taxonomy.feature b/tests/behat/features/drupal_taxonomy.feature index c44ff7a..5245f3a 100644 --- a/tests/behat/features/drupal_taxonomy.feature +++ b/tests/behat/features/drupal_taxonomy.feature @@ -154,19 +154,19 @@ Feature: Check that TaxonomyTrait works """ @api - Scenario: Assert "When I visit the :vocabulary_machine_name vocabulary :term_name term page" works + Scenario: Assert "When I visit the :vocabulary_machine_name term page with the name :term_name" works Given I am logged in as a user with the "administrator" role - When I visit the "tags" vocabulary "Tag1" term page + When I visit the "tags" term page with the name "Tag1" Then the response should contain "200" And I should see "Tag1" @api @trait:Drupal\TaxonomyTrait - Scenario: Assert negative assertion for "When I visit the :vocabulary_machine_name vocabulary :term_name term page" fails with non-existing vocabulary + Scenario: Assert negative assertion for "When I visit the :vocabulary_machine_name term page with the name :term_name" fails with non-existing vocabulary Given some behat configuration And scenario steps: """ Given I am logged in as a user with the "administrator" role - When I visit the "nonexisting" vocabulary "Tag1" term page + When I visit the "nonexisting" term page with the name "Tag1" """ When I run "behat --no-colors" Then it should fail with an exception: @@ -175,12 +175,12 @@ Feature: Check that TaxonomyTrait works """ @api @trait:Drupal\TaxonomyTrait - Scenario: Assert negative assertion for "When I visit the :vocabulary_machine_name vocabulary :term_name term page" fails with non-existing term + Scenario: Assert negative assertion for "When I visit the :vocabulary_machine_name term page with the name :term_name" fails with non-existing term Given some behat configuration And scenario steps: """ Given I am logged in as a user with the "administrator" role - When I visit the "tags" vocabulary "Nonexisting" term page + When I visit the "tags" term page with the name "Nonexisting" """ When I run "behat --no-colors" Then it should fail with an exception: @@ -189,19 +189,19 @@ Feature: Check that TaxonomyTrait works """ @api - Scenario: Assert "When I edit the :vocabulary_machine_name vocabulary :term_name term page" works + Scenario: Assert "When I visit the :vocabulary_machine_name term edit page with the name :term_name" works Given I am logged in as a user with the "administrator" role - When I edit the "tags" vocabulary "Tag1" term page + When I visit the "tags" term edit page with the name "Tag1" Then the response should contain "200" And I should see "Tag1" @api @trait:Drupal\TaxonomyTrait - Scenario: Assert negative assertion for "When I edit the :vocabulary_machine_name vocabulary :term_name term page" fails with non-existing vocabulary + Scenario: Assert negative assertion for "When I visit the :vocabulary_machine_name term edit page with the name :term_name" fails with non-existing vocabulary Given some behat configuration And scenario steps: """ Given I am logged in as a user with the "administrator" role - When I edit the "nonexisting" vocabulary "Tag1" term page + When I visit the "nonexisting" term edit page with the name "Tag1" """ When I run "behat --no-colors" Then it should fail with an exception: @@ -210,12 +210,12 @@ Feature: Check that TaxonomyTrait works """ @api @trait:Drupal\TaxonomyTrait - Scenario: Assert negative assertion for "When I edit the :vocabulary_machine_name vocabulary :term_name term page" fails with non-existing term + Scenario: Assert negative assertion for "When I visit the :vocabulary_machine_name term edit page with the name :term_name" fails with non-existing term Given some behat configuration And scenario steps: """ Given I am logged in as a user with the "administrator" role - When I edit the "tags" vocabulary "Nonexisting" term page + When I visit the "tags" term edit page with the name "Nonexisting" """ When I run "behat --no-colors" Then it should fail with an exception: @@ -224,20 +224,23 @@ Feature: Check that TaxonomyTrait works """ @api - Scenario: Assert "When I delete the :vocabulary_machine_name vocabulary :term_name term page" works - Given "tags" terms: + Scenario: Assert "When I visit the :vocabulary_machine_name term delete page with the name :term_name" works + Given I am logged in as a user with the "administrator" role + And "tags" terms: | name | | [TEST] Remove | - When I delete the "tags" vocabulary "[TEST] Remove" term page - Then the taxonomy term "[TEST] Remove" from the vocabulary "tags" should not exist + When I visit the "tags" term delete page with the name "[TEST] Remove" + Then the response should contain "200" + And I should see "Are you sure you want to delete" + And I should see "[TEST] Remove" @api @trait:Drupal\TaxonomyTrait - Scenario: Assert negative assertion for "When I delete the :vocabulary_machine_name vocabulary :term_name term page" fails with non-existing vocabulary + Scenario: Assert negative assertion for "When I visit the :vocabulary_machine_name term delete page with the name :term_name" fails with non-existing vocabulary Given some behat configuration And scenario steps: """ Given I am logged in as a user with the "administrator" role - When I delete the "nonexisting" vocabulary "Tag1" term page + When I visit the "nonexisting" term delete page with the name "Tag1" """ When I run "behat --no-colors" Then it should fail with an exception: @@ -246,12 +249,12 @@ Feature: Check that TaxonomyTrait works """ @api @trait:Drupal\TaxonomyTrait - Scenario: Assert negative assertion for "When I delete the :vocabulary_machine_name vocabulary :term_name term page" fails with non-existing term + Scenario: Assert negative assertion for "When I visit the :vocabulary_machine_name term delete page with the name :term_name" fails with non-existing term Given some behat configuration And scenario steps: """ Given I am logged in as a user with the "administrator" role - When I delete the "tags" vocabulary "Nonexisting" term page + When I visit the "tags" term delete page with the name "Nonexisting" """ When I run "behat --no-colors" Then it should fail with an exception: From 4317b7999f7714dbfcb06bb82c068ec3bd11333c Mon Sep 17 00:00:00 2001 From: Alex Skrypnyk Date: Sat, 31 May 2025 10:41:08 +1000 Subject: [PATCH 6/6] Reafactored steps to use a central router. --- STEPS.md | 16 +++--- src/Drupal/TaxonomyTrait.php | 59 ++++++-------------- tests/behat/features/drupal_taxonomy.feature | 9 +-- 3 files changed, 28 insertions(+), 56 deletions(-) diff --git a/STEPS.md b/STEPS.md index 9a6fe56..4203449 100644 --- a/STEPS.md +++ b/STEPS.md @@ -2486,42 +2486,42 @@ Given the following "fruits" vocabulary terms do not exist:
- @When I visit the :vocabulary_machine_name vocabulary :term_name term page + @When I visit the :vocabulary_machine_name term page with the name :term_name
Visit specified vocabulary term page

```gherkin -When I visit the "fruits" vocabulary "Apple" term page +When I visit the "fruits" term page with the name "Apple" ```
- @When I edit the :vocabulary_machine_name vocabulary :term_name term page + @When I visit the :vocabulary_machine_name term edit page with the name :term_name
-Edit specified vocabulary term page +Visit specified vocabulary term edit page

```gherkin -When I edit the "fruits" vocabulary "Apple" term page +When I visit the "fruits" term edit page with the name "Apple" ```
- @When I delete the :vocabulary_machine_name vocabulary :term_name term page + @When I visit the :vocabulary_machine_name term delete page with the name :term_name
-Remove taxonomy term +Visit specified vocabulary term delete page

```gherkin -When I delete the "tags" vocabulary "[TEST] Remove" term page +When I visit the "tags" term delete page with the name "[TEST] Remove" ``` diff --git a/src/Drupal/TaxonomyTrait.php b/src/Drupal/TaxonomyTrait.php index 0671227..0dc4c6a 100644 --- a/src/Drupal/TaxonomyTrait.php +++ b/src/Drupal/TaxonomyTrait.php @@ -162,27 +162,7 @@ public function taxonomyAssertTermNotExistsByName(string $term_name, string $voc * @When I visit the :vocabulary_machine_name term page with the name :term_name */ public function taxonomyVisitTermPageWithName(string $vocabulary_machine_name, string $term_name): void { - $vocab = Vocabulary::load($vocabulary_machine_name); - - if (!$vocab) { - throw new \RuntimeException(sprintf('The vocabulary "%s" does not exist.', $vocabulary_machine_name)); - } - - $tids = $this->taxonomyLoadMultiple($vocabulary_machine_name, [ - 'name' => $term_name, - ]); - - if (empty($tids)) { - throw new \RuntimeException(sprintf('Unable to find the term "%s" in the vocabulary "%s".', $term_name, $vocabulary_machine_name)); - } - - // Use the term created last. - ksort($tids); - $tid = end($tids); - - $path = $this->locatePath('/taxonomy/term/' . $tid); - - $this->getSession()->visit($path); + $this->taxonomyVisitActionPageWithName($vocabulary_machine_name, $term_name); } /** @@ -195,26 +175,7 @@ public function taxonomyVisitTermPageWithName(string $vocabulary_machine_name, s * @When I visit the :vocabulary_machine_name term edit page with the name :term_name */ public function taxonomyVisitTermEditPageWithName(string $vocabulary_machine_name, string $term_name): void { - $vocab = Vocabulary::load($vocabulary_machine_name); - - if (!$vocab) { - throw new \RuntimeException(sprintf('The vocabulary "%s" does not exist.', $vocabulary_machine_name)); - } - - $tids = $this->taxonomyLoadMultiple($vocabulary_machine_name, [ - 'name' => $term_name, - ]); - - if (empty($tids)) { - throw new \RuntimeException(sprintf('Unable to find the term "%s" in the vocabulary "%s".', $term_name, $vocabulary_machine_name)); - } - - ksort($tids); - $tid = end($tids); - - $path = $this->locatePath('/taxonomy/term/' . $tid . '/edit'); - - $this->getSession()->visit($path); + $this->taxonomyVisitActionPageWithName($vocabulary_machine_name, $term_name, '/edit'); } /** @@ -227,6 +188,20 @@ public function taxonomyVisitTermEditPageWithName(string $vocabulary_machine_nam * @When I visit the :vocabulary_machine_name term delete page with the name :term_name */ public function taxonomyVisitTermDeletePageWithName(string $vocabulary_machine_name, string $term_name): void { + $this->taxonomyVisitActionPageWithName($vocabulary_machine_name, $term_name, '/delete'); + } + + /** + * Visit the action page of the term with a specified name. + * + * @param string $vocabulary_machine_name + * The term vocabulary machine name. + * @param string $term_name + * The name of the term. + * @param string $action_subpath + * The operation to perform, e.g., '/delete', '/edit', etc. + */ + protected function taxonomyVisitActionPageWithName(string $vocabulary_machine_name, string $term_name, string $action_subpath = ''): void { $vocab = Vocabulary::load($vocabulary_machine_name); if (!$vocab) { @@ -244,7 +219,7 @@ public function taxonomyVisitTermDeletePageWithName(string $vocabulary_machine_n ksort($tids); $tid = end($tids); - $path = $this->locatePath('/taxonomy/term/' . $tid . '/delete'); + $path = $this->locatePath('/taxonomy/term/' . $tid . $action_subpath); $this->getSession()->visit($path); } diff --git a/tests/behat/features/drupal_taxonomy.feature b/tests/behat/features/drupal_taxonomy.feature index 5245f3a..0eddb19 100644 --- a/tests/behat/features/drupal_taxonomy.feature +++ b/tests/behat/features/drupal_taxonomy.feature @@ -1,3 +1,4 @@ +@taxonomy Feature: Check that TaxonomyTrait works As Behat Steps library developer I want to provide tools to manage taxonomy terms programmatically @@ -226,13 +227,9 @@ Feature: Check that TaxonomyTrait works @api Scenario: Assert "When I visit the :vocabulary_machine_name term delete page with the name :term_name" works Given I am logged in as a user with the "administrator" role - And "tags" terms: - | name | - | [TEST] Remove | - When I visit the "tags" term delete page with the name "[TEST] Remove" + When I visit the "tags" term delete page with the name "Tag1" Then the response should contain "200" - And I should see "Are you sure you want to delete" - And I should see "[TEST] Remove" + And I should see "Tag1" @api @trait:Drupal\TaxonomyTrait Scenario: Assert negative assertion for "When I visit the :vocabulary_machine_name term delete page with the name :term_name" fails with non-existing vocabulary