Cumulocity-IoT / cumulocity-cypress

Collection of commands and utilities to be used for automating tests for Cumulocity with Cypress.
Apache License 2.0
8 stars 2 forks source link

applicationsByName fails because of faulty check #130

Closed CGuether closed 3 months ago

CGuether commented 3 months ago

The call to create a new user fails, if an application is assigned to this user: cy.createUser(testUser, ['business'], ['Cockpit']);

image

Reason is a faulty check for the query /application/applicationsByName/

const applications =
  applicationResponse?.body?.applications ||
  applicationResponse?.body;
if (!applications || _.isArrayLike(applications)) {
  throwError(
    `Application ${appName} not found. No or empty response.`
  );
}

_.isArrayLike(applications) must be negated, otherwise an Error is thrown, if the applications exist.