[INJIMOB-3301]: Fix for history page - close icon test id (#1968)

* [INJIMOB-3301]: Fix for history page - close icon test id

Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>

* [INJIMOB-3301]: Fix in automation side for testId `close`

Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>

---------

Signed-off-by: BalachandarG <balachandar.g@thoughtworks.com>
This commit is contained in:
balachandarg-tw
2025-06-20 21:23:14 +05:30
committed by GitHub
parent 62ff17bf05
commit 3ac339352f
2 changed files with 33 additions and 30 deletions

View File

@@ -1,5 +1,10 @@
import React from 'react';
import {I18nManager, Modal as RNModal, View} from 'react-native';
import {
I18nManager,
Modal as RNModal,
TouchableOpacity,
View,
} from 'react-native';
import {Icon} from 'react-native-elements';
import {Column, Row, Text} from '.';
import {useSendVcScreen} from '../../screens/Scan/SendVcScreenController';
@@ -9,23 +14,23 @@ import testIDProps from '../../shared/commonUtil';
import {BackButton} from './backButton/BackButton';
export const Modal: React.FC<ModalProps> = ({
testID,
isVisible,
requester,
showClose = true,
showHeader = true,
modalStyle = Theme.ModalStyles.defaultModal,
onDismiss,
headerTitle,
headerElevation,
headerLabel,
headerLabelColor,
headerRight,
headerLeft,
arrowLeft,
onShow,
children,
}) => {
testID,
isVisible,
requester,
showClose = true,
showHeader = true,
modalStyle = Theme.ModalStyles.defaultModal,
onDismiss,
headerTitle,
headerElevation,
headerLabel,
headerLabelColor,
headerRight,
headerLeft,
arrowLeft,
onShow,
children,
}) => {
const controller = useSendVcScreen();
return (
@@ -83,13 +88,11 @@ export const Modal: React.FC<ModalProps> = ({
{headerRight != null ||
arrowLeft ||
(showClose && (
<Icon
<TouchableOpacity
{...testIDProps('close')}
name="close"
onPress={onDismiss}
color={Theme.Colors.Details}
size={27}
/>
onPress={onDismiss}>
<Icon name="close" color={Theme.Colors.Details} size={27} />
</TouchableOpacity>
))}
{headerRight && headerRight}
</View>
@@ -118,4 +121,4 @@ export interface ModalProps {
arrowLeft?: boolean;
onShow?: () => void;
children?: React.ReactNode;
}
}

View File

@@ -31,9 +31,9 @@ public class HomePage extends BasePage {
@AndroidFindBy(accessibility = "ellipsis")
private WebElement moreOptionsButton;
@iOSXCUITFindBy(accessibility = "iconIcon")
@AndroidFindBy(accessibility = "iconIcon")
private WebElement iconIconButton;
@iOSXCUITFindBy(accessibility = "close")
@AndroidFindBy(accessibility = "close")
private WebElement closeButton;
@iOSXCUITFindBy(xpath = "(//XCUIElementTypeOther[@name=\"ellipsis\"])[2]")
@AndroidFindBy(xpath = "(//android.view.ViewGroup[@content-desc=\"ellipsis\"])[2]")
@@ -828,7 +828,7 @@ public class HomePage extends BasePage {
}
public void clickOnCrossIconButton() {
clickOnElement(iconIconButton);
clickOnElement(closeButton);
}
}
}