@globisnv/cypress-core 0.0.8 → 0.0.9

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/README.md CHANGED
@@ -43,7 +43,9 @@ The floor is recorded in `package.json` under `globisOnline.minVersion` (machine
43
43
  A release is two phases, because the `develop` ruleset requires a reviewed PR — so the version bump takes the same route as every other change instead of CI trying to push past the ruleset.
44
44
 
45
45
  1. **Actions → [Prepare Release](.github/workflows/release-pr.yml) → Run workflow**, pick `patch` / `minor` / `major`. It bumps `package.json`, renames the `## Unreleased` heading in `CHANGELOG.md` to `## X.Y.Z` and opens a fresh empty `## Unreleased` above it, and opens a `chore(release): vX.Y.Z` PR. Nothing is published yet.
46
- 2. **Check the changelog section on that PR** (it becomes the GitHub Release notes) and merge it. [Publish](.github/workflows/publish.yml) then builds, lints, publishes to npm, and creates the tag and GitHub Release.
46
+ 2. **Check the changelog section on that PR** (it becomes the GitHub Release notes) and **merge it yourself**. [Publish](.github/workflows/publish.yml) then builds, lints, publishes to npm, and creates the tag and GitHub Release.
47
+
48
+ Release PRs are deliberately left out of the auto-merge that every other PR gets. A merge performed by `GITHUB_TOKEN` creates no workflow run, so an auto-merged release PR would land the version in git and never publish it. If that ever happens anyway, run **Actions → Publish → Run workflow** and give it the release PR's number to finish the release. It publishes that PR's merge commit — not whatever the run was started from — so a recovery still ships exactly the tree that was reviewed, and it refuses a PR that is not a merged `release/*` into `develop`.
47
49
 
48
50
  Write changelog entries under the `## Unreleased` heading as you merge work, rather than at release time — the release just renames that heading and opens a new one, so there is always a section at the top to write into and the file never needs reorganising by hand. If there is no `## Unreleased` section when you cut a release, the workflow adds an empty `## X.Y.Z` stub and warns, and you fill it in on the PR.
49
51
 
@@ -131,10 +131,7 @@ const enterCustomerTab = (obj, formName = 'ng$relations_dtl') => {
131
131
  cy.GLO_checkbox([formNameCustomer, 'flag_ready_for_invoicing'], obj.flagReadyForInvoicing);
132
132
  cy.GLO_addInput([formNameCustomer, 'responsible_user_id'], obj.responsible);
133
133
  cy.GLO_addInput([formNameCustomer, 'vat_regime_id'], obj.vatRegimeCustomerTab);
134
- if (obj.invoiceCustomerCode) {
135
- cy.GLO_addInput([formNameCustomer, 'invoice_customer_code'], obj.invoiceCustomerCode);
136
- cy.GLO_checkLoadingIndicator();
137
- }
134
+ cy.GLO_popupWindow([formNameCustomer, 'invoice_customer_code'], obj.invoiceCustomerCode);
138
135
  cy.GLO_addInput([formNameCustomer, 'debtorcode_accountancy'], obj.debtorCode);
139
136
  cy.GLO_addInput([formNameCustomer, 'office'], obj.office);
140
137
  cy.GLO_addInput([formNameCustomer, 'new_service_level'], obj.newServiceLevel);
@@ -527,10 +527,11 @@ const GLO_inputValuelist = (selector, rawValue) => {
527
527
  if (newId)
528
528
  dropDownId = newId;
529
529
  const query = dropdownSelector ? `[id="${dropDownId}"] ${dropdownSelector}` : `[id="${dropDownId}"]`;
530
+ // The timeout has to go on the find(), the retrying query. Cypress does not inherit it from cy.document().
530
531
  return cy
531
- .document({ timeout: timeout ?? defaultTimeout, log: false })
532
+ .document({ log: false })
532
533
  .its('body', { log: false })
533
- .find(query, { log: false });
534
+ .find(query, { timeout: timeout ?? defaultTimeout, log: false });
534
535
  });
535
536
  };
536
537
  cy.GLO_getElement(vlEffectiveSelector).find('.dx-texteditor-input:enabled', { log: false }).eq(vlEffectiveIndex).click();
@@ -623,7 +624,9 @@ const GLO_inputValuelist = (selector, rawValue) => {
623
624
  const currentTexts = [...$current].map((el) => el.innerText.trim());
624
625
  const hasChanged = !Cypress._.isEqual(currentTexts, initialTexts);
625
626
  const anyIncludes = currentTexts.every((text) => text.includes(dropdownValue));
626
- return expect(hasChanged || anyIncludes, `Dropdown updated or contains "${dropdownValue}" already`).to.be.true;
627
+ // An empty list is the transitional state while the filtered valuelist is still loading, never a valid result.
628
+ // Without this guard an emptied list counts as 'changed' (and every() is vacuously true), so we stop waiting too soon.
629
+ return expect(currentTexts.length > 0 && (hasChanged || anyIncludes), `Dropdown updated or contains "${dropdownValue}" already`).to.be.true;
627
630
  });
628
631
  })
629
632
  .then(() => {
@@ -56,7 +56,7 @@ declare global {
56
56
  * @param {string} elementName - Name of the element within the form
57
57
  * @param {string} label - The label text to search for (e.g. 'TO location:')
58
58
  */
59
- GLS_getLabelValue(formName: string, elementName: string, label: string): Cypress.Chainable<JQuery>;
59
+ GLS_getLabelValue(formName: string, elementName: string, label: string): Cypress.Chainable<string>;
60
60
  }
61
61
  }
62
62
  }
@@ -99,5 +99,7 @@ Cypress.Commands.add('GLS_navigation', (position, formName, value) => {
99
99
  cy.GLO_checkLoadingIndicator();
100
100
  });
101
101
  Cypress.Commands.add('GLS_getLabelValue', (formName, elementName, label) => {
102
- return getLabelValue(formName, elementName, label);
102
+ return getLabelValue(formName, elementName, label)
103
+ .invoke('text')
104
+ .then((text) => text.trim());
103
105
  });
@@ -88,17 +88,9 @@ Cypress.Commands.add('POR_logout', (company) => {
88
88
  else {
89
89
  cy.GLO_getElement(['ep$main', 'sidemenu']).find('.footer').find('.clickable').click();
90
90
  }
91
- cy.get('.window-footer').then(($dialog) => {
92
- if ($dialog.find('.svy-btn-primary:contains("Yes")').length > 0) {
93
- cy.wrap($dialog).contains('Yes').click();
94
- }
95
- else if ($dialog.find('.svy-btn-primary:contains("Ja")').length > 0) {
96
- cy.wrap($dialog).contains('Ja').click();
97
- }
98
- else {
99
- throw new Error('Neither "Yes" nor "Ja" options found in the dialog box.');
100
- }
101
- });
91
+ cy.GLO_getVisible('.window-footer button.svy-btn-primary', 30000)
92
+ .contains(/^(Yes|Ja)$/)
93
+ .click();
102
94
  cy.GLO_checkLoadingIndicator();
103
95
  });
104
96
  Cypress.Commands.add('POR_checklistCData', (formName, elementName, checkboxName) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@globisnv/cypress-core",
3
- "version": "0.0.8",
3
+ "version": "0.0.9",
4
4
  "description": "Core building blocks for Globis Cypress E2E tests",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",