https://github.com/remi-san/ouroboros
:dragon: End-to-end test helper
https://github.com/remi-san/ouroboros
e2e testing
Last synced: 6 months ago
JSON representation
:dragon: End-to-end test helper
- Host: GitHub
- URL: https://github.com/remi-san/ouroboros
- Owner: remi-san
- Created: 2017-04-17T17:26:22.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-04-21T12:17:03.000Z (about 9 years ago)
- Last Synced: 2025-07-26T06:19:29.709Z (11 months ago)
- Topics: e2e, testing
- Language: PHP
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Ouroboros
=========
"εν το παν"
`Ouroboros` is a simple library letting you creating end to end (e2e) tests
with your favorite PHP test framework. Like the snake eating its own tail
it's inspired from, *Ouroboros* lib will let you easily create, destroy the
app to test and do it all over again for each test.
How to use it?
--------------
Initialize your `TestHelper`
```php
$this->testHelper = new TestHelper(
new MakefileInfrastructureHelper($appBasePath), // or any other infra helper
new CommandLauncherApplicationHelper($appBasePath, 'make run'), // or any other app helper
new LoggerConditionWaiter( // if you want to follow a logfile for completion condition
$logFile,
new TextConditionMatcherFactory(
[
self::CONDITION_ONE => 'This is my first condition',
self::CONDITION_TWO => 'This is my second condition',
]
),
$logger,
5
)
);
```
Use it in your test file (here with `phpunit`)
```php
/**
* Init.
*/
public function setUp()
{
$this->testHelper->setUp();
}
/**
* Close.
*/
public function tearDown()
{
$this->testHelper->tearDown();
}
/**
* @test
*/
public function itShouldWaitForAllConditionsAndSucceed()
{
$this->testHelper->wait([self::CONDITION_ONE, self::CONDITION_TWO]);
}
```