What are the Slack Archives?
It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Hi Team Please give reference for test cases for Communication, Presentation and Persistence Layer.
Hi Team
Please give reference for test cases for Communication, Presentation and Persistence Layer.
I am trying to create test cases taking reference from customer module.
Like this<?php
/**
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
*/
namespace PyzTest\Zed\SeoTemplates\Communication\Controller;
use Codeception\Test\Unit;
use SeoTemplatesCommunicationTester;
/**
* Auto-generated group annotations
*
* @group PyzTest
* @group Zed
* @group Customer
* @group Communication
* @group Controller
* @group SeoTemplatesIndexTest
*
*/
class SeoTemplatesIndexTest extends Unit
{
protected const TEMPLATES_PAGE = '/seo-templates';
/**
* @param SeoTemplatesCommunicationTester $test
*
* @return void
*/
public function testBreadCrumbIsVisible(SeoTemplatesCommunicationTester $test): void
{
$test->amOnPage(static::TEMPLATES_PAGE);
`$test->seeBreadcrumbNavigation('Merchandising / SEO Templates');` `}`
}
But I am getting following error:[ArgumentCountError] Too few arguments to function PyzTest\Zed\SeoTemplates\Communication\Controller\SeoTemplatesIndexTest::testBreadCrumbIsVisible(), 0 passed in /data/vendor/phpunit/phpunit/src/Framework/TestCase.php on line 1527 and exactly 1 expected
Please give reference for test cases from where I can take help for same.
Comments
-
Can you share your corresponding codeception.yml?
0 -
Now I have made some changes while doing R&D.
I have checked that for Controller files testcases file is ending with Cest.php.Can you please explain me what is the significance of file ending with Cest.php. In my experience in other frameworks, classes ending with test.php are used.
<?php
/**
* Copyright © 2016-present Spryker Systems GmbH. All rights reserved.
* Use of this software requires acceptance of the Evaluation License Agreement. See LICENSE file.
*/
namespace PyzTest\Zed\SeoTemplates\Communication\Controller;
use Codeception\Test\Unit;
use PyzTest\Zed\SeoTemplates\PageObject\SeoTemplatesIndexPage;
use PyzTest\Zed\SeoTemplates\SeoTemplatesCommunicationTester;
/**
* Auto-generated group annotations
*
* @group PyzTest
* @group Zed
* @group Customer
* @group Communication
* @group Controller
* @group SeoTemplatesIndexTest
*
*/
class SeoTemplatesIndexTestCest
{
protected const TEMPLATES_PAGE = '/seo-templates';
`/**` `* @param SeoTemplatesCommunicationTester $test` `*` `* @return void` `*/` `public function testBreadCrumbIsVisible(SeoTemplatesCommunicationTester $test): void` `{` `$test->amOnPage(SeoTemplatesIndexPage::URL);` `$test->seeBreadcrumbNavigation('Merchandising / SEO Templates');` `}`
}
and following is the codeception.yml file:
namespace: PyzTest\Zed\SeoTemplates
paths:
tests: .
data: _data
support: _support
log: _output
coverage:
enabled: true
remote: false
whitelist: { include: ['../../../../src/*'] }
suites:
Communication:
path: Communication
class_name: SeoTemplatesCommunicationTester
modules:
enabled:
- Asserts
- \SprykerTest\Shared\Testify\Helper\Environment
- \SprykerTest\Shared\Testify\Helper\ConfigHelper
- \SprykerTest\Shared\Testify\Helper\LocatorHelper
- \SprykerTest\Shared\Testify\Helper\DependencyHelper
- \SprykerTest\Shared\Testify\Helper\DataCleanupHelper
- \SprykerTest\Shared\Propel\Helper\TransactionHelper
- \SprykerTest\Zed\ZedNavigation\Helper\BreadcrumbHelper
- \SprykerTest\Shared\Application\Helper\ZedHelper
- \SprykerTest\Zed\Testify\Helper\Business\BusinessHelper
- \SprykerTest\Zed\Testify\Helper\Business\DependencyProviderHelper
- \SprykerTest\Zed\Testify\Helper\Communication\DependencyProviderHelper
- \SprykerTest\Zed\Testify\Helper\Communication\CommunicationHelper
- \SprykerTest\Zed\Testify\Helper\Communication\Table\TableHelper
- \SprykerTest\Service\Container\Helper\ContainerHelper
- \SprykerTest\Zed\Validator\Helper\ValidatorHelper
- \SprykerTest\Zed\Form\Helper\FormHelper:
formPlugins:
- \Spryker\Zed\Validator\Communication\Plugin\Form\ValidatorFormPlugin
- \Spryker\Zed\Http\Communication\Plugin\Form\HttpFoundationFormPlugin
- \SprykerTest\Zed\EventDispatcher\Helper\EventDispatcherHelper
- \SprykerTest\Zed\Twig\Helper\TwigHelper:
twigPlugins:
- \Spryker\Zed\Translator\Communication\Plugin\Twig\TranslatorTwigPlugin
- \Spryker\Zed\ZedNavigation\Communication\Plugin\Twig\ZedNavigationTwigPlugin
- \SprykerTest\Zed\Gui\Helper\GuiTwigPluginHelper
- \SprykerTest\Zed\Router\Helper\RouterHelper
- \SprykerTest\Zed\Application\Helper\ApplicationHelper
- \SprykerTest\Shared\Customer\Helper\CustomerDataHelper
- \SprykerTest\Shared\Testify\Helper\DataCleanupHelper
0 -
Now I am facing this issue:
0 -
Can you please give reference from where I can take help in writing test cases.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 930 Developer Corner
- 788 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K 📜 Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random