mercredi 1 avril 2020

Optimising the Behat Script

We have written a behat script to Verify taxonomy terms in the Site. It takes a really long time to run. I want to optimize the code. In the code, I am creating taxonomy terms and then verifying them. The creation of terms is done in Background. I am thinking of using the taxonomy terms present in the site. But I am not sure. Any help would be great.

 Background:
    Given "site_section" terms:
      | name              | field_color |
      | site-section-test | redbg       |
    Given "subject" terms:
      | name         |
      | subject-test |
    Given "topic" terms:
      | name       |
      | topic-test |
    Given "content_type_sub_type" terms:
      | name         |
      | subtype-test |
    Given "department" terms:
      | name            |
      | department-test |
    Given "public_role" terms:
      | name             |
      | public-role-test |
    Given "image_category" terms:
      | name                |
      | image-category-test |

  Scenario Outline: As a user(Content Admin/Site Admin),
  I should have the ability to Create, Edit, and Delete taxonomy terms in all vocabularies.

    Given I am logged in as a user with the "<user_role>" role
    And I visit "<vocab_listing_url>"
    Then I should see the link "Add term"
    When I click "Edit" in the "<term_name>" row
    Then I should see the link "Delete"
    Examples:
      | user_role             | vocab_listing_url                                               | term_name           |
      | content_administrator | /admin/structure/taxonomy/manage/topic/overview                 | topic-test          |
      | content_administrator | /admin/structure/taxonomy/manage/subject/overview               | subject-test        |
      | content_administrator | /admin/structure/taxonomy/manage/site_section/overview          | site-section-test   |
      | content_administrator | /admin/structure/taxonomy/manage/department/overview            | department-test     |
      | content_administrator | /admin/structure/taxonomy/manage/public_role/overview           | public-role-test    |
      | content_administrator | /admin/structure/taxonomy/manage/content_type_sub_type/overview | subtype-test        |
      | content_administrator | /admin/structure/taxonomy/manage/image_category/overview        | image-category-test |
      | site_admin            | /admin/structure/taxonomy/manage/topic/overview                 | topic-test          |
      | site_admin            | /admin/structure/taxonomy/manage/subject/overview               | subject-test        |
      | site_admin            | /admin/structure/taxonomy/manage/site_section/overview          | site-section-test   |
      | site_admin            | /admin/structure/taxonomy/manage/department/overview            | department-test     |
      | site_admin            | /admin/structure/taxonomy/manage/public_role/overview           | public-role-test    |
      | site_admin            | /admin/structure/taxonomy/manage/content_type_sub_type/overview | subtype-test        |
      | site_admin            | /admin/structure/taxonomy/manage/image_category/overview        | image-category-test |

Aucun commentaire:

Enregistrer un commentaire