Skip to content
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

Update to version 0.4.2: Introduced trait-based step definitions, upd… #2

Merged
merged 2 commits into from
Jan 20, 2025

Conversation

ivangrynenko
Copy link
Collaborator

@ivangrynenko ivangrynenko commented Jan 20, 2025

…ated dependencies, and enhanced installer functionality. Breaking changes require manual updates to existing projects' FeatureContext.php files. See README for migration instructions.

Checklist before requesting a review

  • I have formatted the subject to include ticket number as [#123] Verb in past tense with dot at the end.
  • I have added a link to the issue tracker
  • 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

Move to Trait-based Step Definitions

Changes

  • Introduces a new trait-based approach for managing Behat step definitions
  • Updates installer to handle trait injection instead of full FeatureContext.php replacement
  • Maintains backwards compatibility while encouraging trait usage
  • Updates documentation to reflect the new approach

Key Implementation Details

  • The installer now checks for and injects use ScaffoldTestingTrait; into existing FeatureContext files
  • Feature file copying remains unchanged
  • Added logic to handle missing FeatureContext.php scenarios
  • Updated documentation to explain trait usage and migration path

Breaking Changes

Projects upgrading to this version will need to:

  1. Remove old step definitions from their FeatureContext.php
  2. Add the ScaffoldTestingTrait to their FeatureContext class
  3. Ensure any custom step definitions are compatible with the trait

Migration Example

use Salsadigitalauorg\ScaffoldTesting\Traits\ScaffoldTestingTrait;

class FeatureContext implements Context
{
  use ScaffoldTestingTrait;
  // Custom step definitions can remain here
}

Testing

  • Tested trait injection into existing FeatureContext files
  • Verified compatibility with custom step definitions
  • Confirmed feature file installation still works as expected

Documentation

  • Updated README.md with new trait-based approach
  • Added migration instructions for existing projects
  • Included examples of combining custom steps with trait

Closes #[Issue Number]

Screenshots

…ated dependencies, and enhanced installer functionality. Breaking changes require manual updates to existing projects' FeatureContext.php files. See README for migration instructions.
… [scaffold-testing] and remove unused forum navigation methods. This improves clarity in logs and cleans up the trait for better maintainability.
@ivangrynenko ivangrynenko merged commit fe906eb into main Jan 20, 2025
2 checks passed
@ivangrynenko ivangrynenko deleted the feature/use-traits branch January 20, 2025 06:29
@steveworley
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants