8000 [#338] Added traits to create, configure blocks and block_content entities. by richardgaunt · Pull Request #337 · drevops/behat-steps · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[#338] Added traits to create, configure blocks and block_content entities. #337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Mar 24, 2025

Conversation

richardgaunt
Copy link
Collaborator
@richardgaunt richardgaunt commented Mar 23, 2025

Closes #338

Checklist before requesting a review

  • I have formatted the subject to include ticket number
    as [#134] Added tests for block and block_content traits.
  • I have provided information in Changed section about WHY something was
    done if this was not a normal implementation
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • I have run new and existing relevant tests locally with my changes, and
    they passed
  • I have provided screenshots, where applicable

Changed

  1. Created BlockTrait and BlockContent trait to support Block and BlockContent assertions
  2. Added feature test files to demonstrate and test BlockTrait and BlockContentTrait functionality
  3. Updated the README.md to include the newly available block-related steps
  4. Created CLAUDE.md with guidelines for writing feature files - TO REMOVE
  5. Added the traits to FeatureContext.php for testing

Summary of new steps

BlockTrait Steps

  1. Creation / Configuration Steps:
    - When I create a block of type :label with: - Create a new block instance of an existing block
    - When I configure the block with the label :label with: - Configure an existing block instance's settings (title, region, visibility)
    - When I configure a visibility condition :condition for the block with label :label - Add visibility restrictions to a block instance
    - When I remove the visibility condition :condition from the block with label :label - Remove visibility restrictions from a block instance
    - When I disable the block with label :label - Make a block instance inactive
    - When I enable the block with label :label - Make a block instance active
  2. Assertion Steps:
    - Then block with label :label should exist - assert a block exists
    - Then block with label :label should exist in the region :region - Assert a block is placed in a specific region
    - Then block with label :label should not exist in the region :region - Assert a block is not in a specific region
    - Then the block with label :label should have the visibility condition :condition - Assert visibility settings
    - Then the block with label :label should not have the visibility condition :condition - Assert absence of visibility restrictions
    - Then the block with label :label is disabled - Assert a block is inactive
    - Then the block with label :label is enabled - Assert a block is active

BlockContentTrait Steps

- Given block_content_type :type with description :description exists - Verify a block content type exists
- Given block_content :name of block_content_type :type exists - Verify a specific block content exists
- Given :type block_content: - Create block content entities with tabular data
- Given no :type block_content: - Remove specified block content entities
- When I edit :type block_content_type with description :info - Navigate to edit a block content

Potential changes

  1. Step names to fit upcoming step definition changes

richardgaunt and others added 3 commits March 16, 2025 20:26
This commit adds:
- Feature test files for BlockTrait and BlockContentTrait
- Updates to README.md to document available steps
- Improved docblocks in both trait files for better description of parameters and examples
- Added missing namespace to BlockContentTrait
- Fixed parameter types and descriptions in method documentation
- Created CLAUDE.md with guidelines for writing feature files
- Added the traits to FeatureContext.php for testing

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@richardgaunt richardgaunt changed the title Feature/add block trait Added block and block_content trait. Mar 23, 2025
@richardgaunt richardgaunt added the PR: Do not review Do not review this pull request label Mar 23, 2025
@richardgaunt richardgaunt changed the title Added block and block_content trait. [#338] Added traits to create, configure blocks and block_content entities. Mar 23, 2025
- Refined BlockContentTrait with consistent naming and better errors
- Renamed feature file for consistency
- Updated message selectors for Drupal 10

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
error_message_selector: '.messages.error'
success_message_selector: '.messages.status'
warning_message_selector: '.messages.warning'
error_message_selector: '.messages.messages--error'
Copy link
Collaborator Author
@richardgaunt richardgaunt Mar 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLAUDE.md Outdated
@@ -0,0 +1,112 @@
# DrevOps Behat Steps
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To remove - Claude instructions for reading and understanding project

@richardgaunt richardgaunt added PR: Needs review Pull request needs a review from assigned developers and removed PR: Do not review Do not review this pull request labels Mar 23, 2025
@richardgaunt
Copy link
Collaborator Author

https://app.circleci.com/pipelines/github/richardgaunt/behat-steps/25/workflows/428e40ac-3d7d-4478-a265-bd81363a7c11/jobs/50

Tests are passing but I think codecov seems to be making a bad request or maybe an access issue

Copy link
Member
@AlexSkrypnyk AlexSkrypnyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@richardgaunt
Thank you so much for this excellent contribution!

@AlexSkrypnyk AlexSkrypnyk enabled auto-merge (squash) March 24, 2025 09:19
@AlexSkrypnyk AlexSkrypnyk merged commit 5e3c9ad into drevops:main Mar 24, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Needs review Pull request needs a review from assigned developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add traits to create, configure blocks and block_content entities
2 participants
0