Skip to content

Commit

Permalink
E2E test debug
Browse files Browse the repository at this point in the history
- This works fine locally
```
        00:00:50 - ✗ should reach the endpoints page
          - Failed: Cannot read property 'forEach' of null
              at /home/travis/build/cloudfoundry/stratos/src/test-e2e/helpers/reset-helpers.ts:142:12
```
  • Loading branch information
richard-cox committed Feb 19, 2021
1 parent 0a41500 commit 8779158
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/test-e2e/endpoints/endpoints-connect-e2e.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { SnackBarPo } from '../po/snackbar.po';
import { ConnectDialogComponent } from './connect-dialog.po';
import { EndpointMetadata, EndpointsPage } from './endpoints.po';

describe('Endpoints', () => {
fdescribe('Endpoints', () => {
const endpointsPage = new EndpointsPage();
const snackBar = new SnackBarPo();

Expand Down
4 changes: 4 additions & 0 deletions src/test-e2e/helpers/reset-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,15 @@ export class ResetsHelpers {
*/
removeAllEndpoints(req) {
return reqHelpers.sendRequest(req, { method: 'GET', url: 'api/v1/endpoints' }).then((data) => {
console.warn('reset-helpers.ts: removeAllEndpoints: raw response', data);

if (!data || !data.length) {
return;
}
data = data.trim();
console.warn('reset-helpers.ts: removeAllEndpoints: trimmed response', data);
data = JSON.parse(data);
console.warn('reset-helpers.ts: removeAllEndpoints: parsed response', data);
const p = promise.fulfilled({});
data.forEach((c) => {
p.then(() => reqHelpers.sendRequest(req, { method: 'DELETE', url: 'api/v1/endpoints/' + c.guid }, null, {}));
Expand Down

0 comments on commit 8779158

Please sign in to comment.