1,470 questions
0
votes
0
answers
144
views
How can I retrieve the HTTP response code without actual verification?
I'm searching for a way to get the HTTP response code in Codeception without actually verifying it in API tests (end-to-end).
Composer.json:
"codeception/codeception": ">=5.1.2&...
-1
votes
1
answer
201
views
PHP 8.5: "register_argc_argv must be set to On for running Codeception"
When running Codeception in PHP 8.5, I'm getting:
PHP Fatal error: Uncaught Codeception\Exception\ConfigurationException: register_argc_argv must be set to On for running Codeception
0
votes
0
answers
51
views
Using JSON Schema's external references ($ref) with Codeception's seeResponseIsValidOnJsonSchema()
I'm trying to validate responses in Codeception using seeResponseIsValidOnJsonSchema() method which uses JSON Schema for PHP library. The problem is that it looks like JSON Schema "external" ...
0
votes
1
answer
66
views
Codeception method seeResponseContainsJson returns an error when trying to match data containing Russian letters
My Test:
$I->wantTo("Create new claim");
$I->haveHttpHeader('accept', 'application/json');
$I->haveHttpHeader('content-type', 'application/json; charset=utf-8');
$I->...
0
votes
1
answer
139
views
Selenium doesn't pick the right MUI-X Datepicker (SSR related bug?)
I encountered a problem using codeception with selenium. I tried to write an acceptance test for some forms and with codeception using selenium. But i'm struggling with the MUI-X Datepickers.
The ...
0
votes
2
answers
39
views
Interactive Console while running unit test in Codeception
We have 2 scenarios:
Account Binding (registering a bank account number to a service)
Verify OTP (input the otp code sent via customer's mobile phone)
Some response from the Account Binding used in ...
0
votes
0
answers
61
views
Mailcatcher HTTP/1 is not supported
I am using Mailcatcher when doing testing with codeception in an Github Actions.
Installing it like this:
- name: Install & run mailcatcher
run: |
sudo gem install mailcatcher --no-...
0
votes
0
answers
186
views
Testing with PHP Infection
I cover my project with unit tests. I'm using infection and codeception v5. Also I install bypass-finals extension, cause project has a lot of final classes. I guess because of the presence of final ...
2
votes
1
answer
101
views
Codeception: Acceptance test is running as the first test in the test group, where API test is defined as the first test in the group: How to resolve?
I use Codeception framework and Netbeans IDE for my test automation using PHP.
I would like to run 2 tests one after another in a group, where the API test will run first and after the successful run ...
0
votes
1
answer
186
views
Codeception: Symfony fixtures are not being autowired
I have a pretty simple repository test case:
class AmaRepositoryCest
{
public function _before(FunctionalTester $I)
{
$I->loadFixtures(AmaFixture::class);
}
public function ...
0
votes
1
answer
169
views
get php version which codeception tests are running
I'm trying to upgrade my project's php version from php 7.4 to php 8.1,
Now I changed the php version in my composer.json to php 8.1 like that:
"require": {
"php": "^8.1&...
-1
votes
2
answers
96
views
The test does not see the data from the fixture
I have a fixture to fill in the test user
namespace Tests\Fixture;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
use App\Entity\User;
final class UserFixture ...
1
vote
1
answer
149
views
Use Symfony TestContainer in an environment not called "test"
I write a unit test in CodeCception, my config Unit.suite.yml
actor: UnitTester
modules:
enabled:
- Asserts
- Symfony:
environment: 'autotest'
step_decorators: ~
I have a ...
1
vote
1
answer
134
views
not able to setup api testing codeception for yii2
I am working on project built in yii2 and the front end is angular 12 and i am trying to integrate api testing in my project (locally), i am following the documentation but not able to integrate it ...
0
votes
0
answers
60
views
testing a link with codeception
I'm using codeception for the first time, and I'm trying to test a symfony route that has parameters. When I run the test, it doesn't get to the page and the test fails. I've never used codeception, ...
1
vote
0
answers
167
views
Is it possible to only run tests that touch changed code in php
I have a testsuite that takes several minutes to complete so it starts to get annoying to run them all before each push (they will still be run in the deployment pipeline as well)
So I was wondering ...
0
votes
1
answer
100
views
AspectMock not working in Codeception framework & yii2 framework
I want to mock the static methods, so I am using the AspectMock library https://github.com/Codeception/AspectMock.
I tried to mock one static method but it doesnt return the expected mocked result.
...
0
votes
1
answer
66
views
Drag and Drop method not performing any actions, simply that was executing not doing any actions
I'm just using I.dragAndDrop() method, it's not performing any actions. Simply it was passing without doing any actions
just small drag and drop function I'm trying to do, it was not throwing any ...
1
vote
0
answers
472
views
ChromeDriver: 'DevToolsActivePort file doesn't exist' error
I'm running Codeception tests in our Pipeline using Google Chrome and ChromeDriver on Linux.
When I was using for this Chrome version installed from the downloaded .deb package, it was working fine, ...
0
votes
1
answer
4k
views
Installing Chrome browser on Mac m1 arm64
I am using codeception with Cakephp4 for testing. I tried to use chromium browser instead of chrome but I get this error:
System info: host: 'f1c4f5d6ba86', ip: '172.28.0.2', os.name: 'Linux', os.arch:...
1
vote
0
answers
65
views
Can Aspecktmock used in Codeception API testing?
We use Codeception with Phalcon.
We are trying to add testing around an API. This API has DB saves and other application logic. Assume our requirement is to receive 403 HTTP status If the DB save has ...
1
vote
0
answers
486
views
Using a mock to override Aws\S3\S3Client in a Codeception test with Symfony
In the past when testing code I would use the actual external services. However, I'm now trying to improve my tests and use mocks for external services. I'm trying to mock Aws\S3\S3Client in a ...
1
vote
1
answer
191
views
How to produce a 100% Codeception path coverage report?
I am evaluating Paths coverage and trying to understand how exactly it works. Following are environment details:
Yii2, php-code-coverage 9.2.26 using PHP 8.1.6, Codeception and PHPUnit 9.6.8
Sample ...
0
votes
1
answer
116
views
Disabling mailcatcher commandline messages
When using mailcatcher for testing the sending of mails i use codeception and the codeception-mailcatcher-module.
Everything runs as a Github action and i trigger stuff like this:
php vendor/bin/...
2
votes
0
answers
884
views
ERR_CONNECTION_REFUSED when using Codeception with Selenium on Docker
Similar to this (unanswered) question: Facebook\WebDriver\Exception\UnknownErrorException: unknown error: net::ERR_CONNECTION_REFUSED (Session info: headless chrome=96.0.4664.110)
I have a Docker ...
1
vote
2
answers
133
views
Codeception, how to split yml file?
I want to include second yml file to my api.suite.yml. Can I do it somehow?
I have api.suite.yml looking like this
actor: ApiTester
modules:
enabled:
- Asserts
- REST:
...
1
vote
1
answer
51
views
Does Codeception BDD have a @Transform function like Behat does?
In Behat you can do a transformation like so:
<?php
/**
* @Transform /^"([^"]+)" shipping method$/
* @Transform /^shipping method "([^"]+)"$/
* @Transform :...
1
vote
0
answers
669
views
Codeception Module \Helper\Api could not be found and loaded
When i try to add some Helper in Api.suite.yml and run build:
php vendor/bin/codecept build
, then get error:
Building Actor classes for suites: Api
In ModuleContainer.php line 102:
Module \Helper\...
0
votes
1
answer
120
views
Codeception 5 test parameters recommendation sought
I'm writing a Gherkin-based acceptance testing PoC. I have a feature file, step object, and a page object. In my sequence I will need to log-in the test user before conducting the rest of the series. ...
1
vote
1
answer
58
views
Chromedriver: When is a page considered loaded?
In our project we are using Codeception to automate Chromedriver into running User Acceptance Tests. The issue we are facing is that the tests take a really long time to run. Even the most basic tests ...
0
votes
1
answer
447
views
How to use PhpUnit mocking methods within codeception yii2 tests
I need to use PHPUnit mocking methods like expect($this->once())->returnSelf(); in codecept/yii2 tests. Cannot find any way to call them. The Stub library of codeception does not have as many ...
1
vote
1
answer
262
views
codeception doesn't builds helper files automatically
I have an YII2 application project with connected Codeception 4.1.8 testing framework (during the life of project before me there where made a lot of modifications).
So I tried to add my own method to ...
0
votes
0
answers
115
views
Chrome failed to start: exited abnormally
When I run an acceptance test on a remote linux server in Jenkins, the job fails
Facebook\WebDriver\Exception\SessionNotCreatedException] Unable to create new service: ChromeDriverService
Build info: ...
0
votes
1
answer
589
views
How to use multiple dataproviders in a single codeception(a php based test automation framework) test?
I use codeception which is a php based test automation framework.
I need to use multiple dataproviders in a single test class.
I know how to use a single dataprovider per test; example of my code ...
0
votes
1
answer
218
views
Yii2: Functional test running locally, fails on CI
I’ve set up testing for my app. The test suite runs fine locally, while it fails when executed via Gitlab CI.
Locally, whether I run:
./vendor/bin/codecept run functional ...
0
votes
1
answer
86
views
How can I make sure an object is not in the database using Codeception?
I'm working on a Symfony application and writing some tests using CodeCeption.
I need to make sure some entities are created in the database, for which I need to make sure they don't exist previous to ...
2
votes
2
answers
484
views
Can we skip entire cest class in codeception?
I need to skip all the tests in the following cest class and currently I am skipping individual tests with @skip annotation. Is there any way I can skip execution at the class level itself, instead of ...
0
votes
0
answers
241
views
Can I check a checkbox in CodeCeption without a form?
I'm trying to write a test using CodeCeption for a page that looks like this:
My code for the test is the following:
// tests
public function tryToUnifyAgents(FunctionalTester $I)
{
$I->...
0
votes
2
answers
364
views
Click on first element contained in a div
I have a div that contains a set of dynamic elements. I want to click on the first search result.
I want to click on the first element contains in
I tried using creating a custom xPath like so but ...
0
votes
1
answer
139
views
How check value in textarea
How can I check the value in the text field. When you enter a value in this field, it is not displayed in the DOM tree. Are these the problems of this tag or the developer's jamb? Sorry for the ...
0
votes
1
answer
57
views
Loop through multiple accounts in codeception functional test
I got multiple accounts: "userWithCertainRole", "userWithAnotherRole" & "userWithTwoRoles". I want to functional test a specific page for all these accounts with ...
0
votes
1
answer
213
views
Unable to load dynamic configurations in codeception suite configuration
I'm working to simplify a project's testing suite. There is a suite that uses PhpBrowser and %ABSOLUTE_URL% in the environment is set to "http://127.0.0.1:8888". The config:
class_name: ...
1
vote
1
answer
87
views
Codeception $I->see() action doesn't work with WebDriver
The same action works with PhpBrowser but as soon as I set WebDriver in acceptance.suite.yml it throws the following error :
[PHPUnit\Framework\Exception] Invalid argument supplied for foreach() at ...
1
vote
0
answers
170
views
When I run my symfony application through Codeception functional tests Doctrine events are not fired
I'm creating a set of Functional tests for a Symfony 5.4 application using Doctrine.
Upon creation of a record of a certain type I need to trigger the creation of a record in another table.
For that I'...
1
vote
1
answer
525
views
How do I get a Symfony 6 service from a Codeception Event Handler
I'm getting a "Module is not enabled" when trying to get the Symfony module from within a Codeception EventSubscriber.
git clone https://github.com/tacman/codeception-symfony-demo &&...
1
vote
1
answer
1k
views
How to use data providers to create a test that runs before each test in a class?
I'm trying to test a class that handles a user's collection of favorite items, which can be of different types, eg. movies and songs.
So I have this base test class (I'm using Codeception, which uses ...
0
votes
1
answer
603
views
Use _beforeSuite() in Codeception
Good day! Please help me understand _beforeSuite($settings = array()) in Сodeception. I want to register the user before passing all the tests. I have a Tester class - MiddlewareTester, which ...
1
vote
1
answer
938
views
Module \Helper\Acceptance could not be found and loaded
I am new to Codeception. I followed the instructions on the Quick start page (https://codeception.com/quickstart) and saw the error "Module \Helper\Acceptance could not be found and loaded" ...
0
votes
1
answer
254
views
How do I access a DOM element with a dynamic ID in Codeception?
I'm new to autotests and I'm just starting to master Codeception. I am writing an autotest and at the end of the autotest I need to delete the . But when creating a new theme, a delete button with a ...
0
votes
0
answers
383
views
Codeception with docker compose in Symfony: 'No route found'
I'm trying to integrate the codeception framework into my symfony 4.4 app in docker. I have docker-compose.yml file.
version: '2'
services:
application:
build:
context: .
...