With codeception is there a way to use constants ( or variables) using the @example annotation ? I know that we can use doctrine style annotation.
Data is defined via the @example annotation, using JSON or Doctrine-style notation (limited to a single line). Doctrine-style
class PageCest { /** * @example(url="/", title="Welcome") * @example(url="/info", title="Info") * @example(url="/about", title="About Us") * @example(url="/contact", title="Contact Us") */ public function staticPages(AcceptanceTester $I, \Codeception\Example $example) { $I->amOnPage($example['url']); $I->see($example['title'], 'h1'); $I->seeInTitle($example['title']); } }
But using a constant which is working in doctrine doesn't seems to work here
/**
* @example(url=Class::Constant, title="Welcome")
*/
is there a way to achieve this to run multiple test examples but use constants or variables to provide the values?
Aucun commentaire:
Enregistrer un commentaire