@globisnv/cypress-core 2.1.1 → 2.1.2

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.
@@ -17,5 +17,6 @@ export type objCountry = {
17
17
  postalCode?: string;
18
18
  city?: string;
19
19
  contextCountryCode?: string;
20
+ timezone?: string;
20
21
  };
21
22
  export declare const GLO_enterCountry: (obj: objCountry, part?: string) => void;
@@ -32,6 +32,7 @@ export const GLO_enterCountry = (obj, part = 'country') => {
32
32
  cy.GLO_checkbox([formName, 'checkbox_use_states'], obj.useStates);
33
33
  cy.GLO_addInput([formName, 'street_format'], obj.streetFormat);
34
34
  cy.GLO_addInput([formName, 'textbox_addres_block_format'], obj.addressBlockFormat);
35
+ cy.GLO_addInput([formName, 'timezone'], obj.timezone);
35
36
  cy.GLO_selectTab([formName, 'tabs_70'], 'Translations', open);
36
37
  if (obj.translation !== undefined) {
37
38
  cy.GLO_getElement(['ng$basetabletranslation_uuid_lst_tab', 'grid']).within(() => {
@@ -2,5 +2,6 @@ export type objPostalcode = {
2
2
  country?: string;
3
3
  PC?: string;
4
4
  city?: string;
5
+ timezone?: string;
5
6
  };
6
7
  export declare const GLO_enterPostalcode: (obj: objPostalcode) => void;
@@ -1,6 +1,12 @@
1
1
  export const GLO_enterPostalcode = (obj) => {
2
2
  const formName = 'ng$postalcode_dtl';
3
- cy.GLO_addInput([formName, 'country_id'], obj.country);
3
+ if (obj.country) {
4
+ cy.GLO_addInput([formName, 'country_id'], obj.country);
5
+ // The country's server-side change sets the time zone; wait for it so it cannot overwrite a typed one
6
+ cy.GLO_checkLoadingIndicator();
7
+ }
4
8
  cy.GLO_addInput([formName, 'city'], obj.city);
5
9
  cy.GLO_addInput([formName, 'postalcode'], obj.PC);
10
+ // After the country, see above
11
+ cy.GLO_addInput([formName, 'timezone'], obj.timezone);
6
12
  };
@@ -2263,9 +2263,18 @@ Cypress.Commands.add('GLO_extendedFilter', (filter, clearExistingFilters) => {
2263
2263
  if (value === 'Select All')
2264
2264
  return;
2265
2265
  filterComponent()
2266
- .find(`${getFilterFieldSelector(path, dropDownType, clauseType, false)} .dx-tag`)
2267
- .filter((_, el) => (el.getAttribute('aria-label') ?? '').includes(value))
2268
- .should('have.length.greaterThan', 0);
2266
+ .find(getFilterFieldSelector(path, dropDownType, clauseType, false))
2267
+ .then(($field) => {
2268
+ // A tag box adds a tag, a select box (single valuelist) shows the value in its input.
2269
+ // A tag box is a select box too (it carries both classes), so test for the tag box.
2270
+ if ($field.hasClass('dx-tagbox'))
2271
+ cy.wrap($field)
2272
+ .find('.dx-tag')
2273
+ .filter((_, el) => (el.getAttribute('aria-label') ?? '').includes(value))
2274
+ .should('have.length.greaterThan', 0);
2275
+ else
2276
+ cy.wrap($field).find('.dx-texteditor-input').should('have.value', value);
2277
+ });
2269
2278
  break;
2270
2279
  case 'field':
2271
2280
  case 'logical-operator':
@@ -2345,13 +2354,25 @@ Cypress.Commands.add('GLO_extendedFilter', (filter, clearExistingFilters) => {
2345
2354
  });
2346
2355
  return;
2347
2356
  case '=':
2348
- // biome-ignore lint/suspicious/noFallthroughSwitchClause: intentional - falls through to the shared date/time handling below when v isn't check/uncheck
2349
2357
  case '≠':
2350
2358
  if (v === check || v === unCheck) {
2351
2359
  checkBox(path, v);
2352
2360
  return;
2353
2361
  }
2354
- // Fall through
2362
+ // A single-valuelist field is a select box, which ignores a typed value on enter. Typing searches
2363
+ // its list, which renders only a page of items, so the value is typed first and then picked.
2364
+ filterComponent()
2365
+ .find(getFilterFieldSelector(path, 'value', undefined, false))
2366
+ .then(($field) => {
2367
+ const input = () => cy.wrap($field).find('.dx-texteditor-input');
2368
+ if ($field.hasClass('dx-selectbox')) {
2369
+ input().type(`{selectall}{del}${v}`).should('have.attr', 'aria-controls');
2370
+ dropDown(path, clauseType, 'value', String(v));
2371
+ }
2372
+ else
2373
+ input().type(`{selectall}{del}${v}{enter}`);
2374
+ });
2375
+ return;
2355
2376
  case 'before':
2356
2377
  case 'after':
2357
2378
  case 'contains':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globisnv/cypress-core",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Core building blocks for Globis Cypress E2E tests",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",