Skip to content

Commit

Permalink
Feat: add an acceptance test
Browse files Browse the repository at this point in the history
  • Loading branch information
Manuel Canga committed Jun 6, 2019
1 parent 078e84f commit f7d4483
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
Empty file removed tests/_output/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion tests/acceptance.suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ modules:
enabled:
- Asserts
- WebDriver:
url: http://test:80
url: http://gist-it-php.servidor:80
browser: phantomjs
port: 4444
window_size: 1024x800
Expand Down
24 changes: 20 additions & 4 deletions tests/acceptance/EmbedCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,26 @@ public function _before(AcceptanceTester $I)
{
}

// tests
public function embed(AcceptanceTester $I)
/**
* Run: php ../vendor/bin/codecept run --steps from 'tests' directory
*
* @param AcceptanceTester $I
*/
public function testEmbedExample(AcceptanceTester $I)
{
$I->wantTo('generate code embed for Github URL');
$I->amOnPage('/trasweb/Team/blob/develop/Team.php');
$I->amOnPage('/example.html');
$I->canSeeInTitle('Gist-it-php - Example');

//piece of code
$I->cansee('namespace gist_it_php');
$I->cansee('const _APP_ = __DIR__;');

//Relative links
$I->canSeeLink('view raw', 'https://github.com/trasweb/gist-it-php/raw/master/index.php');
$I->canSeeLink('index.php', 'https://github.com/trasweb/gist-it-php/blob/master/index.php');

//line numbers in gutter
$I->cansee('28', '.gist-gutter');
}
}
}

0 comments on commit f7d4483

Please sign in to comment.