Skip to content

Commit

Permalink
feat(tests): add tests for mobile explorer rename
Browse files Browse the repository at this point in the history
  • Loading branch information
CatsJuice committed Oct 30, 2024
1 parent 26b2415 commit ba03769
Show file tree
Hide file tree
Showing 15 changed files with 263 additions and 19 deletions.
1 change: 1 addition & 0 deletions packages/frontend/component/src/ui/button/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export interface ButtonProps
tooltip?: TooltipProps['content'];
tooltipShortcut?: TooltipProps['shortcut'];
tooltipOptions?: Partial<Omit<TooltipProps, 'content' | 'shortcut'>>;
[key: `data-${string}`]: string;
}

const IconSlot = ({
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/component/src/ui/input/row-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export type RowInputProps = {
type?: HTMLInputElement['type'];
style?: CSSProperties;
onEnter?: () => void;
[key: `data-${string}`]: string;
} & Omit<InputHTMLAttributes<HTMLInputElement>, 'onChange' | 'size' | 'onBlur'>;

// RowInput component that is used in the selector layout for search input
Expand Down
4 changes: 3 additions & 1 deletion packages/frontend/component/src/ui/menu/menu.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ export interface MenuItemProps
export interface MenuSubProps {
children: ReactNode;
items: ReactNode;
triggerOptions?: Omit<MenuItemProps, 'onSelect' | 'children'>;
triggerOptions?: Omit<MenuItemProps, 'onSelect' | 'children'> & {
[key: `data-${string}`]: string;
};
portalOptions?: Omit<DropdownMenuPortalProps, 'children'>;
subOptions?: Omit<DropdownMenuSubProps, 'children'>;
subContentOptions?: Omit<DropdownMenuSubContentProps, 'children'>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,14 +174,14 @@ const ExplorerFolderNodeFolder = ({
setCollapsed(false);
}, [createPage, node]);

const handleCreateSubfolder = useCallback(() => {
node.createFolder(
t['com.affine.rootAppSidebar.organize.new-folders'](),
node.indexAt('before')
);
track.$.navigationPanel.organize.createOrganizeItem({ type: 'folder' });
setCollapsed(false);
}, [node, t]);
const handleCreateSubfolder = useCallback(
(name: string) => {
node.createFolder(name, node.indexAt('before'));
track.$.navigationPanel.organize.createOrganizeItem({ type: 'folder' });
setCollapsed(false);
},
[node]
);

const handleAddToFolder = useCallback(
(type: 'doc' | 'collection' | 'tag') => {
Expand Down Expand Up @@ -255,7 +255,13 @@ const ExplorerFolderNodeFolder = ({
{
index: 98,
view: (
<FolderRenameSubMenu initialName={name} onConfirm={handleRename} />
<FolderRenameSubMenu
initialName={name}
onConfirm={handleRename}
menuProps={{
triggerOptions: { 'data-testid': 'rename-folder' },
}}
/>
),
},
{
Expand All @@ -275,6 +281,9 @@ const ExplorerFolderNodeFolder = ({
onConfirm={handleCreateSubfolder}
descRenderer={createSubTipRenderer}
icon={<FolderIcon />}
menuProps={{
triggerOptions: { 'data-testid': 'create-subfolder' },
}}
/>
),
},
Expand Down Expand Up @@ -404,6 +413,8 @@ const ExplorerFolderNodeFolder = ({
setCollapsed={handleCollapsedChange}
operations={finalOperations}
data-testid={`explorer-folder-${node.id}`}
aria-label={name}
data-role="explorer-folder"
>
{children.map(child => (
<ExplorerFolderNode
Expand All @@ -415,6 +426,7 @@ const ExplorerFolderNodeFolder = ({
<AddItemPlaceholder
label={t['com.affine.rootAppSidebar.organize.folder.add-docs']()}
onClick={() => handleAddToFolder('doc')}
data-testid="new-folder-in-folder-button"
/>
</ExplorerTreeNode>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useMobileMenuController } from '@affine/component';
import { type MenuSubProps, useMobileMenuController } from '@affine/component';
import { TagService } from '@affine/core/modules/tag';
import { useI18n } from '@affine/i18n';
import { useLiveData, useService } from '@toeverything/infra';
Expand Down Expand Up @@ -37,6 +37,7 @@ const ColorPickerTrigger = () => {
const { color, show, setShow } = useContext(TagColorContext);
return (
<div
data-testid="tag-color-picker-trigger"
className={styles.colorTrigger}
style={{ color }}
data-active={show}
Expand All @@ -58,17 +59,19 @@ const ColorPickerSelect = () => {

return (
<div
data-testid="tag-color-picker-select"
className={styles.colorsRow}
data-active={show}
data-enable-fold={enableAnimation || undefined}
>
{colors.map(color => (
<div
key={color}
aria-checked={color === current}
onClick={() => setColor(color)}
key={color}
className={styles.colorDot}
style={{ color }}
data-color={color}
/>
))}
</div>
Expand Down Expand Up @@ -153,12 +156,14 @@ interface TagRenameSubMenuProps {
icon?: ReactNode;
text?: string;
onConfirm?: (name: string, color: string) => void;
menuProps?: Partial<MenuSubProps>;
}
export const TagRenameSubMenu = ({
tagId,
title,
icon,
text,
menuProps,
onConfirm,
}: TagRenameSubMenuProps) => {
const t = useI18n();
Expand All @@ -181,6 +186,7 @@ export const TagRenameSubMenu = ({
title={title ?? t['com.affine.m.explorer.tag.rename-menu-title']()}
icon={icon}
text={text}
menuProps={menuProps}
>
<TagRenameContent
initialName={tagName}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const ExplorerTagNode = ({
return (
<div className={clsx(styles.tagIconContainer, className)}>
<div
data-testid="explorer-tag-icon-dot"
className={styles.tagIcon}
style={{
backgroundColor: tagColor,
Expand Down Expand Up @@ -85,6 +86,8 @@ export const ExplorerTagNode = ({
active={active}
operations={finalOperations}
data-testid={`explorer-tag-${tagId}`}
aria-label={tagName}
data-role="explorer-tag"
>
<ExplorerTagNodeDocs tag={tagRecord} onNewDoc={handleNewDoc} />
</ExplorerTreeNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,11 @@ export const useExplorerTagNodeOperationsMenu = (
{
index: 10,
view: (
<TagRenameSubMenu onConfirm={handleChangeNameOrColor} tagId={tagId} />
<TagRenameSubMenu
onConfirm={handleChangeNameOrColor}
tagId={tagId}
menuProps={{ triggerOptions: { 'data-testid': 'rename-tag' } }}
/>
),
},
...(BUILD_CONFIG.isElectron && enableMultiView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export const ExplorerTags = () => {
<ExplorerTagNode key={tag.id} tagId={tag.id} />
))}
<AddItemPlaceholder
data-testid="explorer-bar-add-favorite-button"
data-testid="explorer-add-tag-button"
onClick={() => setShowNewTagDialog(true)}
label={t[
'com.affine.rootAppSidebar.explorer.tag-section-add-tooltip'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export const ExplorerTreeNode = ({
<Fragment key={index}>{view}</Fragment>
))}
>
<div className={styles.iconContainer}>
<div className={styles.iconContainer} data-testid="menu-trigger">
{emoji ?? (Icon && <Icon collapsed={collapsed} />)}
</div>
</MobileMenu>
Expand Down
15 changes: 13 additions & 2 deletions packages/frontend/core/src/mobile/components/rename/content.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { Button, RowInput } from '@affine/component';
import { useI18n } from '@affine/i18n';
import clsx from 'clsx';
import { useCallback, useState } from 'react';

import * as styles from './content.css';
import type { RenameContentProps } from './type';

export const RenameContent = ({
initialName = '',
inputProps,
confirmButtonProps,
inputPrefixRenderer: InputPrefixRenderer,
inputBelowRenderer: InputBelowRenderer,
descRenderer: DescRenderer,
Expand All @@ -16,6 +19,10 @@ export const RenameContent = ({
const t = useI18n();
const [value, setValue] = useState(initialName);

const { className: inputClassName, ...restInputProps } = inputProps ?? {};
const { className: confirmButtonClassName, ...restConfirmButtonProps } =
confirmButtonProps ?? {};

const handleDone = useCallback(() => {
onConfirm?.(value);
}, [onConfirm, value]);
Expand All @@ -26,9 +33,11 @@ export const RenameContent = ({
{InputPrefixRenderer ? <InputPrefixRenderer input={value} /> : null}
<RowInput
autoFocus
className={styles.input}
className={clsx(styles.input, inputClassName)}
value={value}
onChange={setValue}
data-testid="rename-input"
{...restInputProps}
/>
</div>
{}
Expand All @@ -42,11 +51,13 @@ export const RenameContent = ({
</div>
<div className={styles.doneWrapper}>
<Button
className={styles.done}
className={clsx(styles.done, confirmButtonClassName)}
onClick={handleDone}
disabled={!value}
variant="primary"
size="extraLarge"
data-testid="rename-confirm"
{...restConfirmButtonProps}
>
{confirmText}
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export const RenameSubMenu = ({
icon,
text,
children,
menuProps,
onConfirm,
...props
}: RenameSubMenuProps) => {
Expand All @@ -26,9 +27,14 @@ export const RenameSubMenu = ({
[close, onConfirm]
);

const { triggerOptions, ...otherMenuProps } = menuProps ?? {};
return (
<MobileMenuSub
triggerOptions={{ prefixIcon: icon ?? <EditIcon />, suffixIcon: null }}
triggerOptions={{
prefixIcon: icon ?? <EditIcon />,
suffixIcon: null,
...triggerOptions,
}}
items={
children ?? (
<RenameContent
Expand All @@ -39,6 +45,7 @@ export const RenameSubMenu = ({
)
}
title={title}
{...otherMenuProps}
>
{text ?? t['com.affine.m.explorer.folder.rename']()}
</MobileMenuSub>
Expand Down
8 changes: 8 additions & 0 deletions packages/frontend/core/src/mobile/components/rename/type.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
import type {
ButtonProps,
MenuSubProps,
RowInputProps,
} from '@affine/component';
import type { PropsWithChildren, ReactNode } from 'react';

export interface RenameBaseProps {
Expand All @@ -6,6 +11,8 @@ export interface RenameBaseProps {
}

export interface RenameContentProps extends RenameBaseProps {
inputProps?: Omit<RowInputProps, 'value' | 'onChange'>;
confirmButtonProps?: Omit<ButtonProps, 'onClick' | 'children'>;
confirmText?: string;
inputPrefixRenderer?: (props: { input: string }) => ReactNode;
descRenderer?: (props: { input: string }) => ReactNode;
Expand All @@ -20,6 +27,7 @@ export interface RenameSubMenuProps
icon?: ReactNode;
/** MenuItem.text */
text?: string;
menuProps?: Partial<MenuSubProps>;
}

export interface RenameDialogProps
Expand Down
76 changes: 76 additions & 0 deletions tests/affine-mobile/e2e/explorer-folder.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import { test } from '@affine-test/kit/mobile';

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (1)

[Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (1)

[Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (1)

[Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (1)

[Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #3 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (2)

[Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it

1) [Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it ──────────────── Test timeout of 60000ms exceeded while setting up "page".

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (2)

[Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it

1) [Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it ──────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (2)

[Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it

1) [Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it ──────────────── Retry #3 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (4)

[Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (4)

[Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (4)

[Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (4)

[Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #3 ─────────────────────────────────────────────────────────────────────────────────────── Test timeout of 60000ms exceeded.

Check failure on line 1 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (4)

[Mobile Chrome] › explorer-folder.spec.ts:62:5 › create a folder and rename it

2) [Mobile Chrome] › explorer-folder.spec.ts:62:5 › create a folder and rename it ──────────────── Test timeout of 60000ms exceeded.
import { expect, type Locator, type Page } from '@playwright/test';

import {
expandCollapsibleSection,
getAttrOfActiveElement,
openExplorerNodeMenu,
} from './utils';

const locateFolder = async (scope: Page | Locator, name: string) => {
return scope.locator(`[data-role="explorer-folder"][aria-label="${name}"]`);
};

/**
* Check rename input is focused
*/
const isRenameInputFocused = async (page: Page) => {
const focusElTestid = await getAttrOfActiveElement(page);
expect(focusElTestid).toEqual('rename-input');

Check failure on line 19 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (2)

[Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it

1) [Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it ──────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: expect(received).toEqual(expected) // deep equality Expected: "rename-input" Received: null 17 | const isRenameInputFocused = async (page: Page) => { 18 | const focusElTestid = await getAttrOfActiveElement(page); > 19 | expect(focusElTestid).toEqual('rename-input'); | ^ 20 | }; 21 | 22 | const createRootFolder = async (page: Page, name: string) => { at isRenameInputFocused (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:19:25) at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:69:3
};

const createRootFolder = async (page: Page, name: string) => {
const section = await expandCollapsibleSection(page, 'organize');
await section.getByTestId('explorer-bar-add-organize-button').tap();
const dialog = page.getByRole('dialog');
await expect(dialog).toBeVisible();
await isRenameInputFocused(page);
await page.keyboard.type(name);
await dialog.getByTestId('rename-confirm').tap();
await expect(dialog).not.toBeVisible();
const node = await locateFolder(section, name);
return node;
};

const createSubFolder = async (page: Page, parent: Locator, name: string) => {
const menu = await openExplorerNodeMenu(page, parent);
await menu.getByTestId('create-subfolder').tap();

const dialog = page.getByRole('dialog');
await expect(dialog).toBeVisible();
await isRenameInputFocused(page);
await page.keyboard.type(name);
await dialog.getByTestId('folder-rename-confirm').tap();

Check failure on line 43 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (1)

[Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 41 | await isRenameInputFocused(page); 42 | await page.keyboard.type(name); > 43 | await dialog.getByTestId('folder-rename-confirm').tap(); | ^ 44 | await expect(dialog).not.toBeVisible(); 45 | const node = await locateFolder(parent, name); 46 | return node; at createSubFolder (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:43:53) at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:58:17

Check failure on line 43 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (1)

[Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 41 | await isRenameInputFocused(page); 42 | await page.keyboard.type(name); > 43 | await dialog.getByTestId('folder-rename-confirm').tap(); | ^ 44 | await expect(dialog).not.toBeVisible(); 45 | const node = await locateFolder(parent, name); 46 | return node; at createSubFolder (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:43:53) at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:58:17

Check failure on line 43 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (1)

[Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 41 | await isRenameInputFocused(page); 42 | await page.keyboard.type(name); > 43 | await dialog.getByTestId('folder-rename-confirm').tap(); | ^ 44 | await expect(dialog).not.toBeVisible(); 45 | const node = await locateFolder(parent, name); 46 | return node; at createSubFolder (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:43:53) at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:58:17

Check failure on line 43 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (1)

[Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Safari] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #3 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 41 | await isRenameInputFocused(page); 42 | await page.keyboard.type(name); > 43 | await dialog.getByTestId('folder-rename-confirm').tap(); | ^ 44 | await expect(dialog).not.toBeVisible(); 45 | const node = await locateFolder(parent, name); 46 | return node; at createSubFolder (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:43:53) at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:58:17

Check failure on line 43 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (4)

[Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 41 | await isRenameInputFocused(page); 42 | await page.keyboard.type(name); > 43 | await dialog.getByTestId('folder-rename-confirm').tap(); | ^ 44 | await expect(dialog).not.toBeVisible(); 45 | const node = await locateFolder(parent, name); 46 | return node; at createSubFolder (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:43:53) at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:58:17

Check failure on line 43 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (4)

[Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 41 | await isRenameInputFocused(page); 42 | await page.keyboard.type(name); > 43 | await dialog.getByTestId('folder-rename-confirm').tap(); | ^ 44 | await expect(dialog).not.toBeVisible(); 45 | const node = await locateFolder(parent, name); 46 | return node; at createSubFolder (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:43:53) at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:58:17

Check failure on line 43 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (4)

[Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #2 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 41 | await isRenameInputFocused(page); 42 | await page.keyboard.type(name); > 43 | await dialog.getByTestId('folder-rename-confirm').tap(); | ^ 44 | await expect(dialog).not.toBeVisible(); 45 | const node = await locateFolder(parent, name); 46 | return node; at createSubFolder (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:43:53) at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:58:17

Check failure on line 43 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (4)

[Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder

1) [Mobile Chrome] › explorer-folder.spec.ts:54:5 › create a sub folder ────────────────────────── Retry #3 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 41 | await isRenameInputFocused(page); 42 | await page.keyboard.type(name); > 43 | await dialog.getByTestId('folder-rename-confirm').tap(); | ^ 44 | await expect(dialog).not.toBeVisible(); 45 | const node = await locateFolder(parent, name); 46 | return node; at createSubFolder (/home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:43:53) at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:58:17
await expect(dialog).not.toBeVisible();
const node = await locateFolder(parent, name);
return node;
};

test('create a folder', async ({ page }) => {
const node = await createRootFolder(page, 'Test Folder');
await expect(node).toBeVisible();
});

test('create a sub folder', async ({ page }) => {
const parent = await createRootFolder(page, 'Parent Folder');
await expect(parent).toBeVisible();
await parent.tap();
const child = await createSubFolder(page, parent, 'Child Folder');
await expect(child).toBeVisible();
});

test('create a folder and rename it', async ({ page }) => {
const originalName = 'Test Folder';
const appendedName = ' Renamed';

const folder = await createRootFolder(page, originalName);
const menu = await openExplorerNodeMenu(page, folder);
await menu.getByTestId('rename-folder').tap();
await isRenameInputFocused(page);
await page.keyboard.type(appendedName);
await menu.getByTestId('folder-rename-confirm').tap();

Check failure on line 71 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (2)

[Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it

1) [Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it ──────────────── Retry #1 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 69 | await isRenameInputFocused(page); 70 | await page.keyboard.type(appendedName); > 71 | await menu.getByTestId('folder-rename-confirm').tap(); | ^ 72 | 73 | const renamedFolder = await locateFolder(page, originalName + appendedName); 74 | await expect(folder).not.toBeVisible(); at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:71:51

Check failure on line 71 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (2)

[Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it

1) [Mobile Safari] › explorer-folder.spec.ts:62:5 › create a folder and rename it ──────────────── Retry #3 ─────────────────────────────────────────────────────────────────────────────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 69 | await isRenameInputFocused(page); 70 | await page.keyboard.type(appendedName); > 71 | await menu.getByTestId('folder-rename-confirm').tap(); | ^ 72 | 73 | const renamedFolder = await locateFolder(page, originalName + appendedName); 74 | await expect(folder).not.toBeVisible(); at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:71:51

Check failure on line 71 in tests/affine-mobile/e2e/explorer-folder.spec.ts

View workflow job for this annotation

GitHub Actions / E2E Mobile Test (4)

[Mobile Chrome] › explorer-folder.spec.ts:62:5 › create a folder and rename it

2) [Mobile Chrome] › explorer-folder.spec.ts:62:5 › create a folder and rename it ──────────────── Error: locator.tap: Test timeout of 60000ms exceeded. Call log: - waiting for getByRole('dialog').getByTestId('folder-rename-confirm') 69 | await isRenameInputFocused(page); 70 | await page.keyboard.type(appendedName); > 71 | await menu.getByTestId('folder-rename-confirm').tap(); | ^ 72 | 73 | const renamedFolder = await locateFolder(page, originalName + appendedName); 74 | await expect(folder).not.toBeVisible(); at /home/runner/work/AFFiNE/AFFiNE/tests/affine-mobile/e2e/explorer-folder.spec.ts:71:51

const renamedFolder = await locateFolder(page, originalName + appendedName);
await expect(folder).not.toBeVisible();
await expect(renamedFolder).toBeVisible();
});
Loading

0 comments on commit ba03769

Please sign in to comment.