1
1
const domainName = "CypressNestedDomain" ;
2
- const domainDescription = "CypressNestedDomainDescription" ;
2
+
3
+ //Delete Unecessary Existing Domains
4
+ const deleteExisitingDomain = ( ) => {
5
+ cy . get ( 'a[href*="urn:li"] span[class^="ant-typography"]' )
6
+ . should ( 'be.visible' )
7
+ . its ( 'length' )
8
+ . then ( ( length ) => {
9
+ for ( let i = 0 ; i < length - 1 ; i ++ ) {
10
+ cy . get ( 'a[href*="urn:li"] span[class^="ant-typography"]' )
11
+ . should ( 'be.visible' )
12
+ . first ( )
13
+ . click ( { force : true } ) ;
14
+ deleteFromDomainDropdown ( ) ;
15
+ }
16
+ } ) ;
17
+ cy . waitTextVisible ( 'Marketing' ) ;
18
+ }
3
19
4
20
const createDomain = ( ) => {
5
- cy . clickOptionWithTestId ( "domains-new-domain-button" ) ;
21
+ cy . get ( '.anticon-plus' ) . first ( ) . click ( )
22
+ cy . waitTextVisible ( 'Create New Domain' )
6
23
cy . get ( '[data-testid="create-domain-name"]' ) . click ( ) . type ( domainName ) ;
7
- cy . get ( '[data-testid="create-domain-description"]' ) . click ( ) . type ( domainDescription ) ;
8
24
cy . clickOptionWithTestId ( "create-domain-button" ) ;
9
25
cy . waitTextVisible ( "Created domain!" ) ;
10
26
}
@@ -16,7 +32,7 @@ const moveDomaintoRootLevel = () => {
16
32
cy . get ( '[data-testid="move-domain-modal"]' ) . contains ( "Marketing" ) . click ( { force : true } ) ;
17
33
cy . waitTextVisible ( 'Marketing' )
18
34
cy . clickOptionWithTestId ( "move-domain-modal-move-button" )
19
- }
35
+ }
20
36
21
37
const moveDomaintoParent = ( ) => {
22
38
cy . get ( '[data-testid="domain-list-item"]' ) . contains ( "Marketing" ) . prev ( ) . click ( ) ;
@@ -25,70 +41,185 @@ const moveDomaintoParent = () => {
25
41
cy . openThreeDotDropdown ( ) ;
26
42
cy . clickOptionWithTestId ( "entity-menu-move-button" ) ;
27
43
cy . clickOptionWithTestId ( "move-domain-modal-move-button" )
28
- }
44
+ }
29
45
30
- const deleteFromDomainDropdown = ( ) => {
31
- cy . clickOptionWithText ( 'Filters' )
32
- cy . openThreeDotDropdown ( ) ;
33
- cy . clickOptionWithTestId ( "entity-menu-delete-button" ) ;
34
- cy . waitTextVisible ( "Are you sure you want to remove this Domain?" ) ;
35
- cy . clickOptionWithText ( "Yes" ) ;
36
- }
46
+ const getDomainList = ( domainName ) => {
47
+ cy . contains ( 'span.ant-typography-ellipsis' , domainName )
48
+ . parent ( '[data-testid="domain-list-item"]' )
49
+ . find ( '[aria-label="right"]' )
50
+ . click ( ) ;
51
+ }
52
+
53
+ const deleteFromDomainDropdown = ( ) => {
54
+ cy . clickOptionWithText ( 'Filters' )
55
+ cy . openThreeDotDropdown ( ) ;
56
+ cy . clickOptionWithTestId ( "entity-menu-delete-button" ) ;
57
+ cy . waitTextVisible ( "Are you sure you want to remove this Domain?" ) ;
58
+ cy . clickOptionWithText ( "Yes" ) ;
59
+ }
37
60
38
61
const deleteDomain = ( ) => {
39
62
cy . clickOptionWithText ( domainName ) . waitTextVisible ( 'Domains' ) ;
40
63
deleteFromDomainDropdown ( )
41
- }
64
+ }
42
65
43
- //Delete Unecessary Existing Domains
44
- const deleteExisitingDomain = ( ) => {
45
- cy . get ( 'a[href*="urn:li"] span[class^="ant-typography"]' )
46
- . should ( 'be.visible' )
47
- . its ( 'length' )
48
- . then ( ( length ) => {
49
- for ( let i = 0 ; i < length - 1 ; i ++ ) {
50
- cy . get ( 'a[href*="urn:li"] span[class^="ant-typography"]' )
51
- . should ( 'be.visible' )
52
- . first ( )
53
- . click ( { force : true } ) ;
54
- deleteFromDomainDropdown ( ) ;
55
- }
56
- } ) ;
57
- cy . waitTextVisible ( 'My custom domain' ) ;
58
- }
66
+ const verifyEditAndPerformAddAndRemoveActionForDomain = ( entity , action , text , body ) => {
67
+ cy . clickOptionWithText ( entity )
68
+ cy . clickOptionWithText ( action )
69
+ cy . get ( '[data-testid="tag-term-modal-input"]' ) . type ( text )
70
+ cy . get ( '[data-testid="tag-term-option"]' ) . contains ( text ) . click ( )
71
+ cy . clickOptionWithText ( body )
72
+ cy . get ( '[data-testid="add-tag-term-from-modal-btn"]' ) . click ( )
73
+ cy . waitTextVisible ( text )
74
+ }
59
75
60
- describe ( "nested domains test" , ( ) => {
76
+ const clearAndType = ( text ) => {
77
+ cy . get ( '[role="textbox"]' ) . click ( ) . clear ( ) . type ( text )
78
+ }
79
+
80
+ const clearAndDelete = ( ) => {
81
+ cy . clickOptionWithText ( "Edit" )
82
+ cy . get ( '[role="textbox"]' ) . click ( ) . clear ( )
83
+ cy . clickOptionWithTestId ( "description-editor-save-button" )
84
+ cy . waitTextVisible ( 'No documentation' )
85
+ cy . mouseover ( '.ant-list-item-meta-content' )
86
+ cy . get ( '[aria-label="delete"]' ) . click ( )
87
+ cy . waitTextVisible ( 'Link Removed' )
88
+ }
89
+
90
+ describe ( "Verify nested domains test functionalities" , ( ) => {
61
91
beforeEach ( ( ) => {
62
92
cy . loginWithCredentials ( ) ;
63
93
cy . goToDomainList ( ) ;
64
94
} ) ;
65
95
66
- it ( "Create a new domain" , ( ) => {
67
- deleteExisitingDomain ( )
96
+ it ( "Verify Create a new domain" , ( ) => {
97
+ deleteExisitingDomain ( )
98
+ cy . get ( 'a[href*="urn:li"] span[class^="ant-typography"]' )
99
+ . should ( 'be.visible' )
68
100
createDomain ( ) ;
69
101
cy . waitTextVisible ( "Domains" ) ;
70
102
} ) ;
71
103
72
- it ( " Move domain root level to parent level", ( ) => {
104
+ it ( "verify Move domain root level to parent level", ( ) => {
73
105
cy . waitTextVisible ( domainName )
74
106
moveDomaintoRootLevel ( ) ;
75
107
cy . waitTextVisible ( "Moved Domain!" )
76
108
cy . goToDomainList ( ) ;
77
109
cy . waitTextVisible ( "1 sub-domain" ) ;
78
110
} ) ;
79
111
80
- it ( "Move domain parent level to root level" , ( ) => {
112
+ it ( "Verify Move domain parent level to root level" , ( ) => {
81
113
moveDomaintoParent ( ) ;
82
114
cy . waitTextVisible ( "Moved Domain!" )
83
115
cy . goToDomainList ( ) ;
84
116
cy . waitTextVisible ( domainName ) ;
85
- cy . waitTextVisible ( domainDescription ) ;
86
117
} ) ;
87
118
88
- it ( "Remove the domain" , ( ) => {
119
+ it ( "Verify Documentation tab by adding editing Description and adding link" , ( ) => {
120
+ cy . clickOptionWithText ( domainName )
121
+ cy . clickOptionWithId ( '#rc-tabs-0-tab-Documentation' )
122
+ cy . clickFirstOptionWithText ( "Add Documentation" )
123
+ clearAndType ( "Test added" )
124
+ cy . clickOptionWithTestId ( "description-editor-save-button" )
125
+ cy . waitTextVisible ( 'Description Updated' )
126
+ cy . waitTextVisible ( 'Test added' )
127
+ cy . clickFirstOptionWithTestId ( "add-link-button" )
128
+ cy . waitTextVisible ( "Add Link" )
129
+ cy . enterTextInTestId ( "add-link-modal-url" , 'www.test.com' )
130
+ cy . enterTextInTestId ( "add-link-modal-label" , 'Test Label' )
131
+ cy . clickOptionWithTestId ( "add-link-modal-add-button" )
132
+ cy . waitTextVisible ( "Test Label" )
133
+ cy . goToDomainList ( ) ;
134
+ cy . waitTextVisible ( "Test added" )
135
+ cy . clickOptionWithText ( domainName )
136
+ cy . clickOptionWithText ( "Documentation" )
137
+ clearAndDelete ( )
138
+ } )
139
+
140
+ it ( "Verify Right side panel functionalities" , ( ) => {
141
+ cy . clickOptionWithText ( domainName )
142
+ cy . waitTextVisible ( "Filters" )
143
+ cy . clickOptionWithText ( "Add Documentation" )
144
+ clearAndType ( "Test documentation" )
145
+ cy . clickOptionWithTestId ( "description-editor-save-button" )
146
+ cy . ensureTextNotPresent ( "Add Documentation" )
147
+ cy . waitTextVisible ( 'Test documentation' )
148
+ cy . clickFirstOptionWithSpecificTestId ( "add-link-button" , 1 )
149
+ cy . waitTextVisible ( "URL" )
150
+ cy . enterTextInTestId ( "add-link-modal-url" , 'www.test.com' )
151
+ cy . enterTextInTestId ( "add-link-modal-label" , 'Test Label' )
152
+ cy . clickOptionWithTestId ( "add-link-modal-add-button" )
153
+ cy . waitTextVisible ( "Test Label" )
154
+ cy . clickOptionWithTestId ( "add-owners-button" )
155
+ cy . waitTextVisible ( "Find a user or group" )
156
+ cy . clickTextOptionWithClass ( ".rc-virtual-list-holder-inner" , "DataHub" )
157
+ cy . clickOptionWithText ( "Find a user or group" )
158
+ cy . clickOptionWithId ( '#addOwnerButton' )
159
+ cy . waitTextVisible ( "DataHub" )
160
+ cy . goToDomainList ( ) ;
161
+ cy . waitTextVisible ( "Test documentation" )
162
+ cy . waitTextVisible ( "DataHub" )
163
+ cy . clickOptionWithText ( domainName )
164
+ cy . clickOptionWithText ( "Documentation" )
165
+ clearAndDelete ( )
166
+ } )
167
+
168
+ it ( "Verify Edit Domain Name" , ( ) => {
169
+ cy . clickFirstOptionWithText ( domainName )
170
+ cy . clickOptionWithText ( 'Filters' )
171
+
172
+ //edit name
173
+ cy . get ( '.anticon-edit' ) . eq ( 0 ) . click ( ) . then ( ( ) => {
174
+ cy . get ( '.ant-typography-edit-content' ) . type ( " Edited" ) . type ( '{enter}' ) ;
175
+ } ) ;
176
+ cy . waitTextVisible ( domainName + " Edited" )
177
+ } )
178
+
179
+ it ( "Verify Remove the domain" , ( ) => {
89
180
deleteDomain ( ) ;
90
181
cy . goToDomainList ( ) ;
91
182
cy . ensureTextNotPresent ( domainName ) ;
92
- cy . ensureTextNotPresent ( domainDescription ) ;
93
183
} ) ;
184
+
185
+ it ( 'Verify Add and delete sub domain' , ( ) => {
186
+ cy . clickFirstOptionWithText ( 'Marketing' )
187
+ cy . clickOptionWithText ( 'Filters' )
188
+ createDomain ( ) ;
189
+ cy . ensureTextNotPresent ( 'Created domain!' )
190
+ getDomainList ( 'Marketing' )
191
+ cy . clickOptionWithText ( domainName )
192
+ deleteFromDomainDropdown ( )
193
+ cy . ensureTextNotPresent ( domainName )
194
+ } )
195
+
196
+ it ( 'Verify entities tab with adding and deleting assets and performing some actions' , ( ) => {
197
+ cy . clickFirstOptionWithText ( 'Marketing' ) ;
198
+ cy . clickOptionWithText ( 'Add assets' ) ;
199
+ cy . waitTextVisible ( "Add assets to Domain" ) ;
200
+ cy . enterTextInSpecificTestId ( "search-bar" , 3 , 'Baz Chart 1' )
201
+ cy . clickOptionWithSpecificClass ( '.ant-checkbox' , 1 )
202
+ cy . clickOptionWithId ( '#continueButton' )
203
+ cy . waitTextVisible ( "Added assets to Domain!" )
204
+ cy . openThreeDotMenu ( )
205
+ cy . clickOptionWithText ( "Edit" )
206
+ cy . clickOptionWithSpecificClass ( '.ant-checkbox' , 1 )
207
+ verifyEditAndPerformAddAndRemoveActionForDomain ( 'Tags' , 'Add tags' , 'Cypress' , 'Add Tags' )
208
+ cy . clickOptionWithText ( 'Baz Chart 1' )
209
+ cy . waitTextVisible ( "Cypress" )
210
+ cy . waitTextVisible ( "Marketing" )
211
+ cy . go ( 'back' )
212
+ cy . openThreeDotMenu ( )
213
+ cy . clickOptionWithText ( "Edit" )
214
+ cy . clickOptionWithSpecificClass ( '.ant-checkbox' , 1 )
215
+ verifyEditAndPerformAddAndRemoveActionForDomain ( 'Tags' , 'Remove tags' , 'Cypress' , 'Remove Tags' )
216
+ cy . clickTextOptionWithClass ( '.ant-dropdown-trigger' , 'Domain' )
217
+ cy . clickOptionWithText ( 'Unset Domain' )
218
+ cy . clickOptionWithText ( "Yes" ) ;
219
+ cy . clickOptionWithText ( 'Baz Chart 1' )
220
+ cy . waitTextVisible ( 'Dashboards' )
221
+ cy . reload ( )
222
+ cy . ensureTextNotPresent ( "Cypress" )
223
+ cy . ensureTextNotPresent ( "Marketing" )
224
+ } )
94
225
} ) ;
0 commit comments