@digital-ai/devops-page-object-deploy 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.js CHANGED
@@ -1,1265 +1,190 @@
1
1
  import {test as $lE6ZQ$test, expect as $lE6ZQ$expect} from "@playwright/test";
2
- import {split as $lE6ZQ$split, join as $lE6ZQ$join, take as $lE6ZQ$take} from "rambda";
3
2
 
4
- class $b464119f5ec5aad0$export$6e2c8f0811a474ce {
5
- constructor(parentLocator, sectionRootLocator){
6
- this.parentLocator = parentLocator;
7
- this.sectionRoot = this.parentLocator.locator(sectionRootLocator);
8
- }
9
- /**
10
- * Get child element in the section "this.sectionRoot" refers to
11
- * @param childElementLocator
12
- */ findElementInSection(childElementLocator) {
13
- return this.sectionRoot.locator(childElementLocator);
14
- }
15
- }
16
-
17
-
18
-
19
- class $66de4f08dadae772$export$cc4f63927c41742f extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
20
- constructor(parentLocator, page){
21
- super(parentLocator, page.getByTestId("primaryNav"));
22
- }
23
- /**
24
- * Click on side navigation links
25
- */ async clickSideLink(sideLinkLocator) {
26
- await this.sectionRoot.locator(sideLinkLocator).click();
27
- }
28
- }
29
-
30
-
31
- class $26d8c96bf2341a59$export$110709f040143804 extends (0, $66de4f08dadae772$export$cc4f63927c41742f) {
32
- static sectionRootLocator = ".Pane vertical Pane1";
33
- constructor(parentLocator, page){
34
- super(parentLocator, page);
35
- this.backButtonLocator = page.getByTestId("back-button");
36
- this.linkExploreLocator = page.locator("p:has-text('Explorer')");
37
- this.linkCompareLocator = page.locator("p:has-text('Compare')");
38
- this.linkReportsLocator = page.locator("p:has-text('Reports')");
39
- this.linkRulesAndMacrosLocator = page.locator("p:has-text('Rules and Macros')");
40
- this.linkGitOps = page.locator("p:has-text('GitOps')");
41
- this.linkLocalSource = page.locator("p:has-text('Local sources')");
42
- this.linkPlugins = page.locator("p:has-text('Plugins')");
43
- this.linkUserManagement = page.locator("p:has-text('User management')");
44
- this.collapseButtonLocator = page.locator("span[title='Collapse']");
45
- this.expandButtonLocator = page.locator("span[title='Expand']");
46
- }
47
- /**
48
- * Click on go back button on side naviation links
49
- */ async goBack() {
50
- await this.backButtonLocator.waitFor();
51
- await this.backButtonLocator.click();
52
- }
53
- /**
54
- * Click on Explorer from left panel
55
- */ async clickExplorer() {
56
- await this.clickSideLink(this.linkExploreLocator);
57
- }
58
- /**
59
- * Click on Compare from left panel
60
- */ async clickCompare() {
61
- await this.clickSideLink(this.linkCompareLocator);
62
- }
63
- /**
64
- * Click on Reports from left panel
65
- */ async clickReports() {
66
- await this.clickSideLink(this.linkReportsLocator);
67
- }
68
- /**
69
- * Click on Rules and Macros from left panel
70
- */ async clickRulesAndMacros() {
71
- await this.clickSideLink(this.linkRulesAndMacrosLocator);
72
- }
73
- /**
74
- * Click on Gitops from left panel
75
- */ async clickGitOps() {
76
- await this.clickSideLink(this.linkGitOps);
77
- }
78
- /**
79
- * Click on Local sources from left panel
80
- */ async clickLocalSources() {
81
- await this.clickSideLink(this.linkLocalSource);
82
- }
83
- /**
84
- * Click on Plugins from left panel
85
- */ async clickPlugins() {
86
- await this.clickSideLink(this.linkPlugins);
87
- }
88
- /**
89
- * Click on User Managements from left panel
90
- */ async clickUserManagement() {
91
- await this.clickSideLink(this.linkUserManagement);
92
- }
93
- /**
94
- * Click on Collapse button from left panel
95
- */ async clickCollapse() {
96
- await this.clickSideLink(this.collapseButtonLocator);
97
- }
98
- /**
99
- * Click on Expand from left panel
100
- */ async clickExpand() {
101
- await this.clickSideLink(this.expandButtonLocator);
102
- }
103
- }
104
-
105
-
106
-
107
- class $7f808a48ced6cace$export$3b4e64e77073e307 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
108
- constructor(parentLocator, page){
109
- super(parentLocator, page.locator(".banner-container"));
110
- }
111
- }
112
-
113
-
114
- class $5dbb03b38de032e2$export$7c6e2c02157bb7d2 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
115
- static sectionRoot = ".app-root";
116
- constructor(parentLocator, page){
117
- super(parentLocator, page.locator($5dbb03b38de032e2$export$7c6e2c02157bb7d2.sectionRoot));
118
- this.banner = new (0, $7f808a48ced6cace$export$3b4e64e77073e307)(page.locator($5dbb03b38de032e2$export$7c6e2c02157bb7d2.sectionRoot), page);
119
- this.leftPanel = new (0, $26d8c96bf2341a59$export$110709f040143804)(page.locator($5dbb03b38de032e2$export$7c6e2c02157bb7d2.sectionRoot), page);
120
- }
121
- }
122
-
123
-
124
-
125
- class $54bcd1bcf08dd053$export$d9b273488cd8ce6f extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
126
- /**
127
- *
128
- * @param menuContentRootLocator menu content root locator
129
- * @param menuLinkLocator Menu link locator thats used to open/close the menu
130
- * @param menuItemsParentLocator Menu items that opens up when menu link is clicked
131
- */ constructor(menuContentRootLocator, menuLinkLocator, menuItemsParentLocator){
132
- super($54bcd1bcf08dd053$export$d9b273488cd8ce6f.parentLocator, menuContentRootLocator);
133
- this.menuLinkLocator = menuLinkLocator;
134
- this.menuItemsParentLocator = menuContentRootLocator.locator(menuItemsParentLocator);
135
- }
136
- /**
137
- * Click on a menu item
138
- * @param menuItemLocator
139
- */ async clickMenuItem(menuItemLocator) {
140
- if (!await this.menuItemsParentLocator.locator(menuItemLocator).isVisible()) await this.menuLinkLocator.click();
141
- return await this.menuItemsParentLocator.locator(menuItemLocator).click();
142
- }
143
- /**
144
- * Close a menu item
145
- */ async close() {
146
- await this.menuLinkLocator.click();
147
- }
148
- /**
149
- * Note : Support only one level of menu items not being open iow if the link to click
150
- * @param mouseOverLocator
151
- * @param menuItemLocator
152
- */ async hoverFlyoutAndClickMenuItem(mouseOverLocator, menuItemLocator) {
153
- if (!await this.menuItemsParentLocator.locator(menuItemLocator).isVisible()) {
154
- await mouseOverLocator.hover();
155
- await this.menuLinkLocator.click();
156
- }
157
- await menuItemLocator.click();
158
- }
159
- /**
160
- * Open contextual menu dots of ci to work with contextual-menu items.
161
- */ async openContextualMenuDots() {
162
- await this.menuLinkLocator.click();
163
- }
164
- /**
165
- * Find exact menu locators using menu parent locators.
166
- * @param childElementLocator
167
- * @returns
168
- */ async findElementInMenu(childElementLocator) {
169
- return this.menuItemsParentLocator.locator(childElementLocator);
170
- }
171
- }
172
-
173
-
174
- class $b4bd429df4806013$export$5929c05a25eed48f extends (0, $54bcd1bcf08dd053$export$d9b273488cd8ce6f) {
175
- constructor(page){
176
- super(page.locator("#context-menu-popover"), page.locator(".icon-help.dot-i"), page.locator(".dropdown-menu.multi-level.dropdown-menu-0"));
177
- this.onlineDoc = page.locator('a[title="Online documentation"]');
178
- this.supportRequest = page.locator('a[title="Submit a support request"]');
179
- this.website = page.locator('a[title="Digital.ai website"]');
180
- this.usageMatrix = page.locator('a[title="Usage Metrics"]');
181
- this.getDataForSupport = page.locator('a[title="Get data for support"]');
182
- }
183
- /**
184
- * Click on online Documentation menu option
185
- */ async clickOnlineDocumentation() {
186
- await this.clickMenuItem(this.onlineDoc);
187
- }
188
- /**
189
- * Click on menu option
190
- */ async clickSupportRequest() {
191
- await this.clickMenuItem(this.supportRequest);
192
- }
193
- /**
194
- * Click on Digital.ai website menu option
195
- */ async clickOfficialWebsite() {
196
- await this.clickMenuItem(this.website);
197
- }
198
- /**
199
- * Click on usage matrix menu option
200
- */ async clickUsageMatrix() {
201
- await this.clickMenuItem(this.usageMatrix);
202
- }
203
- /**
204
- * Click on Get data for support menu option
205
- */ async clickGetDataForSupport() {
206
- await this.clickMenuItem(this.getDataForSupport);
207
- }
208
- }
209
-
210
-
211
-
212
-
213
- class $60e85cd955b64c3b$export$ca8bffe144e51c8 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
214
- static sectionRootLocator = ".dot-branding";
215
- constructor(parentLocator, page){
216
- super(parentLocator, page.locator($60e85cd955b64c3b$export$ca8bffe144e51c8.sectionRootLocator));
217
- this.logo = this.findElementInSection(page.getByTestId("primary-logo"));
218
- }
219
- async clickLogo() {
220
- await this.logo.click();
221
- }
222
- }
223
-
224
-
225
-
226
- class $e05e449fbf3516f1$export$1d7840d5cdc861d5 extends (0, $54bcd1bcf08dd053$export$d9b273488cd8ce6f) {
227
- constructor(page){
228
- super(page.locator("#context-menu-popover"), page.locator(".icon-settings.dot-i"), page.locator('ul[class="dropdown-menu multi-level dropdown-menu-0"]'));
229
- this.settings = page.getByRole("link", {
230
- name: "Settings"
231
- });
232
- this.renewLicense = page.getByTitle("Renew license");
233
- this.viewAs = page.getByTitle("View as");
234
- this.maintenanceMode = page.getByTitle("");
235
- this.about = page.getByTitle("About");
236
- this.systemInformation = page.getByTitle("System information");
237
- }
238
- /**
239
- * Click on settings menu option
240
- */ async clickSettings() {
241
- await this.clickMenuItem(this.settings);
242
- }
243
- /**
244
- * Click on renew license menu option
245
- */ async clickRenewLicense() {
246
- await this.clickMenuItem(this.renewLicense);
247
- }
248
- /**
249
- * Click on view as menu option
250
- */ async clickViewAs() {
251
- await this.clickMenuItem(this.viewAs);
252
- }
253
- /**
254
- * Click on maintenance mode menu option
255
- */ async clickMaintenanceMode() {
256
- await this.clickMenuItem(this.maintenanceMode);
257
- }
258
- /**
259
- * Click on About menu option
260
- */ async clickAbout() {
261
- await this.clickMenuItem(this.about);
262
- }
263
- /**
264
- * Click on System information menu option
265
- */ async clickSystemInfo() {
266
- await this.clickMenuItem(this.systemInformation);
267
- }
268
- }
269
-
270
-
271
-
272
-
273
- class $e477fae343f80541$export$f7f58290278dd286 extends (0, $54bcd1bcf08dd053$export$d9b273488cd8ce6f) {
274
- constructor(page){
275
- super(page.locator("#context-menu-popover"), page.getByTitle(".dot-avatar"), page.locator(".dropdown-menu.multi-level.dropdown-menu-0"));
276
- this.page = page;
277
- this.userProfileLocator = page.getByRole("link", {
278
- name: "User profile"
279
- });
280
- this.logoutLocator = page.getByRole("link", {
281
- name: "Log out"
282
- });
283
- this.avatarTooltip = page.locator(".avatar-wrapper>.dot-tooltip");
284
- }
285
- async clickUserProfile() {
286
- await this.clickMenuItem(this.userProfileLocator);
287
- }
288
- async logout() {
289
- await this.clickMenuItem(this.logoutLocator);
290
- }
291
- async validateAvatarName(expectedName) {
292
- (0, $lE6ZQ$expect)(await this.avatarTooltip.getAttribute("title")).toContain(expectedName);
293
- }
294
- }
295
-
296
-
297
- class $7bc68dfa9f2318a7$export$8b251419efc915eb extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
298
- static sectionRootLocator = ".main-header-wrapper.logged-in";
299
- constructor(parentLocator, page){
300
- super(parentLocator, page.locator($7bc68dfa9f2318a7$export$8b251419efc915eb.sectionRootLocator));
301
- this.page = page;
302
- this.brandLogo = new (0, $60e85cd955b64c3b$export$ca8bffe144e51c8)(page.locator(".main-header-wrapper.logged-in"), page);
303
- this.helperMenu = new (0, $b4bd429df4806013$export$5929c05a25eed48f)(page);
304
- this.settingsMenu = new (0, $e05e449fbf3516f1$export$1d7840d5cdc861d5)(page);
305
- this.avatarMenu = new (0, $e477fae343f80541$export$f7f58290278dd286)(page);
306
- }
307
- }
308
3
 
