Skip to content

Commit 3710ebb

Browse files
add getShapeBackgroundColor helper for property testing
1 parent b777a93 commit 3710ebb

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

e2e/helpers/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './konva-testing.helpers';
22
export * from './position.helpers';
3+
export * from './properties.helpers';

e2e/helpers/properties.helpers.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Page } from '@playwright/test';
2+
import { getByShapeType } from './konva-testing.helpers';
3+
import { Group } from 'konva/lib/Group';
4+
5+
export const getShapeBackgroundColor = async (
6+
page: Page,
7+
shapeType: string
8+
): Promise<string> => {
9+
const shape = (await getByShapeType(page, shapeType)) as Group;
10+
return shape?.children?.[0]?.attrs?.fill;
11+
};

0 commit comments

Comments
 (0)