Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Harmoni aid e2e testing #2702

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/harmoni-aids/components/cart/cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { CartProps } from './cart.types'
import CartList from './cart-list'
import Styles from './cart.module.css'
import { Loader, Typography, Button as BecknButton, Button } from '@beckn-ui/molecules'
import { testIds } from '@shared/dataTestIds'

const Cart: React.FC<CartProps> = ({
schema: { loader, cartItems, actionButton, emptyCard }, // Destructure props
Expand Down Expand Up @@ -81,6 +82,7 @@ const Cart: React.FC<CartProps> = ({
<Typography
variant="subTitleRegular"
text="Request Overview"
dataTest={testIds.request_overview}
sx={{ paddingTop: '20px' }}
/>
<CartList cartItems={cartItems} />
Expand Down
1 change: 1 addition & 0 deletions apps/harmoni-aids/components/cart/cart.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export interface CartProps {
loader: LoaderProps
emptyCard?: EmptyCardProps
actionButton?: {
dataTest?: string
text: string
handleOnClick: MouseEventHandler<HTMLButtonElement>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Box, CardBody, Flex, Icon, Image, Stack, Card, useTheme, Text } from '@
import { Typography } from '@beckn-ui/molecules'
import { StarIcon, TimeIcon } from '@chakra-ui/icons'
import { CurrencyType, ProductPrice } from '@beckn-ui/becknified-components'
import { testIds } from '@shared/dataTestIds'

type FrequentlyAccessedProps = {
frequentlyAccessedData: Array<{
Expand Down Expand Up @@ -33,6 +34,7 @@ const FrequentlyAccessed: React.FC<FrequentlyAccessedProps> = ({ frequentlyAcces
fontSize="17px"
fontWeight="400"
text="Frequently Accessed"
data-test={testIds.Frequently_accessed_text}
sx={{ mb: '20px' }}
/>

Expand All @@ -45,6 +47,7 @@ const FrequentlyAccessed: React.FC<FrequentlyAccessedProps> = ({ frequentlyAcces
>
{frequentlyAccessedData.map((item, index) => (
<Card
data-test={testIds.Frequently_accessed_item}
key={index}
mb={'20px'}
boxShadow={'0px 8px 10px -6px rgba(0, 0, 0, 0.1), 0px 20px 25px -5px rgba(0, 0, 0, 0.1)'}
Expand Down
1 change: 1 addition & 0 deletions apps/harmoni-aids/pages/cart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ const RequestOverview = () => {
},
actionButton: {
text: 'Proceed',
dataTest: testIds.Proceed,
handleOnClick: () => {
router.push('/checkout')
}
Expand Down
1 change: 1 addition & 0 deletions apps/harmoni-aids/pages/orderHistory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ const OrderHistory = () => {
text={order.attributes.items[0].name}
fontWeight="600"
fontSize={'15px'}
dataTest="order_history_item_name"
/>
<Text
as={Typography}
Expand Down
8 changes: 6 additions & 2 deletions apps/harmoni-aids/pages/product.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,13 @@ const Product = () => {
<Typography
text={`About ${selectedProduct.providerName}`}
fontWeight={'800'}
dataTest={testIds.item_title}
/>
<Typography text={selectedProduct.item.short_desc!} />
<Typography
text={selectedProduct.item.productInfo! as string}
style={{ marginTop: '1rem' }}
dataTest={testIds.product_page_short_desc}
/>
</Box>

Expand Down Expand Up @@ -180,6 +182,7 @@ const Product = () => {
textDecoration="underline"
href="https://www.google.com"
target="_blank"
data-test={testIds.TermsandConditions_link}
>
Terms and Conditions
</Link>
Expand All @@ -196,12 +199,13 @@ const Product = () => {
mr="20px"
>
<Button
text="proceed"
text="Proceed"
dataTest={testIds.Proceed_to_product}
disabled={!checkIsDisabled()}
handleClick={handleOnProceed}
/>
</Box>
** Contains non-personal data only
** Contains non-personal data only dataTest={testIds.disclaimer_text}
</Flex>
</Box>
)
Expand Down
Loading