309
4
 
310
5
  class $7d546dcaafadc158$export$2b65d1d97338f32b {
311
6
  constructor(page){
312
- this.header = new (0, $7bc68dfa9f2318a7$export$8b251419efc915eb)(page.locator(".ci-explorer"), page);
313
- this.content = new (0, $5dbb03b38de032e2$export$7c6e2c02157bb7d2)(page.locator(".ci-explorer"), page);
314
- }
315
- }
316
-
317
-
318
-
319
- class $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
320
- constructor(parentLocator, mainContentRootLocator){
321
- super(parentLocator, mainContentRootLocator);
322
- }
323
- async fillTextInput(textInput, textValue) {
324
- await textInput.clear();
325
- await textInput.fill(textValue);
326
- }
327
- }
328
-
329
-
330
- class $bc332e5dcec2d43b$export$56c2ba9e13461f38 extends (0, $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8) {
331
- static mainContentRootLocator = ".login-component";
332
- constructor(parentLocator, page){
333
- super(parentLocator, page.locator($bc332e5dcec2d43b$export$56c2ba9e13461f38.mainContentRootLocator));
334
- this.page = page;
335
- this.username = this.findElementInSection(page.getByPlaceholder("User"));
336
- this.password = this.findElementInSection(page.getByPlaceholder("Password"));
337
- this.loginButton = this.findElementInSection(page.getByRole("button", {
338
- name: "Log in"
339
- }));
340
- this.rememberMeCheckbox = this.findElementInSection(page.locator("#rememberMeCheckbox"));
341
- }
342
- async enterUserName(username) {
343
- await this.fillTextInput(this.username, username);
344
- }
345
- async enterPassword(password) {
346
- await this.fillTextInput(this.password, password);
347
- }
348
- async clickLogin() {
349
- await this.loginButton.click();
350
- }
351
- async clickRememberMe() {
352
- await this.rememberMeCheckbox.click();
353
- }
354
- }
355
-
356
-
357
- class $c2c31ea6199a3576$export$f14c0e3f98d164c0 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
358
- constructor(page){
359
- super(page);
360
7
  this.page = page;
361
- this.loginForm = new (0, $bc332e5dcec2d43b$export$56c2ba9e13461f38)(page.locator(".login-layout"), page);
362
- }
363
- async login(user, pwd) {
364
- await this.page.goto("/#/login");
365
- await this.loginForm.enterUserName(user);
366
- await this.loginForm.enterPassword(pwd);
367
- await this.loginForm.clickLogin();
368
- await this.page.locator(".main-layout").waitFor();
369
- await this.header.avatarMenu.validateAvatarName(user);
370
8
  }
371
9
  }
372
10
 
373
11
 
374
-
375
- class $85032414fe55e0f1$export$7db63d2c950874b5 {
376
- constructor(page1, page){
377
- this.applicationPage = page1;
378
- this.page = page;
379
- }
380
- /**
381
- * Create New directory under applications CI.
382
- * @param appDirectoryName
383
- */ async createNewApplicationDirectory(appDirectoryName) {
384
- await this.applicationPage.contextMenu.clickApplicationCi();
385
- await this.applicationPage.contextMenu.clickMenuPath([
386
- "new",
387
- "directory"
388
- ]);
389
- await this.applicationPage.form.assertSaveButtonIsDisabled();
390
- await this.applicationPage.form.assertSaveAndCloseButtonIsDisabled();
391
- await this.applicationPage.form.enterName(appDirectoryName);
392
- await this.applicationPage.tab.assertActiveTabSelector("Create core.directory");
393
- await this.applicationPage.form.clickSaveAndClose();
12
+ class $e18c8d3707c8c74c$export$36d69433c4f81145 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
13
+ async clickUserManagement() {
14
+ await this.page.locator("p.MuiTypography-root", {
15
+ hasText: "User management"
16
+ }).click();
17
+ await this.page.getByRole("link", {
18
+ name: "Users"
19
+ }).click();
394
20
  }
395
- /**
396
- * Create new application under Application ci
397
- * @param appName
398
- */ async createNewApplication(appName) {
399
- await this.applicationPage.contextMenu.clickApplicationCi();
400
- await this.applicationPage.contextMenu.clickMenuPath([
401
- "new",
402
- "application"
403
- ]);
404
- await this.applicationPage.form.assertSaveButtonIsDisabled();
405
- await this.applicationPage.form.assertSaveAndCloseButtonIsDisabled();
406
- await this.applicationPage.form.enterName(appName);
407
- await this.applicationPage.form.clickSaveAndClose();
408
- await this.applicationPage.tab.assertActiveTabSelector("Create udm.application");
21
+ async verifyDeployLogoIsPresent() {
22
+ const logo = this.page.getByAltText("Deploy");
23
+ await (0, $lE6ZQ$expect)(logo).toBeVisible();
409
24
  }
410
- /**
411
- * TODO: It is half done just to check on menu path other than new. Need to create as per scenario.
412
- */ async createFromFileImport() {
413
- await this.applicationPage.contextMenu.clickApplicationCi();
414
- await this.applicationPage.contextMenu.clickMenuPath([
415
- "import",
416
- "fromComputer"
417
- ]);
25
+ async verifyDeployTextIsPresent() {
26
+ const title = this.page.getByTitle("digital.ai");
27
+ await (0, $lE6ZQ$expect)(title).toBeVisible();
418
28
  }
419
29
  }
420
30
 
421
31
 
422
32
 
423
33
 
424
- class $f6d52f442cf07ec8$export$3e41faf802a29e71 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
425
- constructor(page){
426
- super(page);
427
- this.page = page;
428
- this.parentTabLocator = this.page.locator(".working-panel-section .xl-react-tab-system");
429
- this.getTabTitleLocator = this.parentTabLocator.locator("li.active .tab-title");
430
- this.closeIcon = this.page.locator(".xl-icon.close-ico");
431
- this.tabSelector = this.parentTabLocator.locator(".tab-pane");
432
- this.tabTitle = this.parentTabLocator.locator(".tab-title");
433
- }
434
- /**
435
- * Assert active tab title with expected value.
436
- * @param expectedCiType
437
- * @returns
438
- */ async assertActiveTabSelector(expectedCiType) {
439
- return await (0, $lE6ZQ$expect)(this.getTabTitleLocator).toHaveText(expectedCiType, {
440
- ignoreCase: true
441
- });
442
- }
443
- /**
444
- * Close the active tab by clicking close button
445
- */ async closeActiveTabs() {
446
- if (await this.closeIcon.isVisible()) await this.parentTabLocator.locator(".nav .active .close-icon").click();
447
- }
448
- /**
449
- * Verify there is no tabs are opened.
450
- */ async noTabsOpened() {
451
- await (0, $lE6ZQ$expect)(this.tabSelector).not.toBeVisible();
452
- }
453
- /**
454
- * Expect the given tab title is present in tab opened
455
- * @param tabTitle
456
- * @returns
457
- */ async expectTabOpened(tabTitle) {
458
- return await (0, $lE6ZQ$expect)(this.tabTitle).toHaveText(tabTitle);
459
- }
460
- /**
461
- * Expect the given tab title is not present in tab opened
462
- * @param tabTitle
463
- * @returns
464
- */ async expectTabNotOpened(tabTitle) {
465
- return await (0, $lE6ZQ$expect)(this.tabTitle).not.toHaveText(tabTitle);
466
- }
467
- }
468
-
469
-
470
-
471
- class $6d0b1fc17db4a5fb$export$133beb65adbc45a3 extends (0, $54bcd1bcf08dd053$export$d9b273488cd8ce6f) {
472
- constructor(page){
473
- super(page.locator("#context-menu-popover"), page.locator("i[data-id=Applications].context-menu-button"), page.locator(".dropdown-menu.multi-level.dropdown-menu-0"));
474
- this.page = page;
475
- this.applicationLocator = page.locator('div[data-id="Applications"]');
476
- this.environmentLocator = page.locator('div[data-id="Environments"]');
477
- }
34
+ class $ca2721b1aeb903c5$export$ecdc3cf9d1cfe143 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
478
35
  /**
479
- * Click on application CI in contextual-menu option.
480
- */ async clickApplicationCi() {
481
- await this.applicationLocator.click();
482
- await this.openContextualMenuDots();
483
- }
484
- /**
485
- * Click on application CI in contextual-menu option.
486
- */ async clickEnvironmentCi() {
487
- await this.environmentLocator.click();
488
- await this.openContextualMenuDots();
489
- }
490
- /**
491
- * Click on menu items from contextual-menu option using path navigation option
492
- * @param path: Provide menu navigation path using array
493
- * eg: ['new','Application'] -> to click on menu to create new application
494
- */ async clickMenuPath(path) {
495
- const count = path.length - 1;
496
- for(let i = 0; i < count; i++)await this.page.getByRole("link", {
497
- name: "" + path[i] + ""
36
+ * Login with username and password
37
+ * @param userName
38
+ * @param password
39
+ */ // this should be refactored to take an object and not disable the rule!!
40
+ // eslint-disable-next-line max-params
41
+ async createNewUser(username, fullName, email, password, confirmPassword) {
42
+ await this.page.locator("p.MuiTypography-root", {
43
+ hasText: "Users"
44
+ }).click();
45
+ await this.page.getByRole("button", {
46
+ name: "Add user"
47
+ }).click();
48
+ await this.page.locator('input[name="username"]').fill(username);
49
+ await this.page.locator('input[name="fullName"]').fill(fullName);
50
+ await this.page.locator('input[name="email"]').fill(email);
51
+ const passwordInput = this.page.locator('input[name="password"]');
52
+ await passwordInput.click({
53
+ force: true
54
+ });
55
+ await passwordInput.fill(password);
56
+ await this.page.locator('input[name="confirmPassword"]').fill(confirmPassword);
57
+ await this.page.getByRole("button", {
58
+ name: "Save"
498
59
  }).click();
499
- await this.page.locator('.popover-content li[data-path="' + path.join("->") + '"]').click();
500
- }
501
- }
502
-
503
-
504
-
505
-
506
- class $4baf6ba7e224a0ed$export$13ee474454c1948e extends (0, $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8) {
507
- constructor(parentLocator, page){
508
- super(parentLocator, page.locator(".dip-view-body"));
509
- this.page = page;
510
- this.inputName = page.locator('input[name="name"]');
511
- this.inputLatestVersion = page.locator('input[name="lastVersion"]');
512
- this.saveButton = page.getByRole("button", {
513
- name: "Save",
514
- exact: true
515
- });
516
- this.saveAndCloseButton = page.getByRole("button", {
517
- name: "Save and close",
518
- exact: true
519
- });
520
- this.cancelButton = page.getByRole("button", {
521
- name: "Cancel",
522
- exact: true
523
- });
524
- this.errorMessage = page.locator(".error");
525
- this.formSection = page.locator(".xl-react-components.xl-react-dip-dynamic-form");
526
- this.refreshButton = page.locator("i.refresh");
527
- this.inputRename = page.locator(".infinite-tree-rename-input");
528
- }
529
- /**
530
- * Enter name in name field of the application form
531
- * @param name
532
- * @returns
533
- */ async enterName(name) {
534
- return await this.findElementInSection(this.inputName).fill(name);
535
- }
536
- /**
537
- * Enter latest version field
538
- * @param version
539
- * @returns
540
- */ async enterLatestVersion(version) {
541
- return await this.findElementInSection(this.inputLatestVersion).fill(version);
542
- }
543
- /**
544
- * Click save button
545
- * @returns
546
- */ async clickSave() {
547
- return await this.findElementInSection(this.saveButton).click();
548
- }
549
- /**
550
- * Click save and close button
551
- * @returns
552
- */ async clickSaveAndClose() {
553
- return await this.findElementInSection(this.saveAndCloseButton).click();
554
- }
555
- /**
556
- * Click cancel button
557
- * @returns
558
- */ async clickCancel() {
559
- return await this.findElementInSection(this.cancelButton).click();
560
- }
561
- /**
562
- * Expecting save button is disabled
563
- * @returns
564
- */ async assertSaveButtonIsDisabled() {
565
- return await (0, $lE6ZQ$expect)(this.findElementInSection(this.saveButton)).toBeDisabled();
566
- }
567
- /**
568
- * Expecting Save and close button is disabled
569
- * @returns
570
- */ async assertSaveAndCloseButtonIsDisabled() {
571
- return await (0, $lE6ZQ$expect)(this.findElementInSection(this.saveAndCloseButton)).toBeDisabled();
572
60
  }
573
- /**
574
- * Verify Error message in the form
575
- * @param errorMsg
576
- * @returns
577
- */ async verifyErrorMessage(errorMsg) {
578
- return (0, $lE6ZQ$expect)(await this.findElementInSection(this.errorMessage).textContent()).toContain(errorMsg);
61
+ async verifySuccessMessage() {
62
+ const SuccessMessage = this.page.getByRole("alertdialog");
63
+ await (0, $lE6ZQ$expect)(SuccessMessage).toBeVisible();
64
+ await (0, $lE6ZQ$expect)(SuccessMessage).toHaveText(/User ".*" created/i);
579
65
  }
580
- /**
581
- * Verify field value in form using field name
582
- * @param fieldName
583
- * @param expectedValue
584
- * @returns
585
- */ async verifyFieldValue(fieldName, expectedValue) {
586
- const label = this.formSection.locator('//label[text()="' + fieldName + '"]/parent::div/parent::div');
587
- const input = label.locator(".xl-react-components-input input");
588
- const result = await input.getAttribute("value");
589
- return (0, $lE6ZQ$expect)(result).toEqual(expectedValue);
66
+ async verifyUserErrorMessage() {
67
+ await (0, $lE6ZQ$expect)(this.page.locator('.rrt-middle-container[role="alertdialog"]').nth(1)).toContainText(/already in use/i);
590
68
  }
591
- }
592
-
593
-
594
-
595
- class $1f57a739e2592b82$export$2b77a92f1a5ad772 extends (0, $b464119f5ec5aad0$export$6e2c8f0811a474ce) {
596
- constructor(parentLocator, page){
597
- super(parentLocator, page.locator(".xl-react-modal-content"));
598
- this.header = page.locator(".modal-header");
599
- this.body = page.locator(".modal-body");
600
- this.footer = page.locator(".modal-footer");
601
- }
602
- }
603
-
604
-
605
- class $9a8685efb2ff62b1$export$bd6452a745ffdb18 extends (0, $1f57a739e2592b82$export$2b77a92f1a5ad772) {
606
- constructor(parentLocator, page){
607
- super(parentLocator, page);
608
- this.deleteButton = page.getByRole("button", {
69
+ async deleteTheUserAndVerifyItIsDeleted(username) {
70
+ await this.page.locator("p.MuiTypography-root", {
71
+ hasText: "Users"
72
+ }).click();
73
+ await this.page.waitForTimeout(10000);
74
+ await this.page.getByPlaceholder("Filter...").fill(username);
75
+ await this.page.waitForTimeout(10000);
76
+ await this.page.locator("td.users-table-actions button.delete.xl-icon.table-action").click();
77
+ await this.page.getByRole("button", {
609
78
  name: "Delete",
610
79
  exact: true
611
- });
612
- this.cancelButton = page.getByRole("button", {
613
- name: "Cancel",
614
- exact: true
615
- });
616
- this.moveButton = page.getByRole("button", {
617
- name: "Move",
618
- exact: true
619
- });
620
- }
621
- async clickDelete() {
622
- await this.footer.locator(this.deleteButton).click();
623
- }
624
- async clickCancel() {
625
- await this.footer.locator(this.cancelButton).click();
626
- }
627
- async clickMove() {
628
- await this.footer.locator(this.moveButton).click();
629
- }
630
- }
631
-
632
-
633
-
634
-
635
-
636
-
637
-
638
-
639
- class $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9 {
640
- constructor(page){
641
- this.page = page;
642
- this.contextMenu = new (0, $6d0b1fc17db4a5fb$export$133beb65adbc45a3)(page);
643
- this.tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
644
- this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
645
- this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
646
- }
647
- /**
648
- * Create new ci under any explorer package by providing following parameters.
649
- * @param parentNodeId
650
- * @param menuPath
651
- * @param expectedCiType
652
- * @param fieldName
653
- */ async createNewCi(parentNodeId, menuPath, fieldName) {
654
- await this.expandNodePath(parentNodeId);
655
- await this.page.locator('div[data-id="' + parentNodeId + '"]').click();
656
- await this.page.locator('i[data-id="' + parentNodeId + '"].context-menu-button').click();
657
- await this.contextMenu.clickMenuPath(menuPath);
658
- await this.form.assertSaveButtonIsDisabled();
659
- await this.form.assertSaveAndCloseButtonIsDisabled();
660
- await this.tab.assertActiveTabSelector("Create udm." + menuPath[1] + "");
661
- await this.form.enterName(fieldName);
662
- await this.form.clickSaveAndClose();
663
- }
664
- /**
665
- * Expand the ci path tree toggler.
666
- * @param pathnode
667
- */ async expandNode(pathnode) {
668
- const nodeLocator = await this.page.locator('div[data-id="' + pathnode + '"] a.infinite-tree-toggler.infinite-tree-closed').isVisible();
669
- if (nodeLocator) await this.page.locator('div[data-id="' + pathnode + '"] a.infinite-tree-toggler.infinite-tree-closed').click();
670
- }
671
- /**
672
- * expands the path of CI by separating path from "/"
673
- * @param parentNodeId
674
- */ async expandNodePath(parentNodeId) {
675
- const ci = await this.page.isVisible('div[data-id="' + parentNodeId + '"]');
676
- if (!ci) {
677
- const nodeIdParts = $lE6ZQ$split("/", parentNodeId);
678
- for(let ind = 0; ind < nodeIdParts.length; ind++){
679
- const path = $lE6ZQ$join("/", $lE6ZQ$take(ind + 1, nodeIdParts));
680
- await this.expandNode(path);
681
- }
682
- }
683
- }
684
- /**
685
- * Collapse the tree toggler of ci path.
686
- * @param parentNodeId
687
- */ async collapseNode(parentNodeId) {
688
- if (await this.page.locator('div[data-id="' + parentNodeId + '"] a.infinite-tree-toggler.infinite-tree-closed').isHidden()) await this.page.locator('div[data-id="' + parentNodeId + '"] a').click();
689
- }
690
- /**
691
- * Delete the ci
692
- * @param node
693
- */ async deleteCi(node) {
694
- const cipath = this.page.locator('div[data-id="' + node + '"]');
695
- if (await cipath.isVisible()) await this.page.locator('div[data-id="' + node + '"]').click();
696
- else {
697
- await this.expandNodePath(node);
698
- await this.page.locator('div[data-id="' + node + '"]').click();
699
- }
700
- await this.page.locator('i[data-id="' + node + '"].context-menu-button').click();
701
- await this.contextMenu.clickMenuPath([
702
- "delete"
703
- ]);
704
- await this.modal.clickDelete();
705
- }
706
- /**
707
- * Click on specific node which is under Application CI.
708
- * @param nodeId
709
- */ async clickNode(nodeId) {
710
- await this.page.locator('div[data-id="' + nodeId + '"]').dblclick();
711
- }
712
- /**
713
- * Click on ci under any explorer package of contextual menus by providing following parameters.
714
- * @param parentNodeId
715
- * @param menuPath
716
- * @param expectedCiType
717
- * @param fieldName
718
- */ async clickCi(parentNodeId, menuPath, expectedCiType) {
719
- await this.expandNodePath(parentNodeId);
720
- await this.page.locator('div[data-id="' + parentNodeId + '"]').click();
721
- await this.page.locator('i[data-id="' + parentNodeId + '"].context-menu-button').click();
722
- await this.contextMenu.clickMenuPath(menuPath);
723
- await this.form.assertSaveButtonIsDisabled();
724
- await this.form.assertSaveAndCloseButtonIsDisabled();
725
- await this.tab.assertActiveTabSelector("Create " + expectedCiType + "");
726
- }
727
- /**
728
- * Duplicate the CI node in explorer using context-menu
729
- * @param nodeId
730
- */ async duplicate(nodeId) {
731
- await this.expandNodePath(nodeId);
732
- await this.page.locator('div[data-id="' + nodeId + '"]').click();
733
- await this.page.locator('i[data-id="' + nodeId + '"].context-menu-button').click();
734
- await this.contextMenu.clickMenuPath([
735
- "duplicate"
736
- ]);
737
- }
738
- /**
739
- * Validate the given node ID is visible in the page
740
- * @param nodeId
741
- */ async validateNodeExists(nodeId) {
742
- await (0, $lE6ZQ$expect)(this.page.locator('div[data-id="' + nodeId + '"]')).toBeVisible();
743
- }
744
- /**
745
- * Validate the given node does not exists in the list.
746
- * @param nodeId
747
- */ async validateNodeDoesNotExists(nodeId) {
748
- await (0, $lE6ZQ$expect)(this.page.locator('div[data-id="' + nodeId + '"]')).not.toBeVisible();
749
- }
750
- /**
751
- * Rename the node Id with new string in CI.
752
- * @param nodeId
753
- * @param renamedValue
754
- */ async inlineRename(nodeId, renamedValue) {
755
- await this.expandNodePath(nodeId);
756
- await this.page.locator('div[data-id="' + nodeId + '"]').click();
757
- await this.page.locator('i[data-id="' + nodeId + '"].context-menu-button').click();
758
- await this.contextMenu.clickMenuPath([
759
- "rename"
760
- ]);
761
- await this.form.inputRename.waitFor();
762
- await this.form.inputRename.fill(renamedValue);
763
- await this.form.refreshButton.click();
764
- await (0, $lE6ZQ$expect)(this.page.locator('div[data-id="' + nodeId + '"]')).not.toBeVisible();
765
- }
766
- /**
767
- * Open CI from explorer
768
- * @param nodeId
769
- */ async openCi(nodeId) {
770
- if (await this.page.locator('.infinite-tree-item[data-id="' + nodeId + '"]').isVisible()) await this.page.locator('.infinite-tree-item[data-id="' + nodeId + '"]').dblclick();
771
- else {
772
- await this.expandNodePath(nodeId);
773
- await this.page.waitForSelector('.infinite-tree-item[data-id="' + nodeId + '"]');
774
- await this.page.locator('.infinite-tree-item[data-id="' + nodeId + '"]').dblclick();
775
- }
776
- }
777
- /**
778
- * Select the CI which need to get deleted.
779
- * @param nodeId
780
- */ async selectDeleteCi(nodeId) {
781
- const cipath = this.page.locator('div[data-id="' + nodeId + '"]');
782
- if (await cipath.isVisible()) await this.page.locator('div[data-id="' + nodeId + '"]').click();
783
- else {
784
- await this.expandNodePath(nodeId);
785
- await this.page.locator('div[data-id="' + nodeId + '"]').click();
786
- }
787
- await this.page.locator('i[data-id="' + nodeId + '"].context-menu-button').click();
788
- await this.contextMenu.clickMenuPath([
789
- "delete"
790
- ]);
791
- }
792
- /**
793
- * Click cancel button on modal window to cancel deletion.
794
- */ async clickCancelAndWait() {
795
- await this.modal.clickCancel();
796
- }
797
- /**
798
- * Click Delete button on modal window to delete the CI
799
- */ async clickConfirmAndWait() {
800
- await this.modal.clickDelete();
801
- }
802
- /**
803
- * Move ci
804
- * @param source_path
805
- * @param target_path
806
- */ async moveCi(source_path, target_path) {
807
- const source_cipath = this.page.locator('div[data-id="' + source_path + '"]');
808
- const target_cipath = this.page.locator('div[data-id="' + target_path + '"]');
809
- await this.expandNodePath(source_path);
810
- //TODO: Find a better way to make sure target can be expanded without error, current implementation is workaround
811
- await this.page.locator('div[data-id="' + target_path + '"]').textContent();
812
- await this.expandNodePath(target_path);
813
- await source_cipath.dragTo(target_cipath);
814
- }
815
- /**
816
- * Click Move button on modal window to Move the CIs
817
- */ async clickMoveAndWait() {
818
- await this.modal.clickMove();
80
+ }).click();
81
+ const DeleteMessage = this.page.getByRole("alertdialog");
82
+ await (0, $lE6ZQ$expect)(DeleteMessage).toBeVisible();
83
+ await (0, $lE6ZQ$expect)(DeleteMessage).toHaveText(/User ".*" deleted/i);
819
84
  }
820
- }
821
-
822
-
823
-
824
-
825
- class $6cefee8b9be33b2d$export$60413e28724d3abd extends (0, $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8) {
826
- constructor(parentLocator, page){
827
- super(parentLocator, page.locator(".dip-view-body"));
828
- this.page = page;
829
- this.inputName = page.locator('input[name="name"]');
830
- this.inputLatestVersion = page.locator('input[name="lastVersion"]');
831
- this.saveButton = page.getByRole("button", {
85
+ async editUserAndVerify(username, editfullname) {
86
+ await this.page.locator("p.MuiTypography-root", {
87
+ hasText: "Users"
88
+ }).click();
89
+ await this.page.waitForTimeout(10000);
90
+ await this.page.getByPlaceholder("Filter...").fill(username);
91
+ await this.page.waitForTimeout(10000);
92
+ await this.page.locator("i.icon-edit.dot-i").first().click();
93
+ await this.page.locator('input[name="fullName"]').fill(editfullname);
94
+ await this.page.getByRole("button", {
832
95
  name: "Save",
833
96
  exact: true
834
- });
835
- this.saveAndCloseButton = page.getByRole("button", {
836
- name: "Save and close",
837
- exact: true
838
- });
839
- this.cancelButton = page.getByRole("button", {
840
- name: "Cancel",
841
- exact: true
842
- });
843
- this.formSection = page.locator(".xl-react-components.xl-react-dip-dynamic-form");
844
- this.addButton = page.locator(".xl-btn-add");
845
- }
846
- /**
847
- * Enter name in name field of the application form
848
- * @param name
849
- * @returns
850
- */ async enterName(name) {
851
- return await this.findElementInSection(this.inputName).fill(name);
852
- }
853
- /**
854
- * Enter latest version field
855
- * @param version
856
- * @returns
857
- */ async enterLatestVersion(version) {
858
- return await this.findElementInSection(this.inputLatestVersion).fill(version);
859
- }
860
- /**
861
- * Click save button
862
- * @returns
863
- */ async clickSave() {
864
- return await this.findElementInSection(this.saveButton).click();
865
- }
866
- /**
867
- * Click save and close button
868
- * @returns
869
- */ async clickSaveAndClose() {
870
- return await this.findElementInSection(this.saveAndCloseButton).click();
871
- }
872
- /**
873
- * Click cancel button
874
- * @returns
875
- */ async clickCancel() {
876
- return await this.findElementInSection(this.cancelButton).click();
877
- }
878
- /**
879
- * Expecting save button is disabled
880
- * @returns
881
- */ async assertSaveButtonIsDisabled() {
882
- return await (0, $lE6ZQ$expect)(this.findElementInSection(this.saveButton)).toBeDisabled();
883
- }
884
- /**
885
- * Expecting Save and close button is disabled
886
- * @returns
887
- */ async assertSaveAndCloseButtonIsDisabled() {
888
- return await (0, $lE6ZQ$expect)(this.findElementInSection(this.saveAndCloseButton)).toBeDisabled();
889
- }
890
- /**
891
- * Enter Field Values using its label value around application forms
892
- * @param fieldName
893
- * @param expectedValue
894
- * @returns
895
- */ async addFieldValue(fieldName, expectedValue) {
896
- const label = this.formSection.locator('//label[text()="' + fieldName + '"]/parent::div/parent::div');
897
- const input = label.locator(".xl-react-components-input input");
898
- await input.fill(expectedValue);
899
- await input.press("Enter");
900
- const result = await input.getAttribute("value");
901
- return (0, $lE6ZQ$expect)(result).toEqual(expectedValue);
902
- }
903
- async addOrchestrator(fieldValue) {
904
- const label = this.formSection.locator('//label[text()="Orchestrator"]/parent::div/parent::div');
905
- const input = label.locator(".xl-react-components-input input");
906
- await input.fill(fieldValue);
907
- await this.addButton.click();
908
- await this.saveButton.waitFor();
909
- await this.saveButton.click();
910
- const result = await this.page.locator("span.text-container").getAttribute("title");
911
- return (0, $lE6ZQ$expect)(result).toEqual(fieldValue);
912
- }
913
- }
914
-
915
-
916
- class $4e7e9f7ca5788871$export$bf4a5dd3be690f6b extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
917
- constructor(page){
918
- super(page);
919
- this.contextMenu = new (0, $6d0b1fc17db4a5fb$export$133beb65adbc45a3)(page);
920
- this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
921
- this.tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
922
- this.util = new (0, $85032414fe55e0f1$export$7db63d2c950874b5)(this, page);
923
- this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
924
- this.commonUtil = new (0, $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9)(page);
925
- this.appForm = new (0, $6cefee8b9be33b2d$export$60413e28724d3abd)(page.locator(".Pane.vertical.Pane2"), page);
97
+ }).click();
98
+ const EditMessage = this.page.getByRole("alertdialog");
99
+ await (0, $lE6ZQ$expect)(EditMessage).toBeVisible();
100
+ const editedUsername = this.page.locator("td.users-table-fullName div").textContent();
101
+ // eslint-disable-next-line no-console
102
+ console.log(editedUsername);
926
103
  }
927
104
  }
928
105
 
929
106
 
930
-
931
-
932
- class $736a7a3b2d786796$export$36d69433c4f81145 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
107
+ class $95d5ebc9765b570f$export$b8a61e5c71402559 {
933
108
  constructor(page){
934
- super(page);
935
- }
936
- }
937
-
938
-
939
-
940
-
941
-
942
-
943
-
944
-
945
-
946
-
947
-
948
- class $07a0aa0673096895$export$855563f8bdb36207 extends (0, $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8) {
949
- constructor(parentLocator, page){
950
- super(parentLocator, page.locator(".dip-view-body"));
951
109
  this.page = page;
952
- this.inputName = page.locator('input[name="name"]');
953
- this.inputLatestVersion = page.locator('input[name="lastVersion"]');
954
- this.saveButton = page.getByRole("button", {
955
- name: "Save",
956
- exact: true
957
- });
958
- this.saveAndCloseButton = page.getByRole("button", {
959
- name: "Save and close",
960
- exact: true
961
- });
962
- this.cancelButton = page.getByRole("button", {
963
- name: "Cancel",
964
- exact: true
965
- });
966
- this.inputHost = page.locator('input[name="host"]');
967
- this.inputPort = page.getByLabel("Port");
968
- this.inputUsername = page.locator('input[name="username"]');
969
- this.inputPassword = page.locator('input[name="password"]');
970
- this.inputFromAddress = page.locator('input[name="fromAddress"]');
971
- this.inputTestAddress = page.locator('input[name="testAddress"]');
972
- this.inputHostName = page.locator('input[name="hostname"]');
973
- }
974
- /**
975
- * Enter name in name field of the configuration form
976
- * @param name
977
- * @returns
978
- */ async enterName(name) {
979
- return await this.findElementInSection(this.inputName).fill(name);
980
- }
981
- /**
982
- * Enter latest version field
983
- * @param version
984
- * @returns
985
- */ async enterLatestVersion(version) {
986
- return await this.findElementInSection(this.inputLatestVersion).fill(version);
987
- }
988
- /**
989
- * Click save button
990
- * @returns
991
- */ async clickSave() {
992
- return await this.findElementInSection(this.saveButton).click();
993
- }
994
- /**
995
- * Click save and close button
996
- * @returns
997
- */ async clickSaveAndClose() {
998
- return await this.findElementInSection(this.saveAndCloseButton).click();
999
- }
1000
- /**
1001
- * Click cancel button
1002
- * @returns
1003
- */ async clickCancel() {
1004
- return await this.findElementInSection(this.cancelButton).click();
1005
- }
1006
- /**
1007
- * Expecting save button is disabled
1008
- * @returns
1009
- */ async assertSaveButtonIsDisabled() {
1010
- return await (0, $lE6ZQ$expect)(this.findElementInSection(this.saveButton)).toBeDisabled();
1011
- }
1012
- /**
1013
- * Expecting Save and close button is disabled
1014
- * @returns
1015
- */ async assertSaveAndCloseButtonIsDisabled() {
1016
- return await (0, $lE6ZQ$expect)(this.findElementInSection(this.saveAndCloseButton)).toBeDisabled();
1017
- }
1018
- /**
1019
- * Expecting field value with its field name
1020
- * @param fieldName
1021
- * @param value
1022
- * @returns
1023
- */ async expectFieldValue(fieldName, value) {
1024
- (0, $lE6ZQ$expect)(await this.page.locator('input[name="' + fieldName + '"]').getAttribute("value")).toEqual(value);
1025
- }
1026
- /**
1027
- * Set Host value to the Host field in configuration form
1028
- * @param host
1029
- * @returns
1030
- */ async setHostValue(host) {
1031
- await this.findElementInSection(this.inputHost).fill(host);
1032
- }
1033
- /**
1034
- * Setting port value in the configuration form
1035
- * @param port
1036
- * @returns
1037
- */ async setPortValue(port) {
1038
- await this.findElementInSection(this.inputPort).fill(port);
110
+ this.homePage = new (0, $e18c8d3707c8c74c$export$36d69433c4f81145)(page);
111
+ this.userPage = new (0, $ca2721b1aeb903c5$export$ecdc3cf9d1cfe143)(page);
1039
112
  }
1040
- /**
1041
- * Setting from Address field value in configuration form
1042
- * @param address
1043
- * @returns
1044
- */ async setFromAddress(address) {
1045
- await this.findElementInSection(this.inputFromAddress).fill(address);
1046
- }
1047
- /**
1048
- * Setting username in configuration form
1049
- * @param username
1050
- * @returns
1051
- */ async setUserName(username) {
1052
- await this.findElementInSection(this.inputUsername).fill(username);
113
+ async navigateToHomePage() {
114
+ await this.page.goto("/home");
1053
115
  }
1054
- /**
1055
- * Setting password in configuration form
1056
- * @param password
1057
- * @returns
1058
- */ async setPassword(password) {
1059
- await this.findElementInSection(this.inputPassword).fill(password);
116
+ async navigateToUserPage() {
117
+ await this.page.locator("p.MuiTypography-root", {
118
+ hasText: "User management"
119
+ }).click();
1060
120
  }
1061
- /**
1062
- * Setting host name in configuration form
1063
- * @param hostname
1064
- * @returns
1065
- */ async setHostName(hostname) {
1066
- await this.findElementInSection(this.inputHostName).fill(hostname);
121
+ async clickCollapseSideView() {
122
+ const collapseButton = this.page.getByTestId("back-button");
123
+ await collapseButton.click();
1067
124
  }
1068
125
  }
1069
126
 
1070
127
 
1071
- class $e0ba9f6e7147a59d$export$ad55ec59bf82c4fc {
1072
- constructor(page1, page){
1073
- this.configPage = page1;
1074
- this.page = page;
1075
- }
1076
- }
1077
-
1078
128
 
1079
- class $c4efd1bbc33bdc4e$export$8ef81de2d4ebb0b9 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1080
- constructor(page){
1081
- super(page);
1082
- this.contextMenu = new (0, $6d0b1fc17db4a5fb$export$133beb65adbc45a3)(page);
1083
- this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
1084
- this.tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
1085
- this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
1086
- this.commonUtil = new (0, $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9)(page);
1087
- this.configForm = new (0, $07a0aa0673096895$export$855563f8bdb36207)(page.locator(".Pane.vertical.Pane2"), page);
1088
- this.util = new (0, $e0ba9f6e7147a59d$export$ad55ec59bf82c4fc)(this, page);
1089
- }
1090
- }
1091
129
 
1092
-
1093
-
1094
-
1095
-
1096
-
1097
-
1098
-
1099
-
1100
-
1101
- class $6bd08aebb33e3379$export$21cde1e6a73cf500 extends (0, $9f5bc0f6324fb5ea$export$a7fed597f4b8afd8) {
1102
- constructor(parentLocator, page){
1103
- super(parentLocator, page.locator(".dip-view-body"));
1104
- this.page = page;
1105
- this.formSection = page.locator(".xl-react-components.xl-react-dip-dynamic-form");
1106
- this.inputName = page.locator('input[name="name"]');
1107
- this.inputLatestVersion = page.locator('input[name="lastVersion"]');
1108
- this.saveButton = page.getByRole("button", {
1109
- name: "Save",
1110
- exact: true
130
+ class $c5e912d43cd579b2$export$f14c0e3f98d164c0 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
131
+ /**
132
+ * Login with username and password
133
+ * @param userName
134
+ * @param password
135
+ */ async login(userName, password) {
136
+ await this.page.goto("/#/login");
137
+ await (0, $lE6ZQ$expect)(this.page).toHaveTitle("Digital.ai Deploy");
138
+ await this.page.getByPlaceholder("user").fill(userName, {
139
+ timeout: 1000
1111
140
  });
1112
- this.saveAndCloseButton = page.getByRole("button", {
1113
- name: "Save and close",
1114
- exact: true
141
+ await this.page.getByPlaceholder("Password").fill(password, {
142
+ timeout: 10000
1115
143
  });
1116
- this.cancelButton = page.getByRole("button", {
1117
- name: "Cancel",
1118
- exact: true
144
+ await this.page.getByRole("button", {
145
+ name: "Log in"
146
+ }).click({
147
+ timeout: 10000
1119
148
  });
1120
- this.inputVersion = page.locator("");
1121
- }
1122
- /**
1123
- * Expect the label text is available in form.
1124
- * @param label
1125
- */ async assertLabelText(label) {
1126
- await (0, $lE6ZQ$expect)(this.page.getByText(label, {
1127
- exact: true
1128
- })).toBeVisible();
1129
- }
1130
- /**
1131
- * Enter name in name field of the application form
1132
- * @param name
1133
- * @returns
1134
- */ async enterName(name) {
1135
- return await this.findElementInSection(this.inputName).fill(name);
1136
149
  }
1137
- /**
1138
- * Enter latest version field
1139
- * @param version
1140
- * @returns
1141
- */ async enterLatestVersion(version) {
1142
- return await this.findElementInSection(this.inputLatestVersion).fill(version);
150
+ async verifyInvalidPasswordMessage() {
151
+ const errorMessage = this.page.getByText("The username and/or password you have entered is incorrect.");
152
+ await (0, $lE6ZQ$expect)(errorMessage).toBeVisible();
1143
153
  }
1144
154
  /**
1145
- * Click save button
1146
- * @returns
1147
- */ async clickSave() {
1148
- return await this.findElementInSection(this.saveButton).click();
1149
- }
1150
- /**
1151
- * Click save and close button
1152
- * @returns
1153
- */ async clickSaveAndClose() {
1154
- return await this.findElementInSection(this.saveAndCloseButton).click();
1155
- }
1156
- /**
1157
- * Click cancel button
1158
- * @returns
1159
- */ async clickCancel() {
1160
- return await this.findElementInSection(this.cancelButton).click();
1161
- }
1162
- /**
1163
- * Expecting save button is disabled
1164
- * @returns
1165
- */ async assertSaveButtonIsDisabled() {
1166
- return await (0, $lE6ZQ$expect)(this.findElementInSection(this.saveButton)).toBeDisabled();
1167
- }
1168
- /**
1169
- * Expecting Save and close button is disabled
1170
- * @returns
1171
- */ async assertSaveAndCloseButtonIsDisabled() {
1172
- return await (0, $lE6ZQ$expect)(this.findElementInSection(this.saveAndCloseButton)).toBeDisabled();
1173
- }
1174
- /**
1175
- * Enter options in the input field of dropdown to match with suggestion list in form
1176
- * @param fieldName
1177
- * @param value
1178
- */ async selectVersionOption(fieldName, value) {
1179
- const label = this.formSection.locator('//label[text()="' + fieldName + '"]/parent::div/parent::div');
1180
- await label.locator(".xl-react-components-input input").fill(value);
1181
- }
1182
- }
1183
-
1184
-
1185
- class $31f14a5153b274ab$export$b8a8d62f66d27fa1 {
1186
- constructor(page1, page){
1187
- this.environmentPage = page1;
1188
- this.page = page;
1189
- }
1190
- }
1191
-
1192
-
1193
- class $5a95c11425d050d8$export$2c95c5c5be4fb9b0 extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1194
- constructor(page){
1195
- super(page);
1196
- this.contextMenu = new (0, $6d0b1fc17db4a5fb$export$133beb65adbc45a3)(page);
1197
- this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
1198
- this.tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
1199
- this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
1200
- this.commonUtil = new (0, $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9)(page);
1201
- this.envForm = new (0, $6bd08aebb33e3379$export$21cde1e6a73cf500)(page.locator(".xl-react-modal-open"), page);
1202
- this.util = new (0, $31f14a5153b274ab$export$b8a8d62f66d27fa1)(this, page);
1203
- }
1204
- }
1205
-
1206
-
1207
-
1208
-
1209
-
1210
-
1211
-
1212
-
1213
- class $bf1ec3be2f174e87$export$1f6beddb119e759b extends (0, $7d546dcaafadc158$export$2b65d1d97338f32b) {
1214
- constructor(page){
1215
- super(page);
1216
- this.contextMenu = new (0, $6d0b1fc17db4a5fb$export$133beb65adbc45a3)(page);
1217
- this.form = new (0, $4baf6ba7e224a0ed$export$13ee474454c1948e)(page.locator(".Pane.vertical.Pane2"), page);
1218
- this.tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
1219
- this.modal = new (0, $9a8685efb2ff62b1$export$bd6452a745ffdb18)(page.locator(".xl-react-modal-open"), page);
1220
- this.commonUtil = new (0, $0ced90cc8a4c42e6$export$5a20f96f6e2d29e9)(page);
155
+ * Logout as authenticated user
156
+ */ async logout() {
157
+ await this.page.locator("button.dot-avatar").click();
158
+ await this.page.getByText("Log out", {
159
+ exact: true
160
+ }).click();
161
+ await (0, $lE6ZQ$expect)(this.page.getByText("Log in").first()).toBeVisible();
1221
162
  }
1222
163
  }
1223
164
 
1224
165
 
1225
166
  const $114b0b206b8d644f$export$e0969da9b8fb378d = (0, $lE6ZQ$test).extend({
167
+ fixtures: async ({ page: page }, use)=>{
168
+ const fixtures = new $114b0b206b8d644f$var$Fixtures(page);
169
+ await use(fixtures);
170
+ return fixtures;
171
+ },
1226
172
  loginPage: async ({ page: page }, use)=>{
1227
- // Set up the fixture.
1228
- const loginPage = new (0, $c2c31ea6199a3576$export$f14c0e3f98d164c0)(page);
173
+ const loginPage = new (0, $c5e912d43cd579b2$export$f14c0e3f98d164c0)(page);
1229
174
  await use(loginPage);
1230
175
  return loginPage;
1231
176
  },
1232
- homePage: async ({ page: page }, use)=>{
1233
- const homePage = new (0, $736a7a3b2d786796$export$36d69433c4f81145)(page);
1234
- await use(homePage);
1235
- return homePage;
1236
- },
1237
- applicationPage: async ({ page: page }, use)=>{
1238
- const applicationPage = new (0, $4e7e9f7ca5788871$export$bf4a5dd3be690f6b)(page);
1239
- await use(applicationPage);
1240
- return applicationPage;
1241
- },
1242
- tab: async ({ page: page }, use)=>{
1243
- const tab = new (0, $f6d52f442cf07ec8$export$3e41faf802a29e71)(page);
1244
- await use(tab);
1245
- return tab;
1246
- },
1247
- environmentPage: async ({ page: page }, use)=>{
1248
- const environmentPage = new (0, $5a95c11425d050d8$export$2c95c5c5be4fb9b0)(page);
1249
- await use(environmentPage);
1250
- return environmentPage;
1251
- },
1252
- configurePage: async ({ page: page }, use)=>{
1253
- const configurePage = new (0, $c4efd1bbc33bdc4e$export$8ef81de2d4ebb0b9)(page);
1254
- await use(configurePage);
1255
- return configurePage;
1256
- },
1257
- infraPage: async ({ page: page }, use)=>{
1258
- const infraPage = new (0, $bf1ec3be2f174e87$export$1f6beddb119e759b)(page);
1259
- await use(infraPage);
1260
- return infraPage;
177
+ navigation: async ({ page: page }, use)=>{
178
+ const navigationPage = new (0, $95d5ebc9765b570f$export$b8a61e5c71402559)(page);
179
+ await use(navigationPage);
180
+ return navigationPage;
1261
181
  }
1262
182
  });
183
+ class $114b0b206b8d644f$var$Fixtures {
184
+ constructor(page){
185
+ this.page = page;
186
+ }
187
+ }
1263
188
 
1264
189
 
1265
190