@@ -467,7 +467,6 @@ For example, you might need some tests to be executed in Firefox only, and some
467
467
The desired environments can be specified with the `@env` annotation for tests in Test and Cest formats:
468
468
469
469
{% highlight php %}
470
-
471
470
<? php
472
471
class UserCest
473
472
{
@@ -482,17 +481,6 @@ class UserCest
482
481
// I do something
483
482
}
484
483
}
485
-
486
- {% endhighlight %}
487
-
488
- For Cept you should use simple comments:
489
-
490
- {% highlight php %}
491
-
492
- <?php
493
- // @env firefox
494
- // @env chrome
495
-
496
484
{% endhighlight %}
497
485
498
486
This way you can easily control which tests will be executed for each environment.
@@ -524,20 +512,16 @@ $scenario->current('capabilities');
524
512
525
513
{% endhighlight %}
526
514
527
- You can access `\Codeception\Scenario` in the Cept and Cest formats.
528
- In Cept, the `$scenario` variable is available by default,
529
- while in Cest you should retrieve it through dependency injection:
515
+ You can inject `\Codeception\Scenario` like this:
530
516
531
517
{% highlight php %}
532
-
533
518
<? php
534
519
public function myTest(\AcceptanceTester $I, \Codeception\Scenario $scenario)
535
520
{
536
521
if ($scenario-> current('browser') == 'chrome') {
537
522
// ...
538
523
}
539
524
}
540
-
541
525
{% endhighlight %}
542
526
543
527
`Codeception\Scenario` is also available in Actor classes and StepObjects. You can access it with `$this->getScenario()`.
@@ -628,7 +612,7 @@ You can pass the `-c` option to any Codeception command (except `bootstrap`), to
628
612
629
613
$ php vendor/bin/codecept run -c ~/projects/ecommerce/
630
614
$ php vendor/bin/codecept run -c ~/projects/drupal/
631
- $ php vendor/bin/codecept generate:cept acceptance CreateArticle -c ~/projects/drupal/
615
+ $ php vendor/bin/codecept generate:cest acceptance CreateArticle -c ~/projects/drupal/
632
616
633
617
{% endhighlight %}
634
618
@@ -678,18 +662,6 @@ public function testAdminUser()
678
662
679
663
{% endhighlight %}
680
664
681
- For Cept files, use pseudo-annotations in comments:
682
-
683
- {% highlight php %}
684
-
685
- <?php
686
- // @group admin
687
- // @group editor
688
- $I = new AcceptanceTester($scenario);
689
- $I-> wantToTest('admin area');
690
-
691
- {% endhighlight %}
692
-
693
665
For `.feature`-files (Gherkin) use tags:
694
666
695
667
{% highlight gherkin %}
@@ -750,7 +722,7 @@ This will load all found `p*` files in `tests/_data` as groups. Group names will
750
722
751
723
## Formats
752
724
753
- In addition to the standard test formats (Cept, Cest, Unit, Gherkin) you can implement your own format classes to customise your test execution.
725
+ In addition to the standard test formats (Cest, Unit, Gherkin) you can implement your own format classes to customise your test execution.
754
726
Specify these in your suite configuration:
755
727
756
728
{% highlight yaml %}
0 commit comments