diff --git a/packages/web/src/components/AccountDropdownMenu/index.tsx b/packages/web/src/components/AccountDropdownMenu/index.tsx index 31ee564e..4f2dbbf7 100644 --- a/packages/web/src/components/AccountDropdownMenu/index.tsx +++ b/packages/web/src/components/AccountDropdownMenu/index.tsx @@ -62,6 +62,7 @@ function AccountDropdownMenu(props: AccountDropdownMenuProps): React.ReactElemen {formatMessage('accountDropdownMenu.logout')} diff --git a/packages/web/src/components/AddAppConnection/index.tsx b/packages/web/src/components/AddAppConnection/index.tsx index 3759514b..193bcde9 100644 --- a/packages/web/src/components/AddAppConnection/index.tsx +++ b/packages/web/src/components/AddAppConnection/index.tsx @@ -84,7 +84,7 @@ export default function AddAppConnection(props: AddAppConnectionProps): React.Re }, [connectionId, key, steps, onClose]); return ( - + {hasConnection ? formatMessage('app.reconnectConnection') : formatMessage('app.addConnection')} @@ -114,6 +114,7 @@ export default function AddAppConnection(props: AddAppConnectionProps): React.Re color="primary" sx={{ boxShadow: 2 }} loading={inProgress} + data-test="create-connection-button" > {formatMessage('addAppConnection.submit')} diff --git a/packages/web/src/components/AddNewAppConnection/index.tsx b/packages/web/src/components/AddNewAppConnection/index.tsx index 7bc02166..b14745b9 100644 --- a/packages/web/src/components/AddNewAppConnection/index.tsx +++ b/packages/web/src/components/AddNewAppConnection/index.tsx @@ -95,6 +95,7 @@ export default function AddNewAppConnection(props: AddNewAppConnectionProps): Re } label={formatMessage('apps.searchApp')} + data-test="search-for-app-text-field" /> @@ -102,7 +103,7 @@ export default function AddNewAppConnection(props: AddNewAppConnectionProps): Re {loading && } {!loading && data?.getApps?.map((app: IApp) => ( - + diff --git a/packages/web/src/components/AppBar/index.tsx b/packages/web/src/components/AppBar/index.tsx index d248b672..b168b645 100644 --- a/packages/web/src/components/AppBar/index.tsx +++ b/packages/web/src/components/AppBar/index.tsx @@ -82,6 +82,7 @@ export default function AppBar(props: AppBarProps): React.ReactElement { onClick={handleAccountMenuOpen} aria-controls={accountMenuId} aria-label="open profile menu" + data-test="profile-menu-button" > diff --git a/packages/web/src/components/AppConnectionRow/index.tsx b/packages/web/src/components/AppConnectionRow/index.tsx index b85a2328..55a82904 100644 --- a/packages/web/src/components/AppConnectionRow/index.tsx +++ b/packages/web/src/components/AppConnectionRow/index.tsx @@ -79,7 +79,7 @@ function AppConnectionRow(props: AppConnectionRowProps): React.ReactElement { return ( <> - + + diff --git a/packages/web/src/components/ChooseAppAndEventSubstep/index.tsx b/packages/web/src/components/ChooseAppAndEventSubstep/index.tsx index 396d4b78..3b53c52e 100644 --- a/packages/web/src/components/ChooseAppAndEventSubstep/index.tsx +++ b/packages/web/src/components/ChooseAppAndEventSubstep/index.tsx @@ -152,6 +152,7 @@ function ChooseAppAndEventSubstep( )} value={getOption(appOptions, step.appKey)} onChange={onAppChange} + data-test="choose-app-autocomplete" /> {step.appKey && ( @@ -175,6 +176,7 @@ function ChooseAppAndEventSubstep( )} value={getOption(actionOptions, step.key)} onChange={onEventChange} + data-test="choose-event-autocomplete" /> )} @@ -197,6 +199,7 @@ function ChooseAppAndEventSubstep( onClick={onSubmit} sx={{ mt: 2 }} disabled={!valid || editorContext.readOnly} + data-test="flow-substep-continue-button" > Continue diff --git a/packages/web/src/components/ChooseConnectionSubstep/index.tsx b/packages/web/src/components/ChooseConnectionSubstep/index.tsx index 9fdeaec8..f99e51bc 100644 --- a/packages/web/src/components/ChooseConnectionSubstep/index.tsx +++ b/packages/web/src/components/ChooseConnectionSubstep/index.tsx @@ -126,6 +126,7 @@ function ChooseConnectionSubstep(props: ChooseConnectionSubstepProps): React.Rea value={getOption(connectionOptions, connection?.id)} onChange={handleChange} loading={loading} + data-test="choose-connection-autocomplete" /> diff --git a/packages/web/src/components/ControlledAutocomplete/index.tsx b/packages/web/src/components/ControlledAutocomplete/index.tsx index 118575ef..f7ab33f6 100644 --- a/packages/web/src/components/ControlledAutocomplete/index.tsx +++ b/packages/web/src/components/ControlledAutocomplete/index.tsx @@ -55,6 +55,7 @@ function ControlledAutocomplete(props: ControlledAutocompleteProps): React.React }} onBlur={(...args) => { controllerOnBlur(); onBlur?.(...args); }} ref={ref} + data-test={`${name}-autocomplete`} /> - {links.map(({ Icon, primary, to }, index) => ( + {links.map(({ Icon, primary, to, dataTest }, index) => ( } primary={formatMessage(primary)} to={to} onClick={closeOnClick} + data-test={dataTest} /> ))} diff --git a/packages/web/src/components/EditorLayout/index.tsx b/packages/web/src/components/EditorLayout/index.tsx index 4103fe05..6ddacb9a 100644 --- a/packages/web/src/components/EditorLayout/index.tsx +++ b/packages/web/src/components/EditorLayout/index.tsx @@ -74,6 +74,7 @@ export default function EditorLayout(): React.ReactElement { size="small" component={Link} to={URLS.FLOWS} + data-test="editor-go-back-button" > @@ -92,7 +93,12 @@ export default function EditorLayout(): React.ReactElement { - @@ -108,13 +114,19 @@ export default function EditorLayout(): React.ReactElement { onFlowStatusUpdate(!flow.active)}> - {flow?.active ? formatMessage('flowEditor.unpublish') : formatMessage('flowEditor.publish')} + )} /> diff --git a/packages/web/src/components/ExecutionRow/index.tsx b/packages/web/src/components/ExecutionRow/index.tsx index a949de12..f9a133f3 100644 --- a/packages/web/src/components/ExecutionRow/index.tsx +++ b/packages/web/src/components/ExecutionRow/index.tsx @@ -25,7 +25,7 @@ export default function ExecutionRow(props: ExecutionRowProps): React.ReactEleme const relativeCreatedAt = createdAt.toRelative(); return ( - + diff --git a/packages/web/src/components/ExecutionStep/index.tsx b/packages/web/src/components/ExecutionStep/index.tsx index abddaa23..026b4693 100644 --- a/packages/web/src/components/ExecutionStep/index.tsx +++ b/packages/web/src/components/ExecutionStep/index.tsx @@ -41,7 +41,7 @@ export default function ExecutionStep(props: ExecutionStepProps): React.ReactEle const validationStatusIcon = executionStep.status === 'success' ? validIcon : errorIcon; return ( - +
@@ -71,9 +71,9 @@ export default function ExecutionStep(props: ExecutionStepProps): React.ReactEle setActiveTabIndex(tabIndex)}> - - - + + + diff --git a/packages/web/src/components/FlowStep/index.tsx b/packages/web/src/components/FlowStep/index.tsx index 17c4bbb7..0910378a 100644 --- a/packages/web/src/components/FlowStep/index.tsx +++ b/packages/web/src/components/FlowStep/index.tsx @@ -182,7 +182,7 @@ export default function FlowStep( step.status === 'completed' ? validIcon : errorIcon; return ( - +
diff --git a/packages/web/src/components/FlowSubstep/index.tsx b/packages/web/src/components/FlowSubstep/index.tsx index a3d3ec90..b4d9b404 100644 --- a/packages/web/src/components/FlowSubstep/index.tsx +++ b/packages/web/src/components/FlowSubstep/index.tsx @@ -100,6 +100,7 @@ function FlowSubstep(props: FlowSubstepProps): React.ReactElement { sx={{ mt: 2 }} disabled={!validationStatus || editorContext.readOnly} type="submit" + data-test="flow-substep-continue-button" > Continue diff --git a/packages/web/src/components/Layout/index.tsx b/packages/web/src/components/Layout/index.tsx index a04271e5..b89beaef 100644 --- a/packages/web/src/components/Layout/index.tsx +++ b/packages/web/src/components/Layout/index.tsx @@ -22,16 +22,19 @@ const drawerLinks = [ Icon: SwapCallsIcon, primary: 'drawer.flows', to: URLS.FLOWS, + dataTest: 'flows-page-drawer-link', }, { Icon: AppsIcon, primary: 'drawer.apps', to: URLS.APPS, + dataTest: 'apps-page-drawer-link', }, { Icon: HistoryIcon, primary: 'drawer.executions', to: URLS.EXECUTIONS, + dataTest: 'executions-page-drawer-link', }, ]; diff --git a/packages/web/src/components/ListItemLink/index.tsx b/packages/web/src/components/ListItemLink/index.tsx index 6f001c8e..5d4b7aca 100644 --- a/packages/web/src/components/ListItemLink/index.tsx +++ b/packages/web/src/components/ListItemLink/index.tsx @@ -10,10 +10,11 @@ type ListItemLinkProps = { primary: string; to: string; onClick?: (event: React.SyntheticEvent) => void; + 'data-test'?: string; } export default function ListItemLink(props: ListItemLinkProps): React.ReactElement { - const { icon, primary, to, onClick } = props; + const { icon, primary, to, onClick, 'data-test': dataTest } = props; const selected = useMatch({ path: to, end: true }); const CustomLink = React.useMemo( @@ -34,6 +35,7 @@ export default function ListItemLink(props: ListItemLinkProps): React.ReactEleme sx={{ pl: { xs: 2, sm: 3 } }} selected={!!selected} onClick={onClick} + data-test={dataTest} > {icon} diff --git a/packages/web/src/components/LoginForm/index.tsx b/packages/web/src/components/LoginForm/index.tsx index 38e91923..e9c0004d 100644 --- a/packages/web/src/components/LoginForm/index.tsx +++ b/packages/web/src/components/LoginForm/index.tsx @@ -25,6 +25,7 @@ function renderFields(props: { loading: boolean }) { fullWidth margin="dense" autoComplete="username" + data-test="email-text-field" /> Login diff --git a/packages/web/src/components/PowerInput/Suggestions.tsx b/packages/web/src/components/PowerInput/Suggestions.tsx index 6c06d514..2425852d 100644 --- a/packages/web/src/components/PowerInput/Suggestions.tsx +++ b/packages/web/src/components/PowerInput/Suggestions.tsx @@ -71,6 +71,7 @@ const Suggestions = (props: SuggestionsProps) => { component="div" disablePadding sx={{ maxHeight: LIST_HEIGHT, overflowY: 'auto' }} + data-test="power-input-suggestion-group" > {getPartialArray((option.output as any) || [], listLength).map( (suboption: any, index: number) => ( @@ -78,6 +79,8 @@ const Suggestions = (props: SuggestionsProps) => { sx={{ pl: 4 }} divider onClick={() => onSuggestionClick(suboption)} + data-test="power-input-suggestion-item" + key={`suggestion-${suboption.name}`} > { onClickAway={() => { setShowVariableSuggestions(false); }} > {/* ref-able single child for ClickAwayListener */} -
+
+ )} @@ -119,6 +119,7 @@ function TestSubstep(props: TestSubstepProps): React.ReactElement { loading={loading} disabled={editorContext.readOnly} color="primary" + data-test="flow-substep-continue-button" > {isCompleted && formatMessage('flowEditor.continue')} {!isCompleted && formatMessage('flowEditor.testAndContinue')} diff --git a/packages/web/src/pages/Application/index.tsx b/packages/web/src/pages/Application/index.tsx index 5b75c671..055d1afc 100644 --- a/packages/web/src/pages/Application/index.tsx +++ b/packages/web/src/pages/Application/index.tsx @@ -126,6 +126,7 @@ export default function Application(): React.ReactElement | null { component={NewConnectionLink} fullWidth icon={} + data-test="add-connection-button" > {formatMessage('app.addConnection')} diff --git a/packages/web/src/pages/Applications/index.tsx b/packages/web/src/pages/Applications/index.tsx index 0450111c..8bd47d7d 100644 --- a/packages/web/src/pages/Applications/index.tsx +++ b/packages/web/src/pages/Applications/index.tsx @@ -69,6 +69,7 @@ export default function Applications(): React.ReactElement { component={NewAppConnectionLink} fullWidth icon={} + data-test="add-connection-button" > {formatMessage('apps.addConnection')} @@ -77,7 +78,7 @@ export default function Applications(): React.ReactElement { - {loading && } + {loading && } {!loading && !hasApps && ( - {loading && } + {loading && } {!loading && !hasExecutions && (} + data-test="create-flow-button" > {formatMessage('flows.create')}