mcmatters/chrome-tester

v1.0 2018-03-08 11:45 UTC

README

Simple wrapper over chrome web driver.

Installation

composer require mcmatters/chrome-tester --dev

Usage

<?php

declare(strict_types = 1);

use Facebook\WebDriver\WebDriverBy;
use McMatters\ChromeTester\Browser;

require 'vendor/autoload.php';

$chrome = Browser::make()->getChromeDriver();

$site = $chrome->get('https://google.com');
$site->findElement(WebDriverBy::cssSelector('input[name=q]'))
    ->clear()
    ->sendKeys('Test');

$site->findElement(WebDriverBy::cssSelector('form'))->submit();

echo $site->getPageSource();