Questions tagged [codeception]

Codeception is a modern full-stack testing framework for PHP. Inspired by BDD, it provides a way of writing acceptance, functional and even unit tests. Powered by PHPUnit.

Codeception is a PHP full-stack testing framework. Inspired by BDD, it provides a new way of writing acceptance, functional and even unit tests. Powered by PHPUnit.

Feature Overview:

  • Multiple backends, easily changed , PhpBrowser
  • Elements matched by name, CSS, XPath
  • Data Cleanup after each run
  • Integrate with Symfony, Zend Framework, Laravel, Yii and other frameworks
  • Continuous Integration systems like Jenkins or Bamboo
  • Natively executes PHPUnit tests
  • BDD-style scenario-driven tests
  • WebServices testing via REST,SOAP
  • Generates HTML, XML, TAP, JSON reports
  • Simple Fixtures
  • Database and Doctrine ORM helpers
  • CodeCoverage and Remote CodeCoverage

Documentation & Links

Available modules for frameworks

1468 questions
8
votes
3 answers

How to unit test Symfony controllers

I'm trying to get a Symfony controller in a test harness using Codeception. Every method starts as follows: public function saveAction(Request $request, $id) { // Entity management /** @var EntityManager $em */ $em =…
CJ Dennis
  • 4,226
  • 2
  • 40
  • 69
8
votes
1 answer

PhantomJS cannot visit Self-signed HTTPS pages Codeception

Im currently making an acceptance test with the following tools: Codeception Selenium Webdriver PhantomJS (as headless browser ghost) My problem is My Tests fail when visiting a self-signed (https) page What I've tried: phantomjs --webdriver=5555…
Þaw
  • 2,047
  • 4
  • 22
  • 39
8
votes
2 answers

Run custom code after Codeception suite has finished

I am aware of the _bootstrap.php file that's used to set up the testing enviroment, etc., but I'm looking for a way to run some code after the entire test suite has finished. Note that I'm not looking for a way to run code after a single class, i.e.…
Sacha
  • 2,813
  • 3
  • 22
  • 27
8
votes
6 answers

How to fill a rich text editor field for a Codeception Acceptance test

I'm trying to fill a rich text editor field (TinyMCE) within my acceptance test in Codeception. Using the fillField() function doesn't work as this 'field' isn't really an input field. It's an iframe, styled to look like a fancy textarea. How can I…
mattyh88
  • 1,585
  • 5
  • 26
  • 48
8
votes
1 answer

How can I access an actor (e.g. AcceptanceTester) in a Codeception helper

when I use the AcceptanceHelper generated by codeception (_support/AcceptanceHelper.php), how can I access the Actor / AcceptanceTester ($I). And how can I access my functions from StepObjects? I have: acceptance/_steps/MyStepObject.php namespace…
mcode
  • 534
  • 4
  • 18
8
votes
1 answer

seeInField finds the element, while fillField doesn't - CodeCeption

I am totally new to CodeCeption. I have the below html inside the body,
In CodeCeption acceptance test I have a this below code `
Kamalakannan J
  • 2,818
  • 3
  • 23
  • 51
7
votes
2 answers

Symfony Codeception functional test: environment variable not found

I'm using Codeception v2.4.1 with PHPUnit 7.1.3 in a new Symfony 4 project. I created a functional test, and attempt to run it, and receive an error: ./vendor/bin/codecept run functional There was 1 error: --------- 1) CustomerControllerCest:…
Geoff Maddock
  • 1,700
  • 3
  • 26
  • 47
7
votes
1 answer

What is the purpose of --url-base=/wd/hub when starting chromedriver server?

According to the codeception's documentation, you can run tests in Chrome Browser by connecting to the ChromeDriver directly without using Selenium Server. You first need to install ChromeDriver and then launch it by running the command…
lomse
  • 4,045
  • 6
  • 47
  • 68
7
votes
2 answers

Switch IFrame with Codeception using ID

How can I switch to an IFrame with Codeception using ID? Actually I can use the name of the IFrame but not the ID -> Codeception SwitchToIFrame IFrame Example: