Skip to content

Commit 244d656

Browse files
Add test id to preserve the button for e2e appium tests on ios
1 parent 3ce3a61 commit 244d656

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/components/StyledButton.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@ import {
1010
} from 'react-native';
1111

1212
export const StyledButton = ({
13+
testID,
1314
onPress,
1415
title,
1516
style,
1617
isLoading,
1718
}: {
19+
testID?: string;
1820
style?: {
1921
default?: ViewStyle;
2022
pressed?: ViewStyle;
@@ -56,6 +58,7 @@ export const StyledButton = ({
5658
const InnerContent = isLoading ? InnerLoader : InnerText;
5759
return (
5860
<Pressable
61+
testID={testID}
5962
onPress={onPress}
6063
style={pressableStyle}
6164
onPressIn={() => setIsPressed(true)}

src/components/StyledProductCard.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export const StyledProductCard = (props: {
4747
</View>
4848
<View style={styles.cardDetailAction}>
4949
<StyledButton
50+
testID={`add-to-cart-button-${props.id}`}
5051
title="Add to cart"
5152
onPress={onAddToCartPressed}
5253
style={{

0 commit comments

Comments
 (0)