Commit 0f835eec authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

local tests now working

parent c2bf04c9
APP_ENV=development
\ No newline at end of file
APP_ENV=development
# Variables for Testing
SELENIUM_IMAGE=selenium/standalone-firefox:99.0
\ No newline at end of file
......@@ -52,7 +52,12 @@ services:
- ./metager:/metager/metager_app
healthcheck:
test: "curl -f http://nginx:8080/health-check/liveness-worker"
selenium_standalone_firefox:
image: ${SELENIUM_IMAGE}
restart: always
shm_size: 2GB
ports:
- "7900:7900"
composer:
build:
<<: *fpm_build
......
......@@ -44,5 +44,6 @@ COMMIT_NAME=Testing
BROWSERSTACK_BROWSER=WINDOWS_10_FIREFOX
BROWSERSTACK_SEPARATE_SESSIONS=true
SELENIUM_HOST=selenium_standalone_firefox
#PROXY_HOST=
#PROXY_PORT=
......@@ -24,8 +24,6 @@
},
"require-dev": {
"brianium/paratest": "^6.3",
"browserstack/browserstack-local": "^1.1",
"chinleung/laravel-browserstack": "^1.4",
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/dusk": "^6.15",
......
This diff is collapsed.
<?php
return [
/*
|--------------------------------------------------------------------------
| Credentials
|--------------------------------------------------------------------------
|
| Your username and access key for BrowserStack.
| https://www.browserstack.com/accounts/settings
|
*/
'username' => env('BROWSERSTACK_USERNAME'),
'key' => env('BROWSERSTACK_ACCESS_KEY'),
/*
|--------------------------------------------------------------------------
| Browser
|--------------------------------------------------------------------------
|
| The browser slug to run on BrowserStack.
|
*/
'browser' => env('BROWSERSTACK_BROWSER', 'WINDOWS_10_FIREFOX'),
/*
|--------------------------------------------------------------------------
| Session
|--------------------------------------------------------------------------
|
| Configuration to make BrowserStack run each tests in a different
| session.
|
*/
'separate_sessions' => env('BROWSERSTACK_SEPARATE_SESSIONS', true),
/*
|--------------------------------------------------------------------------
| Capabilities
|--------------------------------------------------------------------------
|
| The configuration for capabilities of the browser.
| https://www.browserstack.com/automate/capabilities
|
*/
'capabilities' => [
'acceptSslCerts' => env('BROWSERSTACK_ACCEPT_SSL', true),
'browserstack' => [
'console' => env('BROWSERSTACK_CONSOLE', 'verbose'),
'local' => env('BROWSERSTACK_LOCAL_TUNNEL', false),
'timezone' => env('BROWSERSTACK_TIMEZONE', config('app.timezone')),
"timezone" => "Europe/Berlin",
],
"resolution" => "1920x1080",
"project" => env("PROJECT_NAME", "Not Set"),
"build" => env("BRANCH_NAME", "Not Set"),
"name" => env("COMMIT_NAME", "Not Set"),
'resolution' => env('BROWSERSTACK_RESOLUTION', '1920x1080'),
],
/*
|--------------------------------------------------------------------------
| Command Arguments
|--------------------------------------------------------------------------
|
| The arguments and flags to use for the BrowserStack local connection.
|
*/
'arguments' => [
'binaryPath' => env('BROWSERSTACK_CLI_BINARY_PATH'),
'logFile' => env('BROWSERSTACK_CLI_LOG_FILE'),
'v' => env('BROWSERSTACK_CLI_VERBOSE'),
'force' => env('BROWSERSTACK_CLI_FORCE'),
'only' => env('BROWSERSTACK_CLI_ONLY'),
'onlyAutomate' => env('BROWSERSTACK_CLI_ONLY_AUTOMATE'),
'forcelocal' => env(
'BROWSERSTACK_CLI_FORCE_LOCAL',
env('BROWSERSTACK_LOCAL_TUNNEL', false)
),
'localIdentifier' => env('BROWSERSTACK_CLI_LOCAL_IDENTIFIER'),
'proxyHost' => env('BROWSERSTACK_CLI_PROXY_HOST'),
'proxyPort' => env('BROWSERSTACK_CLI_PROXY_PORT'),
'proxyUser' => env('BROWSERSTACK_CLI_PROXY_USER'),
'proxyPass' => env('BROWSERSTACK_CLI_PROXY_PASSWORD'),
'forceproxy' => env('BROWSERSTACK_CLI_FORCE_PROXY'),
'hosts' => env('BROWSERSTACK_CLI_HOSTS'),
'f' => env('BROWSERSTACK_CLI_F'),
],
];
......@@ -66,9 +66,7 @@ return [
"branch_name" => env("BRANCH_NAME", "Not Set"),
"commit_name" => env("COMMIT_NAME", "Not Set"),
],
"browserstack" => [
"username" => env("BROWSERSTACK_USERNAME", ""),
"access_key" => env("BROWSERSTACK_ACCESS_KEY", ""),
"local_tunnel" => false,
"selenium" => [
"host" => env("SELENIUM_HOST", "localhost"),
],
];
......@@ -2,12 +2,13 @@
namespace Tests;
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;
use Laravel\Dusk\TestCase as BaseTestCase;
use \ChinLeung\BrowserStack\RunsOnBrowserStack;
abstract class DuskTestCase extends BaseTestCase
{
use CreatesApplication, RunsOnBrowserStack;
use CreatesApplication;
/**
* Prepare for Dusk test execution.
......@@ -19,8 +20,15 @@ abstract class DuskTestCase extends BaseTestCase
{
}
protected function getBuildName(): string
/**
* Create the RemoteWebDriver instance.
*
* @return \Facebook\WebDriver\Remote\RemoteWebDriver
*/
protected function driver()
{
return config("metager.metager.git.branch_name");
return RemoteWebDriver::create(
"http://" . config("metager.metager.selenium.host") . ":4444/wd/hub", DesiredCapabilities::firefox()
);
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment