Skip to content

Commit 3f1d463

Browse files
authored
Merge pull request #176 from code0-tech/feat/#172
Add data attribute for end to end testing
2 parents b13b9a2 + c526885 commit 3f1d463

17 files changed

Lines changed: 52 additions & 37 deletions

src/packages/ce/src/flow/components/FlowCreateDialogComponent.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,8 @@ export const FlowCreateDialogComponent: React.FC<FlowCreateDialogComponentProps>
203203
<InputDescription>You can choose a trigger here</InputDescription>
204204
<Menu>
205205
<MenuTrigger asChild>
206-
<Button w={"100%"}
206+
<Button data-qa-selector={"flow-create-trigger-select"}
207+
w={"100%"}
207208
color={inputs.getInputProps("flowTypeId").formValidation?.valid ? "tertiary" : "error"}
208209
style={{justifyContent: "start"}}>
209210
{selectedFlowTypeId ?
@@ -221,7 +222,7 @@ export const FlowCreateDialogComponent: React.FC<FlowCreateDialogComponentProps>
221222

222223
const DisplayIcon = icon(flowType?.displayIcon as IconString)
223224

224-
return <MenuItem key={flowType.id} onSelect={() => {
225+
return <MenuItem data-qa-selector={"flow-create-trigger-select-item"} key={flowType.id} onSelect={() => {
225226
inputs.getInputProps("flowTypeId").formValidation?.setValue(flowType.id)
226227
setSelectedFlowTypeId(flowType.id)
227228
}}>
@@ -253,6 +254,7 @@ export const FlowCreateDialogComponent: React.FC<FlowCreateDialogComponentProps>
253254
<InputMessage>{inputs.getInputProps("flowTypeId").formValidation?.notValidMessage!}</InputMessage> : null}
254255
<Spacing spacing={"md"}/>
255256
<FlowNameInputComponent
257+
data-qa-selector={"flow-create-name"}
256258
description={"You can choose a name here and only use alphanumeric names."}
257259
title={"Name of the flow"}
258260
{...inputs.getInputProps("name")}/>
@@ -261,7 +263,7 @@ export const FlowCreateDialogComponent: React.FC<FlowCreateDialogComponentProps>
261263
<DialogClose asChild>
262264
<Button color={"tertiary"} variant={"filled"}>No, go back!</Button>
263265
</DialogClose>
264-
<Button color={"success"} variant={"filled"} onClick={validate}>Yes, create!</Button>
266+
<Button data-qa-selector={"flow-create-send"} color={"success"} variant={"filled"} onClick={validate}>Yes, create!</Button>
265267
</Flex>
266268
</>
267269
)}

src/packages/ce/src/flow/components/panels/FlowPanelControlComponent.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,12 @@ export const FlowPanelControlComponent: React.FC<FlowPanelControlComponentProps>
6767
}
6868
}, [flowId, flowService, flowStore, activeTab])
6969

70-
return <Panel position={"bottom-center"}>
70+
return <Panel position={"bottom-center"} data-qa-selector={"flow-builder-control-panel"}>
7171
<ButtonGroup style={{textWrap: "nowrap"}}>
7272
<Tooltip>
7373
<TooltipTrigger asChild>
74-
<Button disabled={!activeTab || !(activeTab?.content?.props.flowId as Flow['id'])}
74+
<Button data-qa-selector={"flow-builder-control-panel-delete"}
75+
disabled={!activeTab || !(activeTab?.content?.props.flowId as Flow['id'])}
7576
onClick={deleteActiveNode}
7677
paddingSize={"xxs"}
7778
variant={"filled"}
@@ -88,7 +89,8 @@ export const FlowPanelControlComponent: React.FC<FlowPanelControlComponentProps>
8889
<FunctionSuggestionMenuComponent suggestions={result}
8990
onSuggestionSelect={addNodeToFlow}
9091
triggerContent={
91-
<Button disabled={!activeTab}
92+
<Button data-qa-selector={"flow-builder-control-panel-add"}
93+
disabled={!activeTab}
9294
paddingSize={"xxs"}
9395
variant={"filled"}
9496
color={"secondary"}>

src/packages/ce/src/flow/views/FlowFolderView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export const FlowFolderView: React.FC = () => {
7979
<Layout layoutGap={"0.7rem"} showLayoutSplitter={false} topContent={
8080
<Flex style={{flexDirection: "column", gap: "0.7rem"}}>
8181
<Flex style={{gap: "0.35rem"}} align={"center"} justify={"space-between"}>
82-
<Button color={"tertiary"} paddingSize={"xxs"} style={{textWrap: "nowrap"}} onClick={() => {
82+
<Button data-qa-selector={"flow-send"} color={"tertiary"} paddingSize={"xxs"} style={{textWrap: "nowrap"}} onClick={() => {
8383
setCreateDialogOpen(true)
8484
setFlowTypeId(undefined)
8585
}}>

src/packages/ce/src/function/components/files/FunctionFileDefaultComponent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ export const FunctionFileDefaultComponent: React.FC<FunctionFileDefaultComponent
152152

153153
return <div>
154154
{/*@ts-ignore*/}
155-
<DataTypeInputComponent flowId={flowId}
155+
<DataTypeInputComponent data-qa-selector={"flow-builder-parameter"}
156+
flowId={flowId}
156157
nodeId={node.id}
157158
parameterIndex={index}
158159
title={title}

src/packages/ce/src/function/components/files/FunctionFileTriggerComponent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ export const FunctionFileTriggerComponent: React.FC<FunctionFileTriggerComponent
140140

141141
return <div>
142142
{/*@ts-ignore*/}
143-
<DataTypeInputComponent flowId={instance.id}
143+
<DataTypeInputComponent data-qa-selector={"flow-builder-setting"}
144+
flowId={instance.id}
144145
nodeId={undefined}
145146
parameterIndex={index}
146147
title={title}

src/packages/ce/src/function/components/files/FunctionFilesComponent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ export const FunctionFilesComponent: React.FC<FunctionFilesComponentProps> = (pr
160160
</FileTabsList>}>
161161
<>
162162
{fileTabsService.values().map((tab: FileTabsView) => (
163-
<FileTabsContent display={tab.active ? "block" : "none"}
163+
<FileTabsContent data-qa-selector={"flow-builder-file-content"}
164+
display={tab.active ? "block" : "none"}
164165
key={`content-${tab.id}`}
165166
value={tab.id!}>
166167
{tab.content}

src/packages/ce/src/function/components/nodes/FunctionNodeDefaultComponent.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ export const FunctionNodeDefaultComponent: React.FC<FunctionNodeDefaultComponent
161161

162162
return (
163163
<Card
164+
data-qa-selector={"flow-builder-node"}
164165
key={id}
165166
data-flow-refernce={id}
166167
paddingSize={"xs"}

src/packages/ce/src/function/components/nodes/FunctionNodeTriggerComponent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ export const FunctionNodeTriggerComponent: React.FC<FunctionNodeTriggerComponent
7777

7878
}, [flowStore, activeTabId, data.flowId])
7979

80-
return <Card variant={"normal"}
80+
return <Card data-qa-selector={"flow-builder-trigger"}
81+
variant={"normal"}
8182
color={"info"}
8283
paddingSize={"xs"}
8384
key={id}

src/packages/ce/src/function/components/suggestion/FunctionSuggestionMenuComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export const FunctionSuggestionMenuComponent: React.FC<FunctionSuggestionMenuCom
3434
{triggerContent}
3535
</MenuTrigger>
3636
<MenuPortal>
37-
<InputSuggestionMenuContent align={"center"} color={"secondary"}>
37+
<InputSuggestionMenuContent align={"center"} color={"secondary"} data-qa-selector={"flow-builder-suggestions"}>
3838
<FunctionSuggestionSearchBarComponent onType={event => {
3939

4040
if (event.key === "ArrowDown") {

src/packages/ce/src/namespace/pages/NamespaceProjectsCreatePage.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ export const NamespaceProjectsCreatePage: React.FC = () => {
7575
Global runtimes are shared runtimes that can be used across multiple organizations.
7676
</Text>
7777
<Spacing spacing={"xl"}/>
78-
<TextInput required
78+
<TextInput data-qa-selector={"dashboard-namespace-project-create-name"}
79+
required
7980
title={"Name"}
8081
description={"Provide a simple project name"}
8182
placeholder={"E.g. User management"}
8283
{...inputs.getInputProps("name")}/>
8384
<Spacing spacing={"xl"}/>
84-
<TextInput required
85+
<TextInput data-qa-selector={"dashboard-namespace-project-create-description"}
86+
required
8587
title={"Description"}
8688
description={"Provide a simple project description"}
8789
placeholder={"E.g. Manage and authenticate users with rest routes"}
@@ -93,7 +95,7 @@ export const NamespaceProjectsCreatePage: React.FC = () => {
9395
Go back to projects
9496
</Button>
9597
</Link>
96-
<Button color={"success"} onClick={validate}>
98+
<Button data-qa-selector={"dashboard-namespace-project-create-send"} color={"success"} onClick={validate}>
9799
Create project
98100
</Button>
99101
</Flex>

0 commit comments

Comments
 (0)