Skip to content

Conversation

@macnev2013
Copy link

Description

This PR fixes #76 for hacktoberfest.

Changes

  • Extracted constants to a new file consts.js

Note: I'm not able to add tags to this PR. Can you please add hacktoberfest tag here?

Copy link
Member

@Delta456 Delta456 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @macnev2013, thanks for making a PR. I will shortly review

Comment on lines -13 to -25
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;

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only these need to be moved to a separate const file.

Comment on lines +18 to +67
// 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';
Copy link
Member

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.

@navin772
Copy link
Member

Hi @macnev2013, could you update the PR as per above requested changes and resolve the conflicts

@navin772
Copy link
Member

@macnev2013 any updates on this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

move consts from util.js to separate file

3 participants