mirror of
https://github.com/mosip/inji-wallet.git
synced 2026-01-09 13:38:01 -05:00
[INJIMOB-856] add testIds (#1272)
testIDs added for - Inji tour guide slides, banner notification, issuer component Signed-off-by: KiruthikaJeyashankar <81218987+KiruthikaJeyashankar@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
8e0584688d
commit
7036b4a960
10
.talismanrc
10
.talismanrc
@@ -24,7 +24,7 @@ fileignoreconfig:
|
||||
- filename: screens/BiometricScreenController.ts
|
||||
checksum: 4a424adbd2d2404c9d968c54607885af643a07e09acc4a2d37c6e7a7952c4945
|
||||
- filename: screens/Home/IntroSlidersScreen.tsx
|
||||
checksum: af4a7e2d04b1141b7c32acfabeb3213a32eaca2a8e8f61e6958b6c97219dce57
|
||||
checksum: 33cead03c9cf1bc5b984c7ecb81b5b5966527c712303e913c3e044fec6ee8188
|
||||
- filename: machines/issuersMachine.ts
|
||||
checksum: 742b8ff561dca61be08ab0b9aef3997ad5d043df298a84c17349dc0206ddcee6
|
||||
- filename: machines/issuersMachine.typegen.ts
|
||||
@@ -164,8 +164,6 @@ fileignoreconfig:
|
||||
checksum: a03c5fa839d761f7bf5bbf0ea9bbd48da57116430a99e1d22f0e7184435d468c
|
||||
- filename: locales/fil.json
|
||||
checksum: 29193fd3b14b7332bf7a485f659197002f29a58af88ed0653cae262e7254c84d
|
||||
- filename: screens/Home/IntroSlidersScreen.tsx
|
||||
checksum: af4a7e2d04b1141b7c32acfabeb3213a32eaca2a8e8f61e6958b6c97219dce57
|
||||
- filename: screens/Home/MyVcs/GetIdInputModal.tsx
|
||||
checksum: 067664e19817d3aba98b0cfa68ef57a04958a982ee23b96b612e4bf466a73890
|
||||
- filename: screens/PasscodeScreen.tsx
|
||||
@@ -212,5 +210,9 @@ fileignoreconfig:
|
||||
checksum: 0ac8c4f3b00138c52d83d719fd8f16c5521290417561c7cf604ade88fa092bc8
|
||||
- filename: injitest/src/test/java/androidTestCases/VcBackupAndRestoreTest.java
|
||||
checksum: cbcbd4c4a185b5af1f23a93467e60cb2128faed718ce2499980e9658e43f19a6
|
||||
version: ""
|
||||
- filename: screens/Home/MyVcsTab.tsx
|
||||
checksum: 8133e2fefddfd0207eb7207b660d317f9a6acafbab6a65762d29ea86e33787cb
|
||||
- filename: components/BackupAndRestoreBannerNotification.tsx
|
||||
checksum: 7bb544ecd2f691f8cef916d0463106ec67645253107dd407236ce3a81f4e9ba7
|
||||
version: ""
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ export const BackupAndRestoreBannerNotification: React.FC = () => {
|
||||
type="error"
|
||||
message={translation}
|
||||
onClosePress={backUpController.DISMISS}
|
||||
key={`backupFailure-${backUpController.backupErrorReason}`}
|
||||
testId={`backupFailure-${backUpController.backupErrorReason}`}
|
||||
key={`backupFailure-${backUpController.backupErrorReason}Popup`}
|
||||
testId={`backupFailure-${backUpController.backupErrorReason}Popup`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -34,10 +34,10 @@ export const BackupAndRestoreBannerNotification: React.FC = () => {
|
||||
return (
|
||||
<BannerNotification
|
||||
type="error"
|
||||
key={`restoreFailure-${restoreController.restoreErrorReason}`}
|
||||
key={`restoreFailure-${restoreController.restoreErrorReason}Popup`}
|
||||
message={translation}
|
||||
onClosePress={restoreController.DISMISS}
|
||||
testId={`restoreFailure-${restoreController.restoreErrorReason}`}
|
||||
testId={`restoreFailure-${restoreController.restoreErrorReason}Popup`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -49,8 +49,8 @@ export const BackupAndRestoreBannerNotification: React.FC = () => {
|
||||
type="success"
|
||||
message={t('backupSuccessful')}
|
||||
onClosePress={backUpController.DISMISS}
|
||||
key={'dataBackupSuccess'}
|
||||
testId={'dataBackupSuccess'}
|
||||
key={'dataBackupSuccessPopup'}
|
||||
testId={'dataBackupSuccessPopup'}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -61,8 +61,8 @@ export const BackupAndRestoreBannerNotification: React.FC = () => {
|
||||
type="success"
|
||||
message={t('restoreSuccessful')}
|
||||
onClosePress={restoreController.DISMISS}
|
||||
key={'restoreBackupSuccess'}
|
||||
testId={'restoreBackupSuccess'}
|
||||
key={'restoreBackupSuccessPopup'}
|
||||
testId={'restoreBackupSuccessPopup'}
|
||||
/>
|
||||
)}
|
||||
{restoreController.isBackUpRestoreFailure && restoreFailure()}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React from 'react';
|
||||
import {Pressable} from 'react-native';
|
||||
import {Pressable, View} from 'react-native';
|
||||
import {Column, Row, Text} from './ui';
|
||||
import {Theme} from './ui/styleUtils';
|
||||
import {Icon} from 'react-native-elements';
|
||||
@@ -7,26 +7,28 @@ import testIDProps from '../shared/commonUtil';
|
||||
|
||||
export const BannerNotification: React.FC<BannerNotificationProps> = props => {
|
||||
return (
|
||||
<Row
|
||||
{...testIDProps(props.testId)}
|
||||
style={[Theme.BannerStyles.container, Theme.BannerStyles[props.type]]}>
|
||||
<Column fill>
|
||||
<Text
|
||||
color={Theme.Colors.whiteText}
|
||||
weight="semibold"
|
||||
style={Theme.BannerStyles.text}>
|
||||
{props.message}
|
||||
</Text>
|
||||
</Column>
|
||||
<Column>
|
||||
<Pressable
|
||||
style={Theme.BannerStyles.dismiss}
|
||||
{...testIDProps('close')}
|
||||
onPress={props.onClosePress}>
|
||||
<Icon name="close" color={Theme.Colors.whiteText} size={19} />
|
||||
</Pressable>
|
||||
</Column>
|
||||
</Row>
|
||||
<View {...testIDProps(props.testId)}>
|
||||
<Row
|
||||
style={[Theme.BannerStyles.container, Theme.BannerStyles[props.type]]}>
|
||||
<Column fill>
|
||||
<Text
|
||||
testID={`${props.testId}Text`}
|
||||
color={Theme.Colors.whiteText}
|
||||
weight="semibold"
|
||||
style={Theme.BannerStyles.text}>
|
||||
{props.message}
|
||||
</Text>
|
||||
</Column>
|
||||
<Column>
|
||||
<Pressable
|
||||
style={Theme.BannerStyles.dismiss}
|
||||
{...testIDProps('close')}
|
||||
onPress={props.onClosePress}>
|
||||
<Icon name="close" color={Theme.Colors.whiteText} size={19} />
|
||||
</Pressable>
|
||||
</Column>
|
||||
</Row>
|
||||
</View>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import VerifiedIcon from '../../VerifiedIcon';
|
||||
import {Column, Row, Text} from '../../ui';
|
||||
import {Theme} from '../../ui/styleUtils';
|
||||
import {CheckBox, Icon} from 'react-native-elements';
|
||||
import {getMaskedText} from '../../../shared/commonUtil';
|
||||
import testIDProps, {getMaskedText} from '../../../shared/commonUtil';
|
||||
import {logoType} from '../../../machines/issuersMachine';
|
||||
import {SvgImage} from '../../ui/svg';
|
||||
|
||||
@@ -89,7 +89,7 @@ const getIssuerLogo = (isOpenId4VCI: boolean, issuerLogo: logoType) => {
|
||||
if (isOpenId4VCI) {
|
||||
return (
|
||||
<Image
|
||||
testID="esignetLogo"
|
||||
{...testIDProps('esignetLogo')}
|
||||
src={issuerLogo?.url}
|
||||
alt={issuerLogo?.alt_text}
|
||||
style={Theme.Styles.issuerLogo}
|
||||
|
||||
@@ -9,6 +9,7 @@ import {SvgImage} from '../ui/svg';
|
||||
export const Issuer: React.FC<IssuerProps> = (props: IssuerProps) => {
|
||||
return (
|
||||
<Pressable
|
||||
accessible={false}
|
||||
{...testIDProps(`issuer-${props.testID}`)}
|
||||
onPress={props.onPress}
|
||||
style={({pressed}) =>
|
||||
|
||||
@@ -24,7 +24,7 @@ export const Loader: React.FC<LoaderProps> = props => {
|
||||
crossAlign="center"
|
||||
fill>
|
||||
<Column margin="24 0" align="space-around">
|
||||
<LoaderAnimation />
|
||||
<LoaderAnimation testID={'loader'} />
|
||||
</Column>
|
||||
{(props.isHintVisible || props.onCancel) && (
|
||||
<Column style={Theme.SelectVcOverlayStyles.timeoutHintContainer}>
|
||||
|
||||
@@ -5,11 +5,14 @@ import {Theme} from './styleUtils';
|
||||
import testIDProps from '../../shared/commonUtil';
|
||||
import {SvgImage} from './svg';
|
||||
|
||||
export const LoaderAnimation: React.FC<LoaderAnimationProps> = ({showLogo}) => {
|
||||
export const LoaderAnimation: React.FC<LoaderAnimationProps> = ({
|
||||
showLogo,
|
||||
testID,
|
||||
}) => {
|
||||
return (
|
||||
<Fragment>
|
||||
{showLogo && SvgImage.ProgressIcon()}
|
||||
<View {...testIDProps('threeDotsLoader')}>
|
||||
<View {...testIDProps(`${testID}-threeDotsLoader`)}>
|
||||
<Spinner
|
||||
type="ThreeBounce"
|
||||
color={Theme.Colors.Loading}
|
||||
@@ -26,4 +29,5 @@ LoaderAnimation.defaultProps = {
|
||||
|
||||
interface LoaderAnimationProps {
|
||||
showLogo?: boolean;
|
||||
testID: string;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ export class SvgImage {
|
||||
}
|
||||
|
||||
static InjiSmallLogo() {
|
||||
return <InjiSmallLogo />;
|
||||
return <InjiSmallLogo {...testIDProps('injiSmallLogo')} />;
|
||||
}
|
||||
|
||||
static ProgressIcon() {
|
||||
|
||||
@@ -8,6 +8,7 @@ import {RootRouteProps} from '../../routes';
|
||||
import {useWelcomeScreen} from '../WelcomeScreenController';
|
||||
import LinearGradient from 'react-native-linear-gradient';
|
||||
import {SvgImage} from '../../components/ui/svg';
|
||||
import testIDProps from '../../shared/commonUtil';
|
||||
|
||||
export const IntroSlidersScreen: React.FC<RootRouteProps> = props => {
|
||||
const slider = useRef<AppIntroSlider>();
|
||||
@@ -61,7 +62,11 @@ export const IntroSlidersScreen: React.FC<RootRouteProps> = props => {
|
||||
|
||||
{item.key !== 'five' && (
|
||||
<Button
|
||||
testID={isPasscodeSet ? 'back' : 'skip'}
|
||||
testID={
|
||||
isPasscodeSet
|
||||
? `backButton-${item.key}`
|
||||
: `skipButton-${item.key}`
|
||||
}
|
||||
type="plain"
|
||||
title={isPasscodeSet ? t('back') : t('skip')}
|
||||
onPress={isPasscodeSet ? controller.BACK : controller.NEXT}
|
||||
@@ -70,25 +75,26 @@ export const IntroSlidersScreen: React.FC<RootRouteProps> = props => {
|
||||
)}
|
||||
</Row>
|
||||
<Image
|
||||
{...testIDProps(`introImage-${item.key}`)}
|
||||
source={item.image}
|
||||
resizeMode="contain"
|
||||
style={{height: Dimensions.get('screen').height * 0.6}}
|
||||
/>
|
||||
<Column
|
||||
testID="introSlide"
|
||||
testID={`introSlide-${item.key}`}
|
||||
style={Theme.OnboardingOverlayStyles.bottomContainer}
|
||||
crossAlign="center"
|
||||
backgroundColor={Theme.Colors.whiteText}
|
||||
width={Dimensions.get('screen').width}>
|
||||
<Text
|
||||
testID="introTitle"
|
||||
testID={`introTitle-${item.key}`}
|
||||
style={{paddingTop: 3}}
|
||||
weight="semibold"
|
||||
margin="0 0 18 0">
|
||||
{item.title}
|
||||
</Text>
|
||||
<Text
|
||||
testID="introText"
|
||||
testID={`introText-${item.key}`}
|
||||
style={{paddingTop: 7}}
|
||||
margin="0 0 150 0"
|
||||
size="large"
|
||||
@@ -103,7 +109,7 @@ export const IntroSlidersScreen: React.FC<RootRouteProps> = props => {
|
||||
|
||||
const renderNextButton = () => {
|
||||
return (
|
||||
<View>
|
||||
<View {...testIDProps('nextButton')}>
|
||||
<LinearGradient
|
||||
colors={Theme.Colors.gradientBtn}
|
||||
style={Theme.Styles.introSliderButton}>
|
||||
@@ -127,7 +133,7 @@ export const IntroSlidersScreen: React.FC<RootRouteProps> = props => {
|
||||
colors={Theme.Colors.gradientBtn}
|
||||
style={Theme.Styles.introSliderButton}>
|
||||
<Text
|
||||
testID="getStarted"
|
||||
testID={controller.isPasscodeSet() ? 'goBack' : 'getStarted'}
|
||||
style={{paddingTop: 3}}
|
||||
weight="semibold"
|
||||
align="center"
|
||||
|
||||
@@ -101,6 +101,7 @@ export const MyVcsTab: React.FC<HomeScreenTabProps> = props => {
|
||||
controller.RESET_STORE_VC_ITEM_STATUS();
|
||||
clearIndividualId();
|
||||
}}
|
||||
key={'downloadingVcPopup'}
|
||||
testId={'downloadingVcPopup'}
|
||||
/>
|
||||
)}
|
||||
|
||||
@@ -37,14 +37,19 @@ export const DataBackupAndRestore: React.FC = ({} = () => {
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Pressable onPress={controller.BACKUP_AND_RESTORE}>
|
||||
<Pressable
|
||||
accessible={false}
|
||||
{...testIDProps('dataBackupAndRestore')}
|
||||
onPress={controller.BACKUP_AND_RESTORE}>
|
||||
<ListItem topDivider bottomDivider>
|
||||
{SvgImage.DataBackupIcon(25, 25)}
|
||||
<ListItem.Content>
|
||||
<ListItem.Title>
|
||||
<ListItem.Title
|
||||
accessible={false}
|
||||
{...testIDProps('dataBackupAndRestoreText')}>
|
||||
<Row>
|
||||
<Text
|
||||
testID="dataBackupAndRestore"
|
||||
testID="dataBackupAndRestoreText"
|
||||
weight="semibold"
|
||||
color={Theme.Colors.settingsLabel}
|
||||
style={{paddingRight: 10, paddingTop: 10}}>
|
||||
@@ -64,7 +69,7 @@ export const DataBackupAndRestore: React.FC = ({} = () => {
|
||||
<Icon
|
||||
name="chevron-right"
|
||||
size={21}
|
||||
{...testIDProps('rightArrowIcon')}
|
||||
{...testIDProps('dataBackupAndRestoreChevronRight')}
|
||||
color={Theme.Colors.chevronRightColor}
|
||||
style={{marginRight: 15}}
|
||||
/>
|
||||
|
||||
@@ -44,9 +44,9 @@ const BackupAndRestoreScreen: React.FC<BackupAndRestoreProps> = props => {
|
||||
props.shouldTriggerAutoBackup,
|
||||
]);
|
||||
|
||||
const Loading = (
|
||||
const Loading = testID => (
|
||||
<Centered fill>
|
||||
<LoaderAnimation showLogo={false} />
|
||||
<LoaderAnimation testID={testID} showLogo={false} />
|
||||
</Centered>
|
||||
);
|
||||
|
||||
@@ -110,7 +110,7 @@ const BackupAndRestoreScreen: React.FC<BackupAndRestoreProps> = props => {
|
||||
</Row>
|
||||
<Row style={Theme.BackupAndRestoreStyles.actionOrLoaderContainer}>
|
||||
{backupController.isBackupInProgress ? (
|
||||
Loading
|
||||
Loading('backup')
|
||||
) : (
|
||||
<Button
|
||||
testID="backup"
|
||||
@@ -166,7 +166,7 @@ const BackupAndRestoreScreen: React.FC<BackupAndRestoreProps> = props => {
|
||||
</Row>
|
||||
<Row style={Theme.BackupAndRestoreStyles.actionOrLoaderContainer}>
|
||||
{restoreController.isBackUpRestoring ? (
|
||||
Loading
|
||||
Loading('restore')
|
||||
) : (
|
||||
<Button
|
||||
testID="restore"
|
||||
@@ -212,7 +212,7 @@ const BackupAndRestoreScreen: React.FC<BackupAndRestoreProps> = props => {
|
||||
}}>
|
||||
{props.isLoading || backupController.isLoading ? (
|
||||
<Column fill align="center" crossAlign="center">
|
||||
<LoaderAnimation />
|
||||
<LoaderAnimation testID="backupAndRestoreScreen" />
|
||||
</Column>
|
||||
) : (
|
||||
<ScrollView>
|
||||
|
||||
Reference in New Issue
Block a user