@globisnv/cypress-core 2.0.0 → 2.1.0
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.
|
@@ -150,6 +150,20 @@ declare global {
|
|
|
150
150
|
* @example - cy.GLO_clickDatacontrolViewerButton('salesorder', 'btnAdd');
|
|
151
151
|
*/
|
|
152
152
|
GLO_clickDatacontrolViewerButton(pageName: string, buttonName: baseDatacontrolViewerButtonType, skipCheck?: skipCheckFlag): void;
|
|
153
|
+
/**
|
|
154
|
+
* Command to check the counter badges of a button within the main program datacontrol bar.
|
|
155
|
+
*
|
|
156
|
+
* The grey badge counts the attachments with a physical file or the closed notifications, the red badge the
|
|
157
|
+
* attachments without a physical file or the open notifications. A badge is hidden at 0, so passing 0 checks that it does not exist.
|
|
158
|
+
*
|
|
159
|
+
* @param {datacontrolCounterButtonType} buttonName - The datacontrol button with the counters.
|
|
160
|
+
* @param {number} greyCount - The expected grey count, 0 when there should be no grey badge.
|
|
161
|
+
* @param {number} redCount - The expected red count, 0 when there should be no red badge.
|
|
162
|
+
* @param {number} [timeOut = defaultTimeout] - The time to wait for the counters to update.
|
|
163
|
+
*
|
|
164
|
+
* @example - cy.GLO_checkDatacontrolCounter('btnAttachment', 3, 1);
|
|
165
|
+
*/
|
|
166
|
+
GLO_checkDatacontrolCounter(buttonName: datacontrolCounterButtonType, greyCount: number, redCount: number, timeOut?: number): void;
|
|
153
167
|
/**
|
|
154
168
|
* Command to click a button based on its displayed text.
|
|
155
169
|
*
|
|
@@ -472,6 +472,21 @@ Cypress.Commands.add('GLO_clickDatacontrolViewerButton', (pageName, buttonName,
|
|
|
472
472
|
cy.GLO_getElement([`ng$${pageName}_tab`, 'datacontrol_viewer']).find('[title="Save record"][disabled="true"]', { timeout: 60000 });
|
|
473
473
|
});
|
|
474
474
|
});
|
|
475
|
+
Cypress.Commands.add('GLO_checkDatacontrolCounter', (buttonName, greyCount, redCount, timeOut = defaultTimeout) => {
|
|
476
|
+
const button = `globiscomponents-data-control[name="datacontrol"]:visible #${buttonName}`;
|
|
477
|
+
// Without the button in view a 'not.exist' check below would pass for the wrong reason.
|
|
478
|
+
cy.get(button, { timeout: timeOut }).should('exist');
|
|
479
|
+
const checkBadge = (selector, count) => {
|
|
480
|
+
if (count > 0) {
|
|
481
|
+
cy.get(selector, { timeout: timeOut }).should('have.text', count.toString());
|
|
482
|
+
}
|
|
483
|
+
else {
|
|
484
|
+
cy.get(selector, { timeout: timeOut }).should('not.exist');
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
checkBadge(`${button} [counter-muted]`, greyCount);
|
|
488
|
+
checkBadge(`${button} [counter]:not([counter-muted])`, redCount);
|
|
489
|
+
});
|
|
475
490
|
Cypress.Commands.add('GLO_selectCompany', (companyName) => {
|
|
476
491
|
cy.GLO_addInput(['ng2$svy_nav_login', 'company'], companyName);
|
|
477
492
|
cy.get('[data-cy="ng2$svy_nav_login.btnLogin"]').click();
|
package/dist/types.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ type customValueTypeUndefined = customValueType | undefined;
|
|
|
11
11
|
type deleteRecordsType = 'DELETE_CYPRESS_RECORDS' | 'DELETE_LEAPWORK_RECORDS';
|
|
12
12
|
type viewModeButtonType = 'btnList' | 'btnDetail';
|
|
13
13
|
type datacontrolbuttonType = baseDatacontrolViewerButtonType | viewModeButtonType | 'btnPrev' | 'btnNext' | 'btnAll' | 'btnPivot' | 'btnAttachment' | 'btnAddMode' | 'btnEditMode' | 'btnDeleteMode' | 'btnDeeplink' | 'btnExtendedSearch' | 'btnCustomViews' | 'btnFilter' | 'btnClearAllFilters';
|
|
14
|
+
type datacontrolCounterButtonType = 'btnAttachment' | 'btnNotification';
|
|
14
15
|
type checkValueInGridType = string | string[] | number;
|
|
15
16
|
type selectMenuButtonLeftType = 'home' | 'settings' | 'help' | 'support' | 'excel' | 'info' | 'refresh' | 'query' | 'clients' | 'users' | 'theme';
|
|
16
17
|
type urlTypeType = 'online' | 'pos' | 'globgate' | 'globjob' | 'globscan' | 'portal' | 'carrier' | 'globtrace' | 'external_portal' | 'globtake' | 'globis_external_portal';
|