Skip to content

Commit c14d237

Browse files
chore: combines two environment variables into a single isE2E variable
1 parent e00b97f commit c14d237

File tree

19 files changed

+44
-44
lines changed

19 files changed

+44
-44
lines changed

.e2e.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
export MM_TEST_ACCOUNT_SRP='word1 word... word12'
33
export MM_TEST_ACCOUNT_ADDRESS='0x...'
44
export MM_TEST_ACCOUNT_PRIVATE_KEY=''
5-
export IS_TEST="true"
5+
export IS_E2E="true"
66
# Temporary mechanism to enable security alerts API prior to release.
77
export MM_SECURITY_ALERTS_API_ENABLED="true"

.js.env.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export SENTRY_DISABLE_AUTO_UPLOAD="true"
2828

2929
# ENV vars for e2e tests
3030
# enable e2e tests when value is true
31-
export IS_TEST=""
31+
export IS_E2E=""
3232
# defined as secrets to run on Bitrise CI
3333
# but have to be defined here for local tests
3434
export MM_TEST_ACCOUNT_SRP=""

app/components/Nav/Main/MainNavigator.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ import { useMetrics } from '../../../components/hooks/useMetrics';
8282
import DeprecatedNetworkDetails from '../../UI/DeprecatedNetworkModal';
8383
import ConfirmAddAsset from '../../UI/ConfirmAddAsset';
8484
import { AesCryptoTestForm } from '../../Views/AesCryptoTestForm';
85-
import { isTest } from '../../../util/test/utils';
85+
import { isE2E } from '../../../util/test/utils';
8686
import { selectPermissionControllerState } from '../../../selectors/snaps/permissionController';
8787
import NftDetails from '../../Views/NftDetails';
8888
import NftDetailsFullImage from '../../Views/NftDetails/NFtDetailsFullImage';
@@ -290,7 +290,7 @@ const SettingsFlow = () => (
290290
*
291291
* If this is in production, it is a bug.
292292
*/
293-
isTest && (
293+
isE2E && (
294294
<Stack.Screen
295295
name="AesCryptoTestForm"
296296
component={AesCryptoTestForm}

app/components/UI/OnboardingWizard/index.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
import { useTheme } from '../../../util/theme';
2424
import Device from '../../../util/device';
2525
import StorageWrapper from '../../../store/storage-wrapper';
26-
import { isTest } from '../../../util/test/utils';
26+
import { isE2E } from '../../../util/test/utils';
2727
import { useMetrics } from '../../hooks/useMetrics';
2828
import { RootState } from '../../../reducers';
2929

@@ -118,9 +118,9 @@ const OnboardingWizard = ({
118118
};
119119

120120
// Since react-native-default-preference is not covered by the fixtures,
121-
// when isTest is `true`, if the ONBOARDING_WIZARD is marked as 'explored',
121+
// when isE2E is `true`, if the ONBOARDING_WIZARD is marked as 'explored',
122122
// it indicates that it was provided by fixtures, triggering the call to closeOnboardingWizard().
123-
if (isTest && step === 1) {
123+
if (isE2E && step === 1) {
124124
const inTestCloseOnboardingWizard = async () => {
125125
const wizardStep = await StorageWrapper.getItem(ONBOARDING_WIZARD);
126126
if (wizardStep === EXPLORED) {

app/components/Views/BrowserTab/BrowserTab.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ import { useMetrics } from '../../../components/hooks/useMetrics';
7373
import { trackDappViewedEvent } from '../../../util/metrics';
7474
import trackErrorAsAnalytics from '../../../util/metrics/TrackError/trackErrorAsAnalytics';
7575
import { selectPermissionControllerState } from '../../../selectors/snaps/permissionController';
76-
import { isTest } from '../../../util/test/utils.js';
76+
import { isE2E } from '../../../util/test/utils.js';
7777
import { EXTERNAL_LINK_TYPE } from '../../../constants/browser';
7878
import { PermissionKeys } from '../../../core/Permissions/specifications';
7979
import { CaveatTypes } from '../../../core/Permissions/constants';
@@ -1368,7 +1368,7 @@ export const BrowserTab: React.FC<BrowserTabProps> = ({
13681368
testID={BrowserViewSelectorsIDs.BROWSER_WEBVIEW_ID}
13691369
applicationNameForUserAgent={'WebView MetaMaskMobile'}
13701370
onFileDownload={handleOnFileDownload}
1371-
webviewDebuggingEnabled={isTest}
1371+
webviewDebuggingEnabled={isE2E}
13721372
/>
13731373
{ipfsBannerVisible && (
13741374
<IpfsBanner setIpfsBannerVisible={setIpfsBannerVisible} />

app/components/Views/ErrorBoundary/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import {
4040
} from '../../../components/hooks/useMetrics';
4141
import AppConstants from '../../../core/AppConstants';
4242
import { useSelector } from 'react-redux';
43-
import { isTest } from '../../../util/test/utils';
43+
import { isE2E } from '../../../util/test/utils';
4444
// eslint-disable-next-line import/no-commonjs
4545
const WarningIcon = require('./warning-icon.png');
4646

@@ -270,7 +270,7 @@ export const Fallback = (props) => {
270270
}
271271
/>
272272

273-
{isTest && (
273+
{isE2E && (
274274
<Text style={styles.text}>
275275
<Text onPress={props.showExportSeedphrase} style={styles.link}>
276276
{strings('error_screen.save_seedphrase_2')}

app/components/Views/OnboardingCarousel/index.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import renderWithProvider from '../../../util/test/renderWithProvider';
77

88
jest.mock('../../../util/metrics/TrackOnboarding/trackOnboarding');
99
jest.mock('../../../util/test/utils', () => ({
10-
isTest: true,
10+
isE2E: true,
1111
}));
1212

1313
const mockNavigate: jest.Mock = jest.fn();
@@ -26,7 +26,7 @@ describe('OnboardingCarousel', () => {
2626
expect(toJSON()).toMatchSnapshot();
2727
});
2828

29-
it('should render the App Start Time text when isTest is true', async () => {
29+
it('should render the App Start Time text when isE2E is true', async () => {
3030
const { toJSON, getByTestId } = renderWithProvider(
3131
<OnboardingCarousel navigation={mockNavigation}/>
3232
);

app/components/Views/OnboardingCarousel/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { WELCOME_SCREEN_CAROUSEL_TITLE_ID } from '../../../../wdio/screen-object
2727
import { OnboardingCarouselSelectorIDs } from '../../../../e2e/selectors/Onboarding/OnboardingCarousel.selectors';
2828
import generateTestId from '../../../../wdio/utils/generateTestId';
2929
import trackOnboarding from '../../../util/metrics/TrackOnboarding/trackOnboarding';
30-
import { isTest } from '../../../util/test/utils';
30+
import { isE2E } from '../../../util/test/utils';
3131
import StorageWrapper from '../../../store/storage-wrapper';
3232
import { Dispatch } from 'redux';
3333
import {
@@ -250,7 +250,7 @@ export const OnboardingCarousel: React.FC<OnboardingCarouselProps> = ({
250250
<Text style={styles.title}>
251251
{strings(`onboarding_carousel.title${key}`)}
252252
</Text>
253-
{isTest && (
253+
{isE2E && (
254254
// This Text component is used to grab the App Start Time for our E2E test
255255
// ColdStartToOnboardingScreen.feature
256256
<Text

app/components/Views/RevealPrivateCredential/RevealPrivateCredential.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import { uint8ArrayToMnemonic } from '../../../util/mnemonic';
5050
import { passwordRequirementsMet } from '../../../util/password';
5151
import { Authentication } from '../../../core/';
5252

53-
import { isTest } from '../../../util/test/utils';
53+
import { isE2E } from '../../../util/test/utils';
5454
import Device from '../../../util/device';
5555
import { strings } from '../../../../locales/i18n';
5656
import { isHardwareAccount } from '../../../util/address';
@@ -517,7 +517,7 @@ const RevealPrivateCredential = ({
517517
</Text>
518518
</TouchableOpacity>
519519
</Text>
520-
{isTest ? (
520+
{isE2E ? (
521521
<Button
522522
label={strings('reveal_credential.reveal_credential', {
523523
credentialName: isPrivateKeyReveal

app/components/Views/Root/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import ErrorBoundary from '../ErrorBoundary';
1111
import { useAppTheme, ThemeContext } from '../../../util/theme';
1212
import { ToastContextWrapper } from '../../../component-library/components/Toast';
1313
import { SafeAreaProvider } from 'react-native-safe-area-context';
14-
import { isTest } from '../../../util/test/utils';
14+
import { isE2E } from '../../../util/test/utils';
1515

1616
/**
1717
* Top level of the component hierarchy
@@ -50,21 +50,21 @@ export default class Root extends PureComponent {
5050

5151
this.state = {
5252
isLoading: true, // Track loading state
53-
isTest,
53+
isE2E,
5454
};
5555
}
5656

5757
async componentDidMount() {
58-
const { isTest } = this.state;
59-
if (isTest) {
58+
const { isE2E } = this.state;
59+
if (isE2E) {
6060
await this.waitForStore();
6161
this.setState({ isLoading: false });
6262
}
6363
}
6464

6565
render() {
66-
const { isTest, isLoading } = this.state;
67-
if (isTest && isLoading) {
66+
const { isE2E, isLoading } = this.state;
67+
if (isE2E && isLoading) {
6868
return null;
6969
}
7070

0 commit comments

Comments
 (0)