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
11
votes
4 answers

Aggregating code coverage from different testing frameworks

In modern programming workflow numerous testing frameworks are used at once. For example, in PHP world, it is de-facto standard way to use unit tests, integration tests and functional/acceptance tests at once. Most of the time different frameworks…
RuslanN
  • 398
  • 3
  • 18
11
votes
2 answers

codeception - mocking api call data

I am in the process of building and writing tests for a front-end app which is making calls to an API for all of its data. I am testing with Codeception. So far, functional and acceptance tests working however, I want functional tests to be…
Adamski
  • 3,585
  • 5
  • 42
  • 78
10
votes
3 answers

Options for recording the tasks done in a browser for UI Automation Test

Is there a tool that can record user interactions with DOM elements for usage in creating automated tests (I'm using Codeception and Laravel Dusk but any tool with roots in Selenium is fine). I'm looking for something to record a sequence and get…
artlung
  • 33,305
  • 16
  • 69
  • 121
10
votes
2 answers

Testing a Laravel 5 route with an exists rule via Codeception

I'm writing tests for my Laravel application using the Codeception library. I'm using the Laravel5 module, and have it configured with cleanup which means that all tests will run inside a database transaction, so that my testing database doesn't get…
John Dorean
  • 3,744
  • 9
  • 51
  • 82
10
votes
2 answers

Referencing fixture record in yii2/codeception data files

Is there a way to specify a related row of another fixture in fixture data file in Yii2/Codeception ActiveFixture? Consider this example of user/profile relation: user.php: return [ 'user1' => [ 'email' => 'user1@example.net', …
Andrey
  • 993
  • 1
  • 11
  • 20
10
votes
2 answers

Codeception - POST raw JSON string

I am sending the following request using jQuery var url = 'http://site.local/api/package/create'; var data = { "command": "package", "commandParameters": { "options": [ { "a": true } ], "parameters": { …
Carlton
  • 5,533
  • 4
  • 54
  • 73
10
votes
1 answer

Codeception codecoverage painfully slow

I am using codeception (with codecoverage) to check the code coverage of an application I have written using the Yii2 framework. Because the standard php installation on my mac has xcode not enabled, I activated it adding a zend_module line to my…
palima
  • 101
  • 5
10
votes
3 answers

Yii 2 migrations for test database

I'm failing to see a clear way to do this, although I can see it being reiterated multiple times in the documentation, specifically: Use yii migrate tool to upgrade your test database to the latest version; found in…
Mr Peach
  • 1,364
  • 1
  • 12
  • 20
10
votes
4 answers

Is there a way to control tests order in Codeception?

I just started using Codeception after years of writing unit tests in plain PHPUnit. One thing that is bugging me, that I can't find a way to control the order in which the tests are invoked. In pure old PHPUnit I was building the test structure…
Maciej Sz
  • 11,151
  • 7
  • 40
  • 56
9
votes
2 answers

How can i stop codeception/selenium from closing the browser window on failed assertions?

I am running codeception 2 with selenium. I can see selenium open the browser and run through the tests. Then I get an error from codeception that there is a failed assertion. I know there is an HTML file that is saved, but there is a lot of JS, so…
DAB
  • 1,303
  • 14
  • 23
9
votes
1 answer

Codeception: how do I test file download?

I have a page with a several options and a button named "Download". How do I test that this button works - document begin downloading, using Codeception acceptance tests?
FelikZ
  • 2,976
  • 4
  • 32
  • 41
9
votes
3 answers

Authorization header not making it through in Codeception API testing

I am attempting to test my Laravel 4 REST API using Codeception, but when I try to send through my Authorization header (using the $I->amBearerAuthenticated() function of the REST module) it is not making it through to the eventual request. From…
Ben Slinger
  • 267
  • 4
  • 14
9
votes
1 answer

How to setup Bamboo to work with codeception?

I have been trying to get Bamboo working with codeception tests. I am using codeception to test my code in a symfony project. After some research I found an article on how to setup Jenkins with codeception. Once read I figured out that I should use…
Robin Hermans
  • 1,579
  • 1
  • 24
  • 52
9
votes
1 answer

How do I hover mouse over an element with Codeception?

Hope someone can help/point me to a answer.... I am using Codeception for testing our website. All is well, except that I can not find a way to hover over a menu element to reveal the rest of the menu. With watir & webdriver I was able to use…
user2906554
  • 91
  • 1
  • 4
8
votes
1 answer

How do I pass environment variable to Codeception YML file from command line?

I see this sort of thing in Codeception YML files all the time: modules: enabled: - PhpBrowser: url: '%URL%' How do I pass "URL" to Codeception from the command line? Or any other way!
John Dee
  • 539
  • 4
  • 14
1 2
3
97 98