@camunda/e2e-test-suite 0.0.801 → 0.0.802

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.
@@ -185,9 +185,12 @@ class ModelerCreatePage {
185
185
  this.secondPlacedElement = page.locator('g:nth-child(2) > .djs-element > .djs-hit');
186
186
  this.payloadInput = page.locator('[class="fjs-input"]');
187
187
  this.marketPlaceButton = page.getByTitle('Browse Marketplace for more Connectors');
188
+ // Match either marketplace display name — the connector was renamed from
189
+ // "Public Holiday Outbound" to "Worldwide Public Holiday"; accepting both
190
+ // keeps the flow green whichever the marketplace currently serves.
188
191
  this.publicHolidayConnectorOption = page
189
192
  .locator('[data-test="modeler"]')
190
- .getByText('Worldwide Public Holiday')
193
+ .getByText(/Worldwide Public Holiday|Public Holiday Outbound/)
191
194
  .first();
192
195
  this.publicHolidayYearOption = page.getByLabel('Year');
193
196
  this.publicHolidayCountryCodeOption = page.getByLabel('Countrycode');
@@ -793,12 +796,35 @@ class ModelerCreatePage {
793
796
  await this.secondElement.click({ timeout: 60000 });
794
797
  await this.clickChangeTypeButton();
795
798
  await (0, test_1.expect)(this.marketPlaceButton).toBeVisible({ timeout: 60000 });
796
- // Filter the virtualized change-element popup so the option scrolls into view
799
+ // Filter the virtualized change-element popup so the option scrolls
800
+ // into view. Search by each full connector name (the marketplace
801
+ // renamed it "Public Holiday Outbound" -> "Worldwide Public Holiday"),
802
+ // not the shared "Public Holiday" substring — a generic term could
803
+ // surface a different Public Holiday connector we must not select.
804
+ const connectorNames = [
805
+ 'Worldwide Public Holiday',
806
+ 'Public Holiday Outbound',
807
+ ];
797
808
  const changeElementSearch = this.page.locator('.djs-popup-search input');
798
- if (await changeElementSearch
799
- .isVisible({ timeout: 5000 })
800
- .catch(() => false)) {
801
- await changeElementSearch.pressSequentially('Worldwide Public Holiday', { delay: 50 });
809
+ const searchVisible = await changeElementSearch
810
+ .waitFor({ state: 'visible', timeout: 5000 })
811
+ .then(() => true)
812
+ .catch(() => false);
813
+ if (searchVisible) {
814
+ for (const name of connectorNames) {
815
+ await changeElementSearch.fill('');
816
+ await changeElementSearch.pressSequentially(name, { delay: 50 });
817
+ // waitFor actually blocks up to the timeout; isVisible() would
818
+ // return immediately and miss the option still rendering after
819
+ // the search filter applies.
820
+ const optionVisible = await this.publicHolidayConnectorOption
821
+ .waitFor({ state: 'visible', timeout: 5000 })
822
+ .then(() => true)
823
+ .catch(() => false);
824
+ if (optionVisible) {
825
+ break;
826
+ }
827
+ }
802
828
  }
803
829
  await this.publicHolidayConnectorOption.waitFor({
804
830
  state: 'visible',
@@ -187,9 +187,12 @@ class ModelerCreatePage {
187
187
  this.secondPlacedElement = page.locator('g:nth-child(2) > .djs-element > .djs-hit');
188
188
  this.payloadInput = page.locator('[class="fjs-input"]');
189
189
  this.marketPlaceButton = page.getByTitle('Browse Marketplace for more Connectors');
190
+ // Match either marketplace display name — the connector was renamed from
191
+ // "Public Holiday Outbound" to "Worldwide Public Holiday"; accepting both
192
+ // keeps the flow green whichever the marketplace currently serves.
190
193
  this.publicHolidayConnectorOption = page
191
194
  .locator('[data-test="modeler"]')
192
- .getByText('Public Holiday Outbound');
195
+ .getByText(/Worldwide Public Holiday|Public Holiday Outbound/);
193
196
  this.publicHolidayYearOption = page.getByLabel('Year');
194
197
  this.publicHolidayCountryCodeOption = page.getByLabel('Countrycode');
195
198
  this.implementationSection = page.locator('[data-group-id="group-userTaskImplementation"]');
@@ -814,12 +817,36 @@ class ModelerCreatePage {
814
817
  await this.secondElement.click({ timeout: 60000 });
815
818
  await this.clickChangeTypeButton();
816
819
  await (0, test_1.expect)(this.marketPlaceButton).toBeVisible({ timeout: 60000 });
817
- // Filter the virtualized change-element popup so the option scrolls into view
820
+ // Filter the virtualized change-element popup so the option scrolls
821
+ // into view. Search by each full connector name (the marketplace
822
+ // renamed it "Public Holiday Outbound" -> "Worldwide Public Holiday"),
823
+ // not the shared "Public Holiday" substring — a generic term could
824
+ // surface a different Public Holiday connector we must not select.
825
+ const connectorNames = [
826
+ 'Worldwide Public Holiday',
827
+ 'Public Holiday Outbound',
828
+ ];
818
829
  const changeElementSearch = this.page.locator('.djs-popup-search input');
819
- if (await changeElementSearch
820
- .isVisible({ timeout: 5000 })
821
- .catch(() => false)) {
822
- await changeElementSearch.pressSequentially('Public Holiday Outbound', { delay: 50 });
830
+ const searchVisible = await changeElementSearch
831
+ .waitFor({ state: 'visible', timeout: 5000 })
832
+ .then(() => true)
833
+ .catch(() => false);
834
+ if (searchVisible) {
835
+ for (const name of connectorNames) {
836
+ await changeElementSearch.fill('');
837
+ await changeElementSearch.pressSequentially(name, { delay: 50 });
838
+ // waitFor actually blocks up to the timeout; isVisible() would
839
+ // return immediately and miss the option still rendering after
840
+ // the search filter applies.
841
+ const optionVisible = await this.publicHolidayConnectorOption
842
+ .first()
843
+ .waitFor({ state: 'visible', timeout: 5000 })
844
+ .then(() => true)
845
+ .catch(() => false);
846
+ if (optionVisible) {
847
+ break;
848
+ }
849
+ }
823
850
  }
824
851
  // Importing via "Save as copy" can leave both the pre-existing and the
825
852
  // newly imported template in the change-element list, so target the
@@ -209,24 +209,38 @@ async function authSaasAPI(audience, clusterType) {
209
209
  const creds = getClusterCredentials(clusterType);
210
210
  const tokenAudience = audience ?? creds.tokenAudience;
211
211
  apiRequestContext = await getApiRequestContext();
212
- const tokenResponse = await apiRequestContext.post(creds.authUrl, {
213
- headers: {
214
- 'Content-Type': 'application/json',
215
- },
216
- data: {
217
- audience: tokenAudience,
218
- client_id: creds.clientId,
219
- client_secret: creds.clientSecret,
220
- grant_type: 'client_credentials',
221
- },
222
- });
223
- if (tokenResponse.status() !== 200) {
212
+ // The SaaS token endpoint sits behind Cloudflare, which returns a 1015
213
+ // "You are being rate limited" page when many specs fetch a token at once
214
+ // (each MCP spec authenticates in beforeAll). Retry with exponential
215
+ // backoff so the rate-limit window clears instead of failing the suite.
216
+ const maxAttempts = 5;
217
+ const baseDelayMs = 3000;
218
+ let lastErrorMessage = '';
219
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
220
+ const tokenResponse = await apiRequestContext.post(creds.authUrl, {
221
+ headers: {
222
+ 'Content-Type': 'application/json',
223
+ },
224
+ data: {
225
+ audience: tokenAudience,
226
+ client_id: creds.clientId,
227
+ client_secret: creds.clientSecret,
228
+ grant_type: 'client_credentials',
229
+ },
230
+ });
231
+ if (tokenResponse.status() === 200) {
232
+ const tokenJson = await tokenResponse.json();
233
+ return `Bearer ${tokenJson.access_token}`;
234
+ }
224
235
  const errorBody = await tokenResponse.text();
225
- throw new Error(`Failed to fetch access token. Response: ${errorBody}`);
236
+ lastErrorMessage = `HTTP ${tokenResponse.status()} - ${errorBody.slice(0, 200)}`;
237
+ if (attempt < maxAttempts) {
238
+ console.warn(`authSaasAPI attempt ${attempt}/${maxAttempts} failed to fetch access token (${lastErrorMessage}); retrying after backoff...`);
239
+ await new Promise((r) => setTimeout(r, baseDelayMs * 2 ** (attempt - 1)));
240
+ continue;
241
+ }
226
242
  }
227
- const tokenJson = await tokenResponse.json();
228
- const bearerToken = `Bearer ${tokenJson.access_token}`;
229
- return bearerToken;
243
+ throw new Error(`Failed to fetch access token. Response: ${lastErrorMessage}`);
230
244
  }
231
245
  exports.authSaasAPI = authSaasAPI;
232
246
  async function authSmAPI() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.801",
3
+ "version": "0.0.802",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",