-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Landing page functional tests (#1195)
* Added functional tests to landing page * CS fixes
- Loading branch information
1 parent
5d7bf16
commit 84a8904
Showing
19 changed files
with
205 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
APP_ENV=test | ||
GITHUB_TOKEN=test_token | ||
APP_SECRET=secret | ||
SCHEME='https' | ||
DOMAIN='flow-php.wip' | ||
GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX | ||
GOOGLE_CONVERSION_TAG=AW-XXXXXXXXXX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions
44
web/landing/tests/Flow/Website/Tests/Functional/DocumentationTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Flow\Website\Tests\Functional; | ||
|
||
use Flow\Website\Kernel; | ||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | ||
|
||
final class DocumentationTest extends WebTestCase | ||
{ | ||
public function test_documentation_dsl_function_page() : void | ||
{ | ||
$client = self::createClient(); | ||
|
||
$client->request('GET', '/documentation/dsl/core/df'); | ||
|
||
self::assertResponseIsSuccessful(); | ||
self::assertSelectorExists('[data-dsl-function]'); | ||
self::assertSelectorExists('[data-dsl-source-link]'); | ||
self::assertStringContainsString('https://github.com', $client->getCrawler()->filter('[data-dsl-source-link]')->attr('href')); | ||
self::assertSelectorExists('pre'); | ||
self::assertSelectorExists('code.language-php'); | ||
} | ||
|
||
public function test_documentation_dsl_page() : void | ||
{ | ||
$client = self::createClient(); | ||
|
||
$client->request('GET', '/documentation/dsl'); | ||
|
||
self::assertResponseIsSuccessful(); | ||
self::assertSelectorTextContains('#dsl-functions', 'DSL Functions'); | ||
self::assertGreaterThan(0, $client->getCrawler()->filter('[data-dsl-function]')->count()); | ||
self::assertGreaterThan(0, $client->getCrawler()->filter('[data-dsl-source-link]')->count()); | ||
self::assertEquals(14, $client->getCrawler()->filter('[data-dsl-module]')->count()); | ||
self::assertEquals(10, $client->getCrawler()->filter('[data-dsl-type]')->count()); | ||
} | ||
|
||
protected static function getKernelClass() : string | ||
{ | ||
return Kernel::class; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use Symfony\Component\Dotenv\Dotenv; | ||
|
||
require_once __DIR__ . '/../vendor/autoload.php'; | ||
|
||
(new Dotenv())->loadEnv(__DIR__ . '/../.env.test'); | ||
|
||
if (\file_exists(__DIR__ . '/../var/log/')) { | ||
$testLogs = glob(__DIR__ . '/../var/log/*test.log'); | ||
|
||
foreach ($testLogs as $testLog) { | ||
if (\is_file($testLog)) { | ||
\unlink($testLog); | ||
} | ||
} | ||
} |