-
Notifications
You must be signed in to change notification settings - Fork 28
extracted constants to separate file #79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
macnev2013
wants to merge
2
commits into
LambdaTest:master
Choose a base branch
from
macnev2013:fix/consts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+198
−57
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,112 @@ | ||
| 'use strict'; | ||
|
|
||
| const PROCESS_ENVIRONMENT = process.env; | ||
| const BASE_URL = 'https://api.lambdatest.com/api/v1'; | ||
| const MOBILE_BASE_URL = | ||
| 'https://mobile-api.lambdatest.com/mobile-automation/api/v1'; | ||
| const AUTOMATION_BASE_URL = 'https://api.lambdatest.com/automation/api/v1'; | ||
| const AUTOMATION_DASHBOARD_URL = 'https://automation.lambdatest.com'; | ||
| const AUTOMATION_HUB_URL = process.env.LT_GRID_URL || 'hub.lambdatest.com'; | ||
| const MOBILE_AUTOMATION_HUB_URL = | ||
| process.env.LT_MOBILE_GRID_URL || 'beta-hub.lambdatest.com'; | ||
| const LT_AUTH_ERROR = | ||
| 'Authentication failed. Please assign the correct username and access key to the LT_USERNAME and LT_ACCESS_KEY environment variables.'; | ||
| const LT_TUNNEL_NUMBER = process.env.LT_TUNNEL_NUMBER || 1; | ||
| const INITIAL_RETRY_COUNTER = 60; | ||
| const IS_TRACE_ENABLE = !!PROCESS_ENVIRONMENT.LT_ENABLE_TRACE; | ||
|
|
||
| // Platform constants | ||
| const PLATFORM_ANDROID = 'android'; | ||
| const PLATFORM_IOS = 'ios'; | ||
| const PLATFORM_ANY = 'any'; | ||
|
|
||
| // Browser constants | ||
| const BROWSER_CHROME = 'chrome'; | ||
| const BROWSER_SAFARI = 'safari'; | ||
| const BROWSER_FIREFOX = 'firefox'; | ||
|
|
||
| // Device type constants | ||
| const DEVICE_TYPE_REAL = 'real'; | ||
| const DEVICE_TYPE_IS_REAL = 'isReal'; | ||
|
|
||
| // Version constants | ||
| const VERSION_ANY = 'any'; | ||
| const FIREFOX_CUSTOM_TRANSLATION_MIN_VERSION = 47; | ||
| const SAFARI_CUSTOM_TRANSLATION_MIN_VERSION = 11; | ||
|
|
||
| // HTTP constants | ||
| const HTTP_METHOD_PATCH = 'PATCH'; | ||
| const CONTENT_TYPE_JSON = 'application/json'; | ||
| const ENCODING_BASE64 = 'base64'; | ||
| const ENCODING_UTF8 = 'utf8'; | ||
|
|
||
| // Status constants | ||
| const JOB_STATUS_PASSED = 'passed'; | ||
| const JOB_STATUS_FAILED = 'failed'; | ||
| const SESSION_ABORTED_MESSAGE = 'Session aborted'; | ||
| const TESTS_FAILED_MESSAGE_SUFFIX = ' tests failed'; | ||
|
|
||
| // Tunnel constants | ||
| const DEFAULT_TUNNEL_LOG_FILE = 'lambdaTunnelLog.log'; | ||
| const TUNNEL_CONTROLLER = 'testcafe'; | ||
| const TUNNEL_NAME_PREFIX = 'TestCafe'; | ||
| const TUNNEL_WAIT_INTERVAL = 5000; | ||
|
|
||
| // Client identifier | ||
| const CLIENT_TESTCAFE = 'testcafe'; | ||
|
|
||
| // W3C constants | ||
| const W3C_PREFIX_APPIUM = 'appium'; | ||
|
|
||
| // Capability keys | ||
| const CAPABILITY_KEY_LT_OPTIONS = 'LT:Options'; | ||
| const CAPABILITY_KEY_LT_OPTIONS_LOWERCASE = 'lt:options'; | ||
| const CAPABILITY_KEY_SAFARI_COOKIES = 'safari.cookies'; | ||
| const CAPABILITY_KEY_SAFARI_POPUPS = 'safari.popups'; | ||
| const CAPABILITY_KEY_SELENIUM_VERSION = 'selenium_version'; | ||
| const CAPABILITY_KEY_BROWSER_VERSION = 'browserVersion'; | ||
|
|
||
| export { | ||
| PROCESS_ENVIRONMENT, | ||
| BASE_URL, | ||
| MOBILE_BASE_URL, | ||
| AUTOMATION_BASE_URL, | ||
| AUTOMATION_DASHBOARD_URL, | ||
| AUTOMATION_HUB_URL, | ||
| MOBILE_AUTOMATION_HUB_URL, | ||
| LT_AUTH_ERROR, | ||
| LT_TUNNEL_NUMBER, | ||
| INITIAL_RETRY_COUNTER, | ||
| IS_TRACE_ENABLE, | ||
| PLATFORM_ANDROID, | ||
| PLATFORM_IOS, | ||
| PLATFORM_ANY, | ||
| BROWSER_CHROME, | ||
| BROWSER_SAFARI, | ||
| BROWSER_FIREFOX, | ||
| DEVICE_TYPE_REAL, | ||
| DEVICE_TYPE_IS_REAL, | ||
| VERSION_ANY, | ||
| FIREFOX_CUSTOM_TRANSLATION_MIN_VERSION, | ||
| SAFARI_CUSTOM_TRANSLATION_MIN_VERSION, | ||
| HTTP_METHOD_PATCH, | ||
| CONTENT_TYPE_JSON, | ||
| ENCODING_BASE64, | ||
| ENCODING_UTF8, | ||
| JOB_STATUS_PASSED, | ||
| JOB_STATUS_FAILED, | ||
| SESSION_ABORTED_MESSAGE, | ||
| TESTS_FAILED_MESSAGE_SUFFIX, | ||
| DEFAULT_TUNNEL_LOG_FILE, | ||
| TUNNEL_CONTROLLER, | ||
| TUNNEL_NAME_PREFIX, | ||
| TUNNEL_WAIT_INTERVAL, | ||
| CLIENT_TESTCAFE, | ||
| W3C_PREFIX_APPIUM, | ||
| CAPABILITY_KEY_LT_OPTIONS, | ||
| CAPABILITY_KEY_LT_OPTIONS_LOWERCASE, | ||
| CAPABILITY_KEY_SAFARI_COOKIES, | ||
| CAPABILITY_KEY_SAFARI_POPUPS, | ||
| CAPABILITY_KEY_SELENIUM_VERSION, | ||
| CAPABILITY_KEY_BROWSER_VERSION, | ||
| }; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need these many constants. Please revert to the original.