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

test(playwright): adding data-testid to support e2e tests #744

Closed
wants to merge 3 commits into from
Closed
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
6 changes: 5 additions & 1 deletion src/custom/TransferModal/TransferList/TransferList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ function TransferList({
listId?: string
) => (
<StyledPaper>
<List dense component="div" role="list">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's better to use test id in meshery/meshery as the parent of this sistent element, and find them by role or aria-label. It's enough to distinguish the element i think. Wdyt?

https://playwright.dev/docs/api/class-framelocator#frame-locator-get-by-label

<List dense component="div" role="list" data-testid={`connections-${listId}`}>
{items.length > 0 ? (
items.map((item) => {
const labelId = `transfer-list-item-${item.name}-label`;
Expand Down Expand Up @@ -302,6 +302,7 @@ function TransferList({
(rightPermission && (left?.length === 0 || left.length < leftCount))
}
aria-label="move all right"
data-testid="move-all-right"
>
<RightArrowIcon width={18} height={18} />
<RightArrowIcon style={{ position: 'absolute', left: '27px' }} width={18} height={18} />
Expand All @@ -312,6 +313,7 @@ function TransferList({
onClick={handleCheckedRight}
disabled={!rightPermission || (rightPermission && leftChecked.length === 0)}
aria-label="move selected right"
data-testid="move-selected-right"
>
<RightArrowIcon width={18} height={18} />
</TransferButton>
Expand All @@ -321,6 +323,7 @@ function TransferList({
onClick={handleCheckedLeft}
disabled={!leftPermission || (leftPermission && rightChecked.length === 0)}
aria-label="move selected left"
data-testid="move-selected-left"
>
<LeftArrowIcon width={18} height={18} />
</TransferButton>
Expand All @@ -333,6 +336,7 @@ function TransferList({
(leftPermission && (right?.length === 0 || right.length < rightCount))
}
aria-label="move all left"
data-testid="move-all-left"
>
<LeftArrowIcon width={18} height={18} />
<LeftArrowIcon style={{ position: 'absolute', left: '27px' }} width={18} height={18} />
Expand Down
Loading