test: add edgeless item test id for test

This commit is contained in:
tzhangchi
2022-12-23 19:56:07 +08:00
parent 661d3fe0b4
commit 0599f5cbdd
2 changed files with 4 additions and 6 deletions
@@ -127,6 +127,7 @@ export const EditorModeSwitch = ({
<AnimateRadioItem
isLeft={false}
label="Edgeless"
data-testid="edgeless-item"
icon={<EdgelessItem />}
active={mode === 'edgeless'}
status={radioItemStatus.right}
+3 -6
View File
@@ -11,12 +11,9 @@ test.describe('Change page mode(Paper or Edgeless)', () => {
// mouse hover trigger animation for showing full switcher
await page.mouse.move((box?.x ?? 0) + 5, (box?.y ?? 0) + 5);
await page.waitForTimeout(1000);
const edgelessButton = page
.getByTestId('editor-mode-switcher')
.locator('div')
.filter({ hasText: 'Edgeless' })
.first(); // page.getByText('Edgeless').click()
// await page.waitForTimeout(1000);
const edgelessButton = page.getByTestId('edgeless-item'); // page.getByText('Edgeless').click()
await edgelessButton.click();
// // mouse move to edgeless button