Skip to content

Instantly share code, notes, and snippets.

@vaceletm
Last active May 18, 2017 12:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vaceletm/ab7d5503a193fa798d80060bbec8430b to your computer and use it in GitHub Desktop.
Save vaceletm/ab7d5503a193fa798d80060bbec8430b to your computer and use it in GitHub Desktop.
<?php
declare(strict_types=1);
namespace Tuleap\Tests\Selenium;
use Facebook\WebDriver\WebDriverBy;
use Lmc\Steward\Test\AbstractTestCase;
use Lmc\Steward\Component\Legacy;
class SeedCookiesTest extends AbstractTestCase
{
const COOKIES = 'cookies';
const ALICE_COOKIE = 'alice-cookie';
/** @var Legacy */
private $legacy;
/**
* @before
*/
public function init()
{
$this->legacy = new Legacy($this);
}
public function testSeedCookies()
{
$this->wd->get('https://reverse-proxy/account/login.php');
$this->wd->findElement(WebDriverBy::id('form_loginname'))->sendKeys('alice');
$this->wd->findElement(WebDriverBy::id('form_pw'))->sendKeys('Correct Horse Battery Staple');
$this->wd->findElement(WebDriverBy::name('form_login'))->submit();
$this->waitForPartialTitle('Personal Page');
$this->legacy->saveWithName(
[
self::ALICE_COOKIE => $this->wd->manage()->getCookieNamed('TULEAP_session_hash'),
],
self::COOKIES
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment