Skip to content

Commit 8f1324d

Browse files
committed
clean local test
1 parent 11c490b commit 8f1324d

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

cypress/e2e/7_local-cache-tests.cy.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
1+
import { CONF_MUTABLE_SECURITY_AUTHORIZATION_ROLES } from '../../src/services/cacheConfigUtils';
2+
13
describe('Local Cache Deployment', () => {
2-
it('successfully navigates through menu', () => {
4+
before(() => {
5+
// Remove Cache if exists
6+
cy.cleanupTest(Cypress.env('username'), Cypress.env('password'),
7+
'/caches/local-test-cache', 'DELETE', '', true, '41222');
8+
});
9+
10+
it('successfully navigates through menu', () => {
311
//Visiting Data Container page
412
cy.origin('http://localhost:41222/console/', () => {
513
cy.visit("/", {
@@ -11,6 +19,7 @@ describe('Local Cache Deployment', () => {
1119
password: Cypress.env('password')
1220
}
1321
});
22+
cy.get('[data-cy=sideBarToggle]').click();
1423
cy.contains('Running');
1524
cy.contains('Tracing is enabled');
1625
cy.contains('No caches');

cypress/support/commands.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,10 @@ Cypress.Commands.add('login', (username, password, url = '/') => {
5050
cy.get('[data-cy=sideBarToggle]').click();
5151
});
5252

53-
Cypress.Commands.add('cleanupTest',(username, password, endpoint = '/', method = 'DELETE', body = '', ignoreError = false) => {
53+
Cypress.Commands.add('cleanupTest',(username, password, endpoint = '/', method = 'DELETE', body = '', ignoreError = false, port = '11222') => {
5454
cy.request({
5555
method: method,
56-
url: endpoint.includes('http') ? endpoint : 'http://localhost:11222/rest/v2' + endpoint,
56+
url: endpoint.includes('http') ? endpoint : `http://localhost:${port}/rest/v2` + endpoint,
5757
auth: {
5858
username: username,
5959
password: password

0 commit comments

Comments
 (0)