Codeception / Codeception/Codeception

Code Coverage doesn't work with Chrome via Selenium

Abierto
#5,695 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Coverage
Lenguaje dominante
PHP
Estrellas
4.9k
Forks
1.3k
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

#### What are you trying to achieve?
Coverage for functional tests.

#### What do you get instead?
0% coverage.

### Details

* Codeception version: 3.1.1
* PHP Version: 7.3.9
* Operating System: Docker alpine based
* Installation type: Composer
* List of installed packages (`composer show`)
* Suite configuration:

```yml
coverage:
enabled: true
c3_url: 'http://www.schoolm.local/index.php?key=ffewfwe'
include:
- src/*
```

docker-compose
```
chrome:
restart: unless-stopped
image: selenium/standalone-chrome-debug:3.141.59-vanadium
ports:
- 5900
- 4444
```

The problem is that the cookie that codeception send at the beginning is missing in php
[Cookie Jar] ["CODECEPTION_CODECOVERAGE=%7B%22CodeCoverage%22%3A%22create%22%2C%22CodeCoverage_Suite%22%3A%22functional%22%2C%22CodeCoverage_Config%22%3Anull%7D; domain=www.mydomain.local; path=/; httponly"]

The domain is correct, also session cookies are working.
```
error_log(var_export($_COOKIE, 1));
error_log(var_export(getallheaders(), 1));
```

A workaround is to set the server vars manually in c3.php
```
$_SERVER["HTTP_X_CODECEPTION_CODECOVERAGE"] = "create";
$_SERVER["HTTP_X_CODECEPTION_CODECOVERAGE_SUITE"] = "functional";
$_SERVER["HTTP_X_CODECEPTION_CODECOVERAGE_CONFIG"] = null;
```

Then i get the coverage as accepted.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.