Copied acceptance tests infrastructures from oC/core

Signed-off-by: Kiran Parajuli <kiranparajuli589@gmail.com>
This commit is contained in:
Kiran Parajuli
2023-01-05 09:21:34 +05:45
committed by Phil Davis
parent b84f1f2048
commit 7d152e2ad1
61 changed files with 39555 additions and 28 deletions
@@ -20,19 +20,44 @@
*
*/
$pathToCore = \getenv('PATH_TO_CORE');
if ($pathToCore === false) {
$pathToCore = "../core";
}
use Composer\Autoload\ClassLoader;
require_once $pathToCore . '/tests/acceptance/features/bootstrap/bootstrap.php';
$classLoader = new ClassLoader();
$classLoader = new \Composer\Autoload\ClassLoader();
$classLoader->addPsr4(
"",
$pathToCore . "/tests/acceptance/features/bootstrap",
true
);
$classLoader->addPsr4("TestHelpers\\", __DIR__ . "/../../../TestHelpers", true);
$classLoader->register();
// Sleep for 10 milliseconds
const STANDARD_SLEEP_TIME_MILLISEC = 10;
const STANDARD_SLEEP_TIME_MICROSEC = STANDARD_SLEEP_TIME_MILLISEC * 1000;
// Long timeout for use in code that needs to wait for known slow UI
const LONG_UI_WAIT_TIMEOUT_MILLISEC = 60000;
// Default timeout for use in code that needs to wait for the UI
const STANDARD_UI_WAIT_TIMEOUT_MILLISEC = 10000;
// Minimum timeout for use in code that needs to wait for the UI
const MINIMUM_UI_WAIT_TIMEOUT_MILLISEC = 500;
const MINIMUM_UI_WAIT_TIMEOUT_MICROSEC = MINIMUM_UI_WAIT_TIMEOUT_MILLISEC * 1000;
// Minimum timeout for emails
const EMAIL_WAIT_TIMEOUT_SEC = 10;
const EMAIL_WAIT_TIMEOUT_MILLISEC = EMAIL_WAIT_TIMEOUT_SEC * 1000;
// Default number of times to retry where retries are useful
const STANDARD_RETRY_COUNT = 5;
// Minimum number of times to retry where retries are useful
const MINIMUM_RETRY_COUNT = 2;
// The remote server-under-test might or might not happen to have this directory.
// If it does not exist, then the tests may end up creating it.
const ACCEPTANCE_TEST_DIR_ON_REMOTE_SERVER = "tests/acceptance";
// The following directory should NOT already exist on the remote server-under-test.
// Acceptance tests are free to do anything needed in this directory, and to
// delete it during or at the end of testing.
const TEMPORARY_STORAGE_DIR_ON_REMOTE_SERVER = ACCEPTANCE_TEST_DIR_ON_REMOTE_SERVER . "/server_tmp";
// The following directory is created, used, and deleted by tests that need to
// use some "local external storage" on the server.
const LOCAL_STORAGE_DIR_ON_REMOTE_SERVER = TEMPORARY_STORAGE_DIR_ON_REMOTE_SERVER . "/local_storage";