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