Skip to content

Attributes improvements#6487

Merged
Naktibalda merged 8 commits into5.0from
prepare-attr-multiple-vals
Jun 30, 2022
Merged

Attributes improvements#6487
Naktibalda merged 8 commits into5.0from
prepare-attr-multiple-vals

Conversation

@DavertMik
Copy link
Member

@DavertMik DavertMik commented Jun 29, 2022

  • Added Prepare attribute
  • Added support for repeatable attributes (Group, Env)
  • Updated tests
// define groups in 1 attribute
#[Group('g1', 'g2')]

// or in multiple
#[Group('g1')]
#[Group('g2')]
  • Added support for Given/When/Then attributes (repeatable) for BDD:
<?php
namespace Tests\Support;

use Codeception\Attribute\Given;
use Codeception\Attribute\When;
use Codeception\Attribute\Then;

class AcceptanceTester extends \Codeception\Actor
{
    use _generated\AcceptanceTesterActions;

     #[Given('I have product with :num1 price in my cart')]
     public function iHaveProductWithPriceInMyCart($num1)
     {
        throw new \PHPUnit\Framework\IncompleteTestError("Step `I have product with :num1 price in my cart` is not defined");
     }

     #[When('I go to checkout process')]
     public function iGoToCheckoutProcess()
     {
        throw new \PHPUnit\Framework\IncompleteTestError("Step `I go to checkout process` is not defined");
     }

Corresponding changes were reflected in documentation):

Codeception/codeception.github.com#611

@Naktibalda Naktibalda merged commit 3084f48 into 5.0 Jun 30, 2022
@Naktibalda Naktibalda deleted the prepare-attr-multiple-vals branch June 30, 2022 15:02
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