Skip to content

Trace has no expect calls #91

@gimler

Description

@gimler

When i use plain playwright js script i see the Expect calls in the trace.

Image

With playwright-php traces are working, but i see no expect calls did i miss a config?

Example php snippet that is not in the trace


declare(strict_types=1);

require __DIR__.'/vendor/autoload.php';

use Playwright\Configuration\PlaywrightConfigBuilder;
use Playwright\PlaywrightFactory;
use Monolog\Logger;
use Monolog\Handler\StreamHandler;

$log = new Logger('stdout');
$log->pushHandler(new StreamHandler('php://stdout', Logger::DEBUG));

$playwrightConfig = PlaywrightConfigBuilder::create()
    ->withLogger($log)
    ->withTracing(true)
    ->build()
;

$playwright = PlaywrightFactory::create($playwrightConfig);
$browser = $playwright->chromium()->connect('ws://playwright:8191/3630656d81258c6faa0e988cf725c427');
$context = $browser->newContext([
    'ignoreHTTPSErrors' => true,
]);

$page = $context->newPage();

$context->startTracing($page, [
    'screenshots' => true,
    'snapshots' => true,
]);

$page->goto('https://www.google.de');
var_dump($page->getByText('Über Google')->first()->textContent());
var_dump(\Playwright\Testing\expect($page->getByText('Über Google')->first())->toBeVisible());
$page->getByRole('button', ['name' => 'Alle ablehnen'])->focus();

In the trace i did not see the getByText() calls.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions