diff --git a/e2e/cypress/tests/01-api-key/01-create-api.cy.ts b/e2e/cypress/tests/01-api-key/01-create-api.cy.ts index 68a1d7da4..63d3d589e 100644 --- a/e2e/cypress/tests/01-api-key/01-create-api.cy.ts +++ b/e2e/cypress/tests/01-api-key/01-create-api.cy.ts @@ -4,7 +4,7 @@ import Products from '../../pageObjects/products' import ServiceAccountsPage from '../../pageObjects/serviceAccounts' -describe('Create API Spec', () => { +describe('Create API Spec', () => { const login = new LoginPage() const home = new HomePage() const sa = new ServiceAccountsPage() @@ -14,7 +14,7 @@ describe('Create API Spec', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) cy.resetState() cy.deleteAllCookies() }) diff --git a/e2e/cypress/tests/01-api-key/03-request-access-inactive-env.cy.ts b/e2e/cypress/tests/01-api-key/03-request-access-inactive-env.cy.ts index bfe769346..5b9ca7ba5 100644 --- a/e2e/cypress/tests/01-api-key/03-request-access-inactive-env.cy.ts +++ b/e2e/cypress/tests/01-api-key/03-request-access-inactive-env.cy.ts @@ -15,7 +15,7 @@ describe('Change an Active environment to Inactive', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { @@ -114,7 +114,7 @@ describe('Change an the environment back to active', () => { cy.visit('/') // cy.deleteAllCookies() // cy.clearCookies() - // cy.reload() + // cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/01-api-key/04-request-access-with-out-collecting-credentials.cy.ts b/e2e/cypress/tests/01-api-key/04-request-access-with-out-collecting-credentials.cy.ts index 85d5de5dd..20ec0de6f 100644 --- a/e2e/cypress/tests/01-api-key/04-request-access-with-out-collecting-credentials.cy.ts +++ b/e2e/cypress/tests/01-api-key/04-request-access-with-out-collecting-credentials.cy.ts @@ -11,7 +11,7 @@ describe('Request Access without colleting credential Spec', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/01-api-key/07-approve-pending-rqst.cy.ts b/e2e/cypress/tests/01-api-key/07-approve-pending-rqst.cy.ts index 110bdbba4..d20c171f1 100644 --- a/e2e/cypress/tests/01-api-key/07-approve-pending-rqst.cy.ts +++ b/e2e/cypress/tests/01-api-key/07-approve-pending-rqst.cy.ts @@ -11,7 +11,7 @@ describe('Approve Pending Request Spec', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/01-api-key/08-grant-access.cy.ts b/e2e/cypress/tests/01-api-key/08-grant-access.cy.ts index 238af646d..b405ae971 100644 --- a/e2e/cypress/tests/01-api-key/08-grant-access.cy.ts +++ b/e2e/cypress/tests/01-api-key/08-grant-access.cy.ts @@ -11,7 +11,7 @@ describe('Grant Access Spec', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/02-client-credential-flow/01-client-cred-team-access.cy.ts b/e2e/cypress/tests/02-client-credential-flow/01-client-cred-team-access.cy.ts index 6af9f276b..29b770c58 100644 --- a/e2e/cypress/tests/02-client-credential-flow/01-client-cred-team-access.cy.ts +++ b/e2e/cypress/tests/02-client-credential-flow/01-client-cred-team-access.cy.ts @@ -13,7 +13,7 @@ describe('Grant appropriate permissions to team members for client credential fl before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/02-client-credential-flow/02-create_authorizarion_profile.cy.ts b/e2e/cypress/tests/02-client-credential-flow/02-create_authorizarion_profile.cy.ts index 8a89f006d..117465051 100644 --- a/e2e/cypress/tests/02-client-credential-flow/02-create_authorizarion_profile.cy.ts +++ b/e2e/cypress/tests/02-client-credential-flow/02-create_authorizarion_profile.cy.ts @@ -12,7 +12,7 @@ describe('Generate Authorization Profiles', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/02-client-credential-flow/05-cids-access-approve-api-rqst.cy.ts b/e2e/cypress/tests/02-client-credential-flow/05-cids-access-approve-api-rqst.cy.ts index ec83f1f72..7c2b38156 100644 --- a/e2e/cypress/tests/02-client-credential-flow/05-cids-access-approve-api-rqst.cy.ts +++ b/e2e/cypress/tests/02-client-credential-flow/05-cids-access-approve-api-rqst.cy.ts @@ -13,7 +13,7 @@ describe('Access manager approves developer access request for Client ID/Secret before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { @@ -77,215 +77,4 @@ describe('Make an API request using Client ID, Secret, and Access Token', () => }) }) }) -}) - -describe('Verify the selected client scoped is displayed in assigned default list', () => { - const clientScopes = new keycloakClientScopesPage() - const groups = new keycloakGroupPage() - var nameSpace: string - const home = new HomePage() - const authProfile = new AuthorizationProfile() - - before(() => { - cy.visit(Cypress.env('KEYCLOAK_URL')) - cy.reload() - }) - - beforeEach(() => { - cy.preserveCookies() - cy.fixture('developer').as('developer') - cy.fixture('apiowner').as('apiowner') - cy.fixture('state/regen').as('regen') - cy.fixture('admin').as('admin') - }) - - it('Authenticates Admin owner', () => { - cy.get('@admin').then(({ user }: any) => { - cy.contains('Administration Console').click({ force: true }) - cy.keycloakLogin(user.credentials.username, user.credentials.password) - }) - }) - - it('Navigate to Clients page', () => { - cy.contains('Clients').click() - }) - - it('Select the consumer ID', () => { - cy.readFile('cypress/fixtures/state/store.json').then((store_res) => { - let cc = JSON.parse(store_res.clientidsecret) - cy.contains(cc.clientId).click() - }) - }) - - it('Navigate to client scope tab', () => { - clientScopes.selectTab('Client Scopes') - }) - - it('Verify that "System.Write" scope is in assigned default scope', () => { - clientScopes.verifyAssignedScope('System.Write', true) - }) - - after(() => { - cy.keycloakLogout() - }) - -}) - -describe('Deselect the scope from authorization tab', () => { - const login = new LoginPage() - const home = new HomePage() - const consumers = new ConsumersPage() - - before(() => { - cy.visit('/') - cy.reload() - }) - - beforeEach(() => { - cy.preserveCookies() - cy.fixture('access-manager').as('access-manager') - cy.fixture('apiowner').as('apiowner') - cy.fixture('manage-control-config-setting').as('manage-control-config-setting') - cy.fixture('common-testdata').as('common-testdata') - // cy.visit(login.path) - }) - - it('authenticates Mark (Access Manager)', () => { - cy.get('@access-manager').then(({ user }: any) => { - cy.get('@common-testdata').then(({ clientCredentials }: any) => { - cy.login(user.credentials.username, user.credentials.password).then(() => { - home.useNamespace(clientCredentials.namespace); - }) - }) - }) - }) - - it('Navigate to Consumer page ', () => { - cy.visit(consumers.path); - }) - - it('Select the consumer from the list ', () => { - consumers.clickOnTheFirstConsumerID() - }) - - it('Deselect scopes in Authorization Tab', () => { - cy.get('@apiowner').then(({ clientCredentials }: any) => { - consumers.editConsumerDialog() - consumers.selectAuthorizationScope(clientCredentials.clientIdSecret.authProfile.scopes, false) - consumers.saveAppliedConfig() - }) - }) - after(() => { - cy.logout() - }) -}) - -describe('Verify the selected client scoped is not displayed in assigned default list', () => { - const clientScopes = new keycloakClientScopesPage() - const groups = new keycloakGroupPage() - var nameSpace: string - const home = new HomePage() - const authProfile = new AuthorizationProfile() - - before(() => { - cy.visit(Cypress.env('KEYCLOAK_URL')) - cy.reload() - }) - - beforeEach(() => { - cy.preserveCookies() - cy.fixture('developer').as('developer') - cy.fixture('apiowner').as('apiowner') - cy.fixture('state/regen').as('regen') - cy.fixture('admin').as('admin') - }) - - it('Authenticates Admin owner', () => { - cy.get('@admin').then(({ user }: any) => { - cy.contains('Administration Console').click({ force: true }) - cy.keycloakLogin(user.credentials.username, user.credentials.password) - }) - }) - - it('Navigate to Clients page', () => { - cy.contains('Clients').click() - }) - - it('Select the consumer ID', () => { - cy.readFile('cypress/fixtures/state/store.json').then((store_res) => { - let cc = JSON.parse(store_res.clientidsecret) - cy.contains(cc.clientId).click() - }) - }) - - it('Navigate to client scope tab', () => { - clientScopes.selectTab('Client Scopes') - }) - - it('Verify that "System.Write" scope is not in assigned default scope', () => { - clientScopes.verifyAssignedScope('System.Write', false) - }) - - after(() => { - cy.keycloakLogout() - }) - -}) - -// describe('Revoke product environment access for Client Credential authorization spec', () => { -// const login = new LoginPage() -// const consumers = new ConsumersPage() -// const home = new HomePage() - -// before(() => { -// cy.visit('/') -// cy.deleteAllCookies() -// cy.reload() -// }) - -// beforeEach(() => { -// cy.preserveCookies() -// cy.fixture('access-manager').as('access-manager') -// cy.fixture('apiowner').as('apiowner') -// cy.fixture('developer').as('developer') -// cy.fixture('state/store').as('store') -// }) - -// it('authenticates Mark (Access-Manager)', () => { -// cy.get('@apiowner').then(({ clientCredentials }: any) => { -// cy.get('@access-manager').then(({ user }: any) => { -// cy.login(user.credentials.username, user.credentials.password) -// home.useNamespace(clientCredentials.namespace); -// }) -// }) -// }) - -// it('Navigate to Consumer page and filter the product', () => { -// cy.get('@apiowner').then(({ clientCredentials }: any) => { -// cy.visit(consumers.path); -// let product = clientCredentials.clientIdSecret.product -// consumers.filterConsumerByTypeAndValue('Products', product.name) -// }) -// }) - -// it('Click on the first consumer', () => { -// consumers.clickOnTheFirstConsumerID() -// }) - -// it('Revoke access for Test environment', () => { -// cy.wait(1000) -// consumers.revokeProductEnvAccess('Test') -// }) - -// it('Verify the confirmation message once the access is revoked', () => { -// cy.verifyToastMessage("Product Revoked") -// }) - - -// after(() => { -// cy.logout() -// cy.clearLocalStorage({ log: true }) -// cy.deleteAllCookies() -// }) - -// }) \ No newline at end of file +}) \ No newline at end of file diff --git a/e2e/cypress/tests/02-client-credential-flow/06-client-scope-in-keycloak.ts b/e2e/cypress/tests/02-client-credential-flow/06-client-scope-in-keycloak.ts new file mode 100644 index 000000000..4dd9351cc --- /dev/null +++ b/e2e/cypress/tests/02-client-credential-flow/06-client-scope-in-keycloak.ts @@ -0,0 +1,59 @@ +import HomePage from '../../pageObjects/home' +import LoginPage from '../../pageObjects/login' +import ConsumersPage from '../../pageObjects/consumers' +import KeycloakUserGroupPage from '../../pageObjects/keycloakUserGroup' +import keycloakGroupPage from '../../pageObjects/keycloakGroup' +import AuthorizationProfile from '../../pageObjects/authProfile' +import keycloakClientScopesPage from '../../pageObjects/keycloakClientScopes' + +describe('Verify the selected client scoped is displayed in assigned default list', () => { + const clientScopes = new keycloakClientScopesPage() + const groups = new keycloakGroupPage() + var nameSpace: string + const home = new HomePage() + const authProfile = new AuthorizationProfile() + + before(() => { + cy.visit(Cypress.env('KEYCLOAK_URL')) + cy.reload(true) + }) + + beforeEach(() => { + cy.preserveCookies() + cy.fixture('developer').as('developer') + cy.fixture('apiowner').as('apiowner') + cy.fixture('state/regen').as('regen') + cy.fixture('admin').as('admin') + }) + + it('Authenticates Admin owner', () => { + cy.get('@admin').then(({ user }: any) => { + cy.contains('Administration Console').click({ force: true }) + cy.keycloakLogin(user.credentials.username, user.credentials.password) + }) + }) + + it('Navigate to Clients page', () => { + cy.contains('Clients').click() + }) + + it('Select the consumer ID', () => { + cy.readFile('cypress/fixtures/state/store.json').then((store_res) => { + let cc = JSON.parse(store_res.clientidsecret) + cy.contains(cc.clientId).click() + }) + }) + + it('Navigate to client scope tab', () => { + clientScopes.selectTab('Client Scopes') + }) + + it('Verify that "System.Write" scope is in assigned default scope', () => { + clientScopes.verifyAssignedScope('System.Write', true) + }) + + after(() => { + cy.keycloakLogout() + }) + +}) \ No newline at end of file diff --git a/e2e/cypress/tests/02-client-credential-flow/07-deselect-scope.ts b/e2e/cypress/tests/02-client-credential-flow/07-deselect-scope.ts new file mode 100644 index 000000000..42f58f8b6 --- /dev/null +++ b/e2e/cypress/tests/02-client-credential-flow/07-deselect-scope.ts @@ -0,0 +1,56 @@ +import HomePage from '../../pageObjects/home' +import LoginPage from '../../pageObjects/login' +import ConsumersPage from '../../pageObjects/consumers' +import KeycloakUserGroupPage from '../../pageObjects/keycloakUserGroup' +import keycloakGroupPage from '../../pageObjects/keycloakGroup' +import AuthorizationProfile from '../../pageObjects/authProfile' +import keycloakClientScopesPage from '../../pageObjects/keycloakClientScopes' + +describe('Deselect the scope from authorization tab', () => { + const login = new LoginPage() + const home = new HomePage() + const consumers = new ConsumersPage() + + before(() => { + cy.visit('/') + cy.reload(true) + }) + + beforeEach(() => { + cy.preserveCookies() + cy.fixture('access-manager').as('access-manager') + cy.fixture('apiowner').as('apiowner') + cy.fixture('manage-control-config-setting').as('manage-control-config-setting') + cy.fixture('common-testdata').as('common-testdata') + // cy.visit(login.path) + }) + + it('authenticates Mark (Access Manager)', () => { + cy.get('@access-manager').then(({ user }: any) => { + cy.get('@common-testdata').then(({ clientCredentials }: any) => { + cy.login(user.credentials.username, user.credentials.password).then(() => { + home.useNamespace(clientCredentials.namespace); + }) + }) + }) + }) + + it('Navigate to Consumer page ', () => { + cy.visit(consumers.path); + }) + + it('Select the consumer from the list ', () => { + consumers.clickOnTheFirstConsumerID() + }) + + it('Deselect scopes in Authorization Tab', () => { + cy.get('@apiowner').then(({ clientCredentials }: any) => { + consumers.editConsumerDialog() + consumers.selectAuthorizationScope(clientCredentials.clientIdSecret.authProfile.scopes, false) + consumers.saveAppliedConfig() + }) + }) + after(() => { + cy.logout() + }) +}) \ No newline at end of file diff --git a/e2e/cypress/tests/02-client-credential-flow/08-verify-client-scope-in-default-list.ts b/e2e/cypress/tests/02-client-credential-flow/08-verify-client-scope-in-default-list.ts new file mode 100644 index 000000000..221c38808 --- /dev/null +++ b/e2e/cypress/tests/02-client-credential-flow/08-verify-client-scope-in-default-list.ts @@ -0,0 +1,117 @@ +import HomePage from '../../pageObjects/home' +import LoginPage from '../../pageObjects/login' +import ConsumersPage from '../../pageObjects/consumers' +import KeycloakUserGroupPage from '../../pageObjects/keycloakUserGroup' +import keycloakGroupPage from '../../pageObjects/keycloakGroup' +import AuthorizationProfile from '../../pageObjects/authProfile' +import keycloakClientScopesPage from '../../pageObjects/keycloakClientScopes' + +describe('Verify the selected client scoped is not displayed in assigned default list', () => { + const clientScopes = new keycloakClientScopesPage() + const groups = new keycloakGroupPage() + var nameSpace: string + const home = new HomePage() + const authProfile = new AuthorizationProfile() + + before(() => { + cy.visit(Cypress.env('KEYCLOAK_URL')) + cy.reload(true) + }) + + beforeEach(() => { + cy.preserveCookies() + cy.fixture('developer').as('developer') + cy.fixture('apiowner').as('apiowner') + cy.fixture('state/regen').as('regen') + cy.fixture('admin').as('admin') + }) + + it('Authenticates Admin owner', () => { + cy.get('@admin').then(({ user }: any) => { + cy.contains('Administration Console').click({ force: true }) + cy.keycloakLogin(user.credentials.username, user.credentials.password) + }) + }) + + it('Navigate to Clients page', () => { + cy.contains('Clients').click() + }) + + it('Select the consumer ID', () => { + cy.readFile('cypress/fixtures/state/store.json').then((store_res) => { + let cc = JSON.parse(store_res.clientidsecret) + cy.contains(cc.clientId).click() + }) + }) + + it('Navigate to client scope tab', () => { + clientScopes.selectTab('Client Scopes') + }) + + it('Verify that "System.Write" scope is not in assigned default scope', () => { + clientScopes.verifyAssignedScope('System.Write', false) + }) + + after(() => { + cy.keycloakLogout() + }) + +}) + +// describe('Revoke product environment access for Client Credential authorization spec', () => { +// const login = new LoginPage() +// const consumers = new ConsumersPage() +// const home = new HomePage() + +// before(() => { +// cy.visit('/') +// cy.deleteAllCookies() +// cy.reload(true) +// }) + +// beforeEach(() => { +// cy.preserveCookies() +// cy.fixture('access-manager').as('access-manager') +// cy.fixture('apiowner').as('apiowner') +// cy.fixture('developer').as('developer') +// cy.fixture('state/store').as('store') +// }) + +// it('authenticates Mark (Access-Manager)', () => { +// cy.get('@apiowner').then(({ clientCredentials }: any) => { +// cy.get('@access-manager').then(({ user }: any) => { +// cy.login(user.credentials.username, user.credentials.password) +// home.useNamespace(clientCredentials.namespace); +// }) +// }) +// }) + +// it('Navigate to Consumer page and filter the product', () => { +// cy.get('@apiowner').then(({ clientCredentials }: any) => { +// cy.visit(consumers.path); +// let product = clientCredentials.clientIdSecret.product +// consumers.filterConsumerByTypeAndValue('Products', product.name) +// }) +// }) + +// it('Click on the first consumer', () => { +// consumers.clickOnTheFirstConsumerID() +// }) + +// it('Revoke access for Test environment', () => { +// cy.wait(1000) +// consumers.revokeProductEnvAccess('Test') +// }) + +// it('Verify the confirmation message once the access is revoked', () => { +// cy.verifyToastMessage("Product Revoked") +// }) + + +// after(() => { +// cy.logout() +// cy.clearLocalStorage({ log: true }) +// cy.deleteAllCookies() +// }) + +// }) \ No newline at end of file diff --git a/e2e/cypress/tests/02-client-credential-flow/06-jwt-genkp-access-rqst.cy.ts b/e2e/cypress/tests/02-client-credential-flow/09-jwt-genkp-access-rqst.cy.ts similarity index 98% rename from e2e/cypress/tests/02-client-credential-flow/06-jwt-genkp-access-rqst.cy.ts rename to e2e/cypress/tests/02-client-credential-flow/09-jwt-genkp-access-rqst.cy.ts index b51544eaa..9fc3f23f0 100644 --- a/e2e/cypress/tests/02-client-credential-flow/06-jwt-genkp-access-rqst.cy.ts +++ b/e2e/cypress/tests/02-client-credential-flow/09-jwt-genkp-access-rqst.cy.ts @@ -11,7 +11,7 @@ describe('Developer creates an access request for JWT Generated Key Pair authent before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/02-client-credential-flow/07-jwt-genkp-access-approve-api-rqst.cy.ts b/e2e/cypress/tests/02-client-credential-flow/10-jwt-genkp-access-approve-api-rqst.cy.ts similarity index 99% rename from e2e/cypress/tests/02-client-credential-flow/07-jwt-genkp-access-approve-api-rqst.cy.ts rename to e2e/cypress/tests/02-client-credential-flow/10-jwt-genkp-access-approve-api-rqst.cy.ts index be7cd48bb..6bc97f8ee 100644 --- a/e2e/cypress/tests/02-client-credential-flow/07-jwt-genkp-access-approve-api-rqst.cy.ts +++ b/e2e/cypress/tests/02-client-credential-flow/10-jwt-genkp-access-approve-api-rqst.cy.ts @@ -11,7 +11,7 @@ describe('Access manager approves developer access request for JWT - Generated K before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/02-client-credential-flow/08-jwks-url-gen-keys-access-rqst.cy.ts b/e2e/cypress/tests/02-client-credential-flow/11-jwks-url-gen-keys-access-rqst.cy.ts similarity index 99% rename from e2e/cypress/tests/02-client-credential-flow/08-jwks-url-gen-keys-access-rqst.cy.ts rename to e2e/cypress/tests/02-client-credential-flow/11-jwks-url-gen-keys-access-rqst.cy.ts index 01da22880..1748f02ea 100644 --- a/e2e/cypress/tests/02-client-credential-flow/08-jwks-url-gen-keys-access-rqst.cy.ts +++ b/e2e/cypress/tests/02-client-credential-flow/11-jwks-url-gen-keys-access-rqst.cy.ts @@ -39,7 +39,7 @@ describe('Developer creates an access request for JWKS URL', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/02-client-credential-flow/09-jwks-url-access-approval-api-rqst.cy.ts b/e2e/cypress/tests/02-client-credential-flow/12-jwks-url-access-approval-api-rqst.cy.ts similarity index 99% rename from e2e/cypress/tests/02-client-credential-flow/09-jwks-url-access-approval-api-rqst.cy.ts rename to e2e/cypress/tests/02-client-credential-flow/12-jwks-url-access-approval-api-rqst.cy.ts index 07aaef97d..6350d1f99 100644 --- a/e2e/cypress/tests/02-client-credential-flow/09-jwks-url-access-approval-api-rqst.cy.ts +++ b/e2e/cypress/tests/02-client-credential-flow/12-jwks-url-access-approval-api-rqst.cy.ts @@ -12,7 +12,7 @@ describe('Access manager approves developer access request for JWKS URL flow', ( before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/02-client-credential-flow/10-jwks-publicKey-access-rqst.cy.ts b/e2e/cypress/tests/02-client-credential-flow/13-jwks-publicKey-access-rqst.cy.ts similarity index 98% rename from e2e/cypress/tests/02-client-credential-flow/10-jwks-publicKey-access-rqst.cy.ts rename to e2e/cypress/tests/02-client-credential-flow/13-jwks-publicKey-access-rqst.cy.ts index 7d13d3986..6895839cc 100644 --- a/e2e/cypress/tests/02-client-credential-flow/10-jwks-publicKey-access-rqst.cy.ts +++ b/e2e/cypress/tests/02-client-credential-flow/13-jwks-publicKey-access-rqst.cy.ts @@ -13,7 +13,7 @@ describe('Generates public/private key and set public key to access request', () before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/02-client-credential-flow/11-jwt-publlicKey-access-approve-api-rqst.cy.ts b/e2e/cypress/tests/02-client-credential-flow/14-jwt-publlicKey-access-approve-api-rqst.cy.ts similarity index 99% rename from e2e/cypress/tests/02-client-credential-flow/11-jwt-publlicKey-access-approve-api-rqst.cy.ts rename to e2e/cypress/tests/02-client-credential-flow/14-jwt-publlicKey-access-approve-api-rqst.cy.ts index 8542216b3..f9ee17ad9 100644 --- a/e2e/cypress/tests/02-client-credential-flow/11-jwt-publlicKey-access-approve-api-rqst.cy.ts +++ b/e2e/cypress/tests/02-client-credential-flow/14-jwt-publlicKey-access-approve-api-rqst.cy.ts @@ -11,7 +11,7 @@ describe('Access manager approves developer access request for JWT - Generated K before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/03-manage-labels/02-approve-pending-rqst-for-labels.spec.cy.ts b/e2e/cypress/tests/03-manage-labels/02-approve-pending-rqst-for-labels.spec.cy.ts index 5662562ee..7ff4da239 100644 --- a/e2e/cypress/tests/03-manage-labels/02-approve-pending-rqst-for-labels.spec.cy.ts +++ b/e2e/cypress/tests/03-manage-labels/02-approve-pending-rqst-for-labels.spec.cy.ts @@ -11,7 +11,7 @@ describe('Approve Pending Request Spec', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/06-refresh-credential/02-client-credentials.cy.ts b/e2e/cypress/tests/06-refresh-credential/02-client-credentials.cy.ts index 327508156..e7a10e6e4 100644 --- a/e2e/cypress/tests/06-refresh-credential/02-client-credentials.cy.ts +++ b/e2e/cypress/tests/06-refresh-credential/02-client-credentials.cy.ts @@ -13,7 +13,7 @@ import MyAccessPage from '../../pageObjects/myAccess' // before(() => { // cy.visit('/') // cy.deleteAllCookies() -// cy.reload() +// cy.reload(true) // }) // beforeEach(() => { @@ -69,7 +69,7 @@ describe('Regenerate Credential for Client Credentials- Client ID/Secret', () => before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/07-manage-control/02-rate-limiting.cy.ts b/e2e/cypress/tests/07-manage-control/02-rate-limiting.cy.ts index fa4805a7a..e7296070e 100644 --- a/e2e/cypress/tests/07-manage-control/02-rate-limiting.cy.ts +++ b/e2e/cypress/tests/07-manage-control/02-rate-limiting.cy.ts @@ -12,7 +12,7 @@ describe('Manage Control-Rate Limiting Spec for Service as Scope and Local Polic before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/07-manage-control/03-kong-api-only-apply-rate-limiting.cy.ts b/e2e/cypress/tests/07-manage-control/03-kong-api-only-apply-rate-limiting.cy.ts index 72602f996..08767f570 100644 --- a/e2e/cypress/tests/07-manage-control/03-kong-api-only-apply-rate-limiting.cy.ts +++ b/e2e/cypress/tests/07-manage-control/03-kong-api-only-apply-rate-limiting.cy.ts @@ -20,7 +20,7 @@ describe('Apply Kong API key only plugin', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/08-client-role/03-read-client-role.ts b/e2e/cypress/tests/08-client-role/03-read-client-role.ts index 5f81dc6d0..cad5ca94d 100644 --- a/e2e/cypress/tests/08-client-role/03-read-client-role.ts +++ b/e2e/cypress/tests/08-client-role/03-read-client-role.ts @@ -14,7 +14,7 @@ describe('Developer creates an access request for Client ID/Secret authenticator before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/08-client-role/04-write-client-role.ts b/e2e/cypress/tests/08-client-role/04-write-client-role.ts index f6eb74aef..411fa8404 100644 --- a/e2e/cypress/tests/08-client-role/04-write-client-role.ts +++ b/e2e/cypress/tests/08-client-role/04-write-client-role.ts @@ -14,7 +14,7 @@ describe('Developer creates an access request for Client ID/Secret authenticator before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/08-client-role/05-check-without-role.ts b/e2e/cypress/tests/08-client-role/05-check-without-role.ts index fed1ead1f..a96f1d6a0 100644 --- a/e2e/cypress/tests/08-client-role/05-check-without-role.ts +++ b/e2e/cypress/tests/08-client-role/05-check-without-role.ts @@ -22,7 +22,7 @@ describe('Reset Authorization profile to default (without any role)', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/09-update-product-env/01-client-credential-to-kong-acl-api.cy.ts b/e2e/cypress/tests/09-update-product-env/01-client-credential-to-kong-acl-api.cy.ts index 609f76633..e9b7d910b 100644 --- a/e2e/cypress/tests/09-update-product-env/01-client-credential-to-kong-acl-api.cy.ts +++ b/e2e/cypress/tests/09-update-product-env/01-client-credential-to-kong-acl-api.cy.ts @@ -22,7 +22,7 @@ describe('Change Authorization profile', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/09-update-product-env/02-kong-acl-api-to-client-credential.cy.ts b/e2e/cypress/tests/09-update-product-env/02-kong-acl-api-to-client-credential.cy.ts index d1d94a6d0..14f622a41 100644 --- a/e2e/cypress/tests/09-update-product-env/02-kong-acl-api-to-client-credential.cy.ts +++ b/e2e/cypress/tests/09-update-product-env/02-kong-acl-api-to-client-credential.cy.ts @@ -25,7 +25,7 @@ describe('Change Authorization profile from Kong ACL-API to Client Credential', before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/09-update-product-env/03-apply-multiple-services.cy.ts b/e2e/cypress/tests/09-update-product-env/03-apply-multiple-services.cy.ts index c0ddc9299..50de65e81 100644 --- a/e2e/cypress/tests/09-update-product-env/03-apply-multiple-services.cy.ts +++ b/e2e/cypress/tests/09-update-product-env/03-apply-multiple-services.cy.ts @@ -27,7 +27,7 @@ describe('Apply multiple services to the product environment', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/09-update-product-env/06-shared-idp.cy.ts b/e2e/cypress/tests/09-update-product-env/06-shared-idp.cy.ts index e59ae51d6..6603ceab1 100644 --- a/e2e/cypress/tests/09-update-product-env/06-shared-idp.cy.ts +++ b/e2e/cypress/tests/09-update-product-env/06-shared-idp.cy.ts @@ -19,7 +19,7 @@ describe('Apply Shared IDP while creating Authorization Profile', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/10-clear-resources/01-create-api.cy.ts b/e2e/cypress/tests/10-clear-resources/01-create-api.cy.ts index 817781a88..592ec430b 100644 --- a/e2e/cypress/tests/10-clear-resources/01-create-api.cy.ts +++ b/e2e/cypress/tests/10-clear-resources/01-create-api.cy.ts @@ -14,7 +14,7 @@ describe('Create API Spec for Delete Resources', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) // cy.resetState() }) diff --git a/e2e/cypress/tests/10-clear-resources/06-delete-service-acc.ts b/e2e/cypress/tests/10-clear-resources/06-delete-service-acc.ts index 2a353f424..2a82d2e05 100644 --- a/e2e/cypress/tests/10-clear-resources/06-delete-service-acc.ts +++ b/e2e/cypress/tests/10-clear-resources/06-delete-service-acc.ts @@ -52,7 +52,7 @@ describe('Create API Spec', () => { cy.getAccessToken(cc.clientId, cc.clientSecret).then(() => { cy.get('@accessTokenResponse').then((token_res: any) => { expect(token_res.status).to.be.equal(400) - expect(token_res.body.error).to.contains("unauthorized_client") + expect(token_res.body.error).to.contains("invalid_client") }) }) }) diff --git a/e2e/cypress/tests/11-activity-feed/01-activity-feed.cy.ts b/e2e/cypress/tests/11-activity-feed/01-activity-feed.cy.ts index ccb75a9a5..238fdb6b7 100644 --- a/e2e/cypress/tests/11-activity-feed/01-activity-feed.cy.ts +++ b/e2e/cypress/tests/11-activity-feed/01-activity-feed.cy.ts @@ -14,7 +14,7 @@ describe('Get the user session token to pass it as authorization token to make t before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/12-access-permission/01-create-api.cy.ts b/e2e/cypress/tests/12-access-permission/01-create-api.cy.ts index fd9186e62..5011d6b0b 100644 --- a/e2e/cypress/tests/12-access-permission/01-create-api.cy.ts +++ b/e2e/cypress/tests/12-access-permission/01-create-api.cy.ts @@ -14,7 +14,7 @@ describe('Create API Spec', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) cy.resetState() }) diff --git a/e2e/cypress/tests/12-access-permission/04-access-manager.cy.ts b/e2e/cypress/tests/12-access-permission/04-access-manager.cy.ts index 0e71be9d6..2ba9413d2 100644 --- a/e2e/cypress/tests/12-access-permission/04-access-manager.cy.ts +++ b/e2e/cypress/tests/12-access-permission/04-access-manager.cy.ts @@ -12,7 +12,7 @@ describe('Grant Access Manager Role', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { @@ -56,7 +56,7 @@ describe('Verify that Mark is able to view the pending request', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/12-access-permission/05-namespace-manage.cy.ts b/e2e/cypress/tests/12-access-permission/05-namespace-manage.cy.ts index 93f743788..3075dfe44 100644 --- a/e2e/cypress/tests/12-access-permission/05-namespace-manage.cy.ts +++ b/e2e/cypress/tests/12-access-permission/05-namespace-manage.cy.ts @@ -14,7 +14,7 @@ describe('Grant Namespace Manage Role', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { @@ -61,7 +61,7 @@ describe('Verify that Wendy is able to see all the options for the Namespace', ( before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/12-access-permission/06-credential-issuer.cy.ts b/e2e/cypress/tests/12-access-permission/06-credential-issuer.cy.ts index 1998de81a..e50d355f4 100644 --- a/e2e/cypress/tests/12-access-permission/06-credential-issuer.cy.ts +++ b/e2e/cypress/tests/12-access-permission/06-credential-issuer.cy.ts @@ -13,7 +13,7 @@ describe('Grant Credential Issuer Role', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { @@ -59,7 +59,7 @@ describe('Verify that Wendy is able to generate authorization profile', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/12-access-permission/07-namespace-view.cy.ts b/e2e/cypress/tests/12-access-permission/07-namespace-view.cy.ts index dafef02e6..0acd828a1 100644 --- a/e2e/cypress/tests/12-access-permission/07-namespace-view.cy.ts +++ b/e2e/cypress/tests/12-access-permission/07-namespace-view.cy.ts @@ -14,7 +14,7 @@ describe('Grant Namespace View Role to Mark', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { @@ -58,7 +58,7 @@ describe('Verify that Mark is unable to create service account', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/12-access-permission/08-gateway-config.cy.ts b/e2e/cypress/tests/12-access-permission/08-gateway-config.cy.ts index 3021c5e61..0f5b16d00 100644 --- a/e2e/cypress/tests/12-access-permission/08-gateway-config.cy.ts +++ b/e2e/cypress/tests/12-access-permission/08-gateway-config.cy.ts @@ -17,7 +17,7 @@ describe('Grant Gateway Config Role to Wendy', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { @@ -62,7 +62,7 @@ describe('Verify that Wendy is able to generate authorization profile', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/13-namespace-preview-mode/01-create-api.cy.ts b/e2e/cypress/tests/13-namespace-preview-mode/01-create-api.cy.ts index 3e2fd2a42..02fea2554 100644 --- a/e2e/cypress/tests/13-namespace-preview-mode/01-create-api.cy.ts +++ b/e2e/cypress/tests/13-namespace-preview-mode/01-create-api.cy.ts @@ -14,7 +14,7 @@ describe('Create API Spec', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) cy.resetState() }) diff --git a/e2e/cypress/tests/14-org-assignment/01-client-cred-team-access.ts b/e2e/cypress/tests/14-org-assignment/01-client-cred-team-access.ts index 5f6d92d93..4e8ed934d 100644 --- a/e2e/cypress/tests/14-org-assignment/01-client-cred-team-access.ts +++ b/e2e/cypress/tests/14-org-assignment/01-client-cred-team-access.ts @@ -23,7 +23,7 @@ describe('Add Organization to publish API', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) cy.resetState() }) diff --git a/e2e/cypress/tests/14-org-assignment/02-multiple-org-admin.ts b/e2e/cypress/tests/14-org-assignment/02-multiple-org-admin.ts index 059a70431..bfbc604a4 100644 --- a/e2e/cypress/tests/14-org-assignment/02-multiple-org-admin.ts +++ b/e2e/cypress/tests/14-org-assignment/02-multiple-org-admin.ts @@ -1,11 +1,3 @@ -import ApiDirectoryPage from '../../pageObjects/apiDirectory' -import HomePage from '../../pageObjects/home' -import LoginPage from '../../pageObjects/login' -import NamespaceAccessPage from '../../pageObjects/namespaceAccess' -import Products from '../../pageObjects/products' -import ServiceAccountsPage from '../../pageObjects/serviceAccounts' -import keycloakGroupPage from '../../pageObjects/keycloakGroup' -import AuthorizationProfile from '../../pageObjects/authProfile' import keycloakUsersPage from '../../pageObjects/keycloakUsers' describe('Give a user org admin access at organization level', () => { @@ -14,7 +6,7 @@ describe('Give a user org admin access at organization level', () => { before(() => { cy.visit(Cypress.env('KEYCLOAK_URL')) cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { @@ -54,94 +46,4 @@ describe('Give a user org admin access at organization level', () => { after(() => { cy.keycloakLogout() }) - -}) - -describe('Multiple Org Adming for the organization', () => { - const home = new HomePage() - const na = new NamespaceAccessPage() - const pd = new Products() - const sa = new ServiceAccountsPage() - const apiDir = new ApiDirectoryPage() - const login = new LoginPage() - let userSession: any - let namespace: any - - before(() => { - cy.visit('/') - cy.resetState() - }) - - beforeEach(() => { - cy.preserveCookies() - cy.fixture('apiowner').as('apiowner') - cy.fixture('common-testdata').as('common-testdata') - cy.visit(login.path) - }) - - - it('authenticates Janis (api owner) to get the user session token', () => { - cy.get('@common-testdata').then(({ apiTest }: any) => { - cy.getUserSessionTokenValue(apiTest.namespace, false).then((value) => { - userSession = value - }) - }) - }) - - it('Set token with gwa config command', () => { - cy.exec('gwa config set --token ' + userSession, { timeout: 3000, failOnNonZeroExit: false }).then((response) => { - expect(response.stdout).to.contain("Config settings saved") - }); - }) - - it('create namespace using gwa cli command', () => { - var cleanedUrl = Cypress.env('BASE_URL').replace(/^http?:\/\//i, ""); - cy.exec('gwa namespace create --generate --host ' + cleanedUrl + ' --scheme http', { timeout: 3000, failOnNonZeroExit: false }).then((response) => { - assert.isNotNaN(response.stdout) - namespace = response.stdout - cy.updateJsonValue('common-testdata.json', 'orgAssignment.namespace', namespace) - // cy.updateJsonValue('apiowner.json', 'clientCredentials.clientIdSecret.product.environment.name.config.serviceName', 'cc-service-for-' + namespace) - cy.executeCliCommand("gwa config set --namespace " + namespace) - }); - }) - - it('activates new namespace', () => { - home.useNamespace(namespace) - }) - - - it('creates a new service account', () => { - cy.visit(sa.path) - cy.get('@apiowner').then(({ serviceAccount }: any) => { - sa.createServiceAccount(serviceAccount.scopes) - }) - sa.saveServiceAcctCreds() - }) - - it('creates as new product in the directory', () => { - cy.visit(pd.path) - cy.get('@apiowner').then(({ orgAssignmentMultipleAdmin }: any) => { - pd.createNewProduct(orgAssignmentMultipleAdmin.product.name, orgAssignmentMultipleAdmin.product.environment.name) - }) - }) - - it('Assign organization to the created namespace', () => { - cy.visit(apiDir.path) - cy.get('@apiowner').then(({ product }: any) => { - apiDir.addOrganizationAndOrgUnit(product) - }) - }) - - it('Verify Ord Admins Members details in Organization group access ', () => { - cy.visit(na.path) - cy.wait(2000) - na.clickOnOrganizationGroupAccess() - cy.get('@apiowner').then(({ orgAssignmentMultipleAdmin }: any) => { - na.checkMembersForGroupAccess(orgAssignmentMultipleAdmin.GroupAccess.members) - }) - }) - - after(() => { - cy.logout() - }) -}) +}) \ No newline at end of file diff --git a/e2e/cypress/tests/14-org-assignment/03-verify-org-admin-member-org.ts b/e2e/cypress/tests/14-org-assignment/03-verify-org-admin-member-org.ts new file mode 100644 index 000000000..86fa3c287 --- /dev/null +++ b/e2e/cypress/tests/14-org-assignment/03-verify-org-admin-member-org.ts @@ -0,0 +1,95 @@ +import ApiDirectoryPage from '../../pageObjects/apiDirectory' +import HomePage from '../../pageObjects/home' +import LoginPage from '../../pageObjects/login' +import NamespaceAccessPage from '../../pageObjects/namespaceAccess' +import Products from '../../pageObjects/products' +import ServiceAccountsPage from '../../pageObjects/serviceAccounts' + +describe('Multiple Org Adming for the organization', () => { + const home = new HomePage() + const na = new NamespaceAccessPage() + const pd = new Products() + const sa = new ServiceAccountsPage() + const apiDir = new ApiDirectoryPage() + const login = new LoginPage() + let userSession: any + let namespace: any + + before(() => { + cy.visit('/') + cy.resetState() + }) + + beforeEach(() => { + cy.preserveCookies() + cy.fixture('apiowner').as('apiowner') + cy.fixture('common-testdata').as('common-testdata') + cy.visit(login.path) + }) + + + it('authenticates Janis (api owner) to get the user session token', () => { + cy.get('@common-testdata').then(({ apiTest }: any) => { + cy.getUserSessionTokenValue(apiTest.namespace, false).then((value) => { + userSession = value + }) + }) + }) + + it('Set token with gwa config command', () => { + cy.exec('gwa config set --token ' + userSession, { timeout: 3000, failOnNonZeroExit: false }).then((response) => { + expect(response.stdout).to.contain("Config settings saved") + }); + }) + + it('create namespace using gwa cli command', () => { + var cleanedUrl = Cypress.env('BASE_URL').replace(/^http?:\/\//i, ""); + cy.exec('gwa namespace create --generate --host ' + cleanedUrl + ' --scheme http', { timeout: 3000, failOnNonZeroExit: false }).then((response) => { + assert.isNotNaN(response.stdout) + namespace = response.stdout + cy.updateJsonValue('common-testdata.json', 'orgAssignment.namespace', namespace) + // cy.updateJsonValue('apiowner.json', 'clientCredentials.clientIdSecret.product.environment.name.config.serviceName', 'cc-service-for-' + namespace) + cy.executeCliCommand("gwa config set --namespace " + namespace) + }); + }) + + it('activates new namespace', () => { + home.useNamespace(namespace) + }) + + + it('creates a new service account', () => { + cy.visit(sa.path) + cy.get('@apiowner').then(({ serviceAccount }: any) => { + sa.createServiceAccount(serviceAccount.scopes) + }) + sa.saveServiceAcctCreds() + }) + + it('creates as new product in the directory', () => { + cy.visit(pd.path) + cy.get('@apiowner').then(({ orgAssignmentMultipleAdmin }: any) => { + pd.createNewProduct(orgAssignmentMultipleAdmin.product.name, orgAssignmentMultipleAdmin.product.environment.name) + }) + }) + + it('Assign organization to the created namespace', () => { + cy.visit(apiDir.path) + cy.get('@apiowner').then(({ product }: any) => { + apiDir.addOrganizationAndOrgUnit(product) + }) + }) + + it('Verify Ord Admins Members details in Organization group access ', () => { + cy.visit(na.path) + cy.wait(2000) + na.clickOnOrganizationGroupAccess() + cy.get('@apiowner').then(({ orgAssignmentMultipleAdmin }: any) => { + na.checkMembersForGroupAccess(orgAssignmentMultipleAdmin.GroupAccess.members) + }) + }) + + after(() => { + cy.logout() + }) +}) diff --git a/e2e/cypress/tests/14-org-assignment/04-multiple-org-admin-org-unit.ts b/e2e/cypress/tests/14-org-assignment/04-multiple-org-admin-org-unit.ts new file mode 100644 index 000000000..b82d6e288 --- /dev/null +++ b/e2e/cypress/tests/14-org-assignment/04-multiple-org-admin-org-unit.ts @@ -0,0 +1,68 @@ +import keycloakGroupPage from '../../pageObjects/keycloakGroup' +import keycloakUsersPage from '../../pageObjects/keycloakUsers' + + +describe('Give a user org admin access at organization unit level', () => { + const user = new keycloakUsersPage() + const groups = new keycloakGroupPage() + + before(() => { + cy.visit(Cypress.env('KEYCLOAK_URL')) + cy.deleteAllCookies() + cy.reload(true) + }) + + beforeEach(() => { + cy.preserveCookies() + cy.fixture('developer').as('developer') + cy.fixture('apiowner').as('apiowner') + cy.fixture('state/regen').as('regen') + cy.fixture('admin').as('admin') + cy.fixture('common-testdata').as('common-testdata') + }) + + it('Authenticates Admin owner', () => { + cy.get('@admin').then(({ user }: any) => { + cy.contains('Administration Console').click({force:true}) + cy.keycloakLogin(user.credentials.username, user.credentials.password) + }) + }) + + it('Navigate to User Groups', () => { + groups.navigateToUserGroups() + }) + + it('Add another org unit', () => { + cy.contains('ministry-of-health').click() + cy.get('[id="createGroup"]').click() + cy.get('[id="name"]').type('health-protection') + cy.contains('Save').click() + }) + + it('Navigate to Users Page', () => { + cy.contains('Users').click() + }) + + it('Search Wendy (Credential Issuer) from the user list', () => { + cy.get('@apiowner').then(({ clientCredentials }: any) => { + user.editUser(clientCredentials.Wendy.email) + }) + }) + + it('Navigate to Groups tab', () => { + user.selectTab('Groups') + }) + + it('Reset any existing assoction', () => { + user.resetAssociation() + }) + + it('Set the user(Wendy) to the Organization Unit', () => { + user.setUserToOrganization('health-protection') + }) + + after(() => { + cy.keycloakLogout() + }) + +}) \ No newline at end of file diff --git a/e2e/cypress/tests/14-org-assignment/03-multiple-org-admin-org-unit.ts b/e2e/cypress/tests/14-org-assignment/05-verify-org-admin-member-org-unit.ts similarity index 63% rename from e2e/cypress/tests/14-org-assignment/03-multiple-org-admin-org-unit.ts rename to e2e/cypress/tests/14-org-assignment/05-verify-org-admin-member-org-unit.ts index 193ea09b6..0fe81f42a 100644 --- a/e2e/cypress/tests/14-org-assignment/03-multiple-org-admin-org-unit.ts +++ b/e2e/cypress/tests/14-org-assignment/05-verify-org-admin-member-org-unit.ts @@ -4,75 +4,6 @@ import LoginPage from '../../pageObjects/login' import NamespaceAccessPage from '../../pageObjects/namespaceAccess' import Products from '../../pageObjects/products' import ServiceAccountsPage from '../../pageObjects/serviceAccounts' -import keycloakGroupPage from '../../pageObjects/keycloakGroup' -import AuthorizationProfile from '../../pageObjects/authProfile' -import keycloakUsersPage from '../../pageObjects/keycloakUsers' - - -describe('Give a user org admin access at organization unit level', () => { - const user = new keycloakUsersPage() - const groups = new keycloakGroupPage() - - before(() => { - cy.visit(Cypress.env('KEYCLOAK_URL')) - cy.deleteAllCookies() - cy.reload() - }) - - beforeEach(() => { - cy.preserveCookies() - cy.fixture('developer').as('developer') - cy.fixture('apiowner').as('apiowner') - cy.fixture('state/regen').as('regen') - cy.fixture('admin').as('admin') - cy.fixture('common-testdata').as('common-testdata') - }) - - it('Authenticates Admin owner', () => { - cy.get('@admin').then(({ user }: any) => { - cy.contains('Administration Console').click({force:true}) - cy.keycloakLogin(user.credentials.username, user.credentials.password) - }) - }) - - it('Navigate to User Groups', () => { - groups.navigateToUserGroups() - }) - - it('Add another org unit', () => { - cy.contains('ministry-of-health').click() - cy.get('[id="createGroup"]').click() - cy.get('[id="name"]').type('health-protection') - cy.contains('Save').click() - }) - - it('Navigate to Users Page', () => { - cy.contains('Users').click() - }) - - it('Search Wendy (Credential Issuer) from the user list', () => { - cy.get('@apiowner').then(({ clientCredentials }: any) => { - user.editUser(clientCredentials.Wendy.email) - }) - }) - - it('Navigate to Groups tab', () => { - user.selectTab('Groups') - }) - - it('Reset any existing assoction', () => { - user.resetAssociation() - }) - - it('Set the user(Wendy) to the Organization Unit', () => { - user.setUserToOrganization('health-protection') - }) - - after(() => { - cy.keycloakLogout() - }) - -}) describe('Multiple Org Admin for the organization', () => { const home = new HomePage() diff --git a/e2e/cypress/tests/15-aps-api/01-create-api.cy.ts b/e2e/cypress/tests/15-aps-api/01-create-api.cy.ts index 0f39c82ec..1d9b664e4 100644 --- a/e2e/cypress/tests/15-aps-api/01-create-api.cy.ts +++ b/e2e/cypress/tests/15-aps-api/01-create-api.cy.ts @@ -14,7 +14,7 @@ describe('Create API Spec', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) cy.resetState() }) diff --git a/e2e/cypress/tests/15-aps-api/02-organization.cy.ts b/e2e/cypress/tests/15-aps-api/02-organization.cy.ts index 29bc1df5c..12ab1caf6 100644 --- a/e2e/cypress/tests/15-aps-api/02-organization.cy.ts +++ b/e2e/cypress/tests/15-aps-api/02-organization.cy.ts @@ -11,7 +11,7 @@ describe('Get the user session token', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) // cy.getUserSessionTokenValue() }) diff --git a/e2e/cypress/tests/15-aps-api/06-products.cy.ts b/e2e/cypress/tests/15-aps-api/06-products.cy.ts index 52c955747..453063c2f 100644 --- a/e2e/cypress/tests/15-aps-api/06-products.cy.ts +++ b/e2e/cypress/tests/15-aps-api/06-products.cy.ts @@ -15,7 +15,7 @@ describe('Get the user session token to check ', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { @@ -97,7 +97,7 @@ describe('Verify that created Product is displayed in UI', () => { before(() => { cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/16-gwa-cli/01-cli-commands.ts b/e2e/cypress/tests/16-gwa-cli/01-cli-commands.ts index 0031c0e07..83a2c4cc3 100644 --- a/e2e/cypress/tests/16-gwa-cli/01-cli-commands.ts +++ b/e2e/cypress/tests/16-gwa-cli/01-cli-commands.ts @@ -18,7 +18,7 @@ describe('Verify CLI commands', () => { before(() => { // cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { @@ -50,7 +50,7 @@ describe('Verify CLI commands', () => { let clientID = "dummy-client" let clientSecret = cli.credentials.clientSecret cy.executeCliCommand('gwa login --client-id ' + clientID + ' --client-secret ' + clientSecret + ' --host ' + cleanedUrl + ' --scheme http').then((response) => { - assert.equal(response.stderr, "Error: unauthorized_client\nINVALID_CREDENTIALS: Invalid client credentials") + expect(response.stderr).to.contain("Error: invalid_client") }); }) @@ -58,7 +58,7 @@ describe('Verify CLI commands', () => { let clientID = cli.credentials.clientID let clientSecret = "dummy-client-secret" cy.executeCliCommand('gwa login --client-id ' + clientID + ' --client-secret ' + clientSecret + ' --host ' + cleanedUrl + ' --scheme http').then((response) => { - assert.equal(response.stderr, "Error: unauthorized_client\nINVALID_CREDENTIALS: Invalid client credentials") + expect(response.stderr).to.contain("unauthorized_client") }); }) diff --git a/e2e/cypress/tests/16-gwa-cli/02-cli-generate-config.ts b/e2e/cypress/tests/16-gwa-cli/02-cli-generate-config.ts index 12a5d5d18..e4214a9ef 100644 --- a/e2e/cypress/tests/16-gwa-cli/02-cli-generate-config.ts +++ b/e2e/cypress/tests/16-gwa-cli/02-cli-generate-config.ts @@ -21,7 +21,7 @@ describe('Verify CLI commands for generate/apply config', () => { before(() => { // cy.visit('/') - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/17-delete-application/01-delete-application-without-access.cy.ts b/e2e/cypress/tests/17-delete-application/01-delete-application-without-access.cy.ts index b38cd330c..4075417f2 100644 --- a/e2e/cypress/tests/17-delete-application/01-delete-application-without-access.cy.ts +++ b/e2e/cypress/tests/17-delete-application/01-delete-application-without-access.cy.ts @@ -12,7 +12,7 @@ describe('Delete application which has no access request spec', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/17-delete-application/03-delete-application-with-approved-request.cy.ts b/e2e/cypress/tests/17-delete-application/03-delete-application-with-approved-request.cy.ts index c6f6da735..008364333 100644 --- a/e2e/cypress/tests/17-delete-application/03-delete-application-with-approved-request.cy.ts +++ b/e2e/cypress/tests/17-delete-application/03-delete-application-with-approved-request.cy.ts @@ -15,7 +15,7 @@ describe('Delete application which has approved request spec', () => { before(() => { cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/e2e/cypress/tests/17-delete-application/04-delete-namespace-gwa.ts b/e2e/cypress/tests/17-delete-application/04-delete-namespace-gwa.ts index e452d6282..87768c2f6 100644 --- a/e2e/cypress/tests/17-delete-application/04-delete-namespace-gwa.ts +++ b/e2e/cypress/tests/17-delete-application/04-delete-namespace-gwa.ts @@ -8,7 +8,7 @@ describe('Verify namespace delete using gwa command', () => { before(() => { // cy.visit('/') cy.deleteAllCookies() - cy.reload() + cy.reload(true) }) beforeEach(() => { diff --git a/local/kong/Dockerfile b/local/kong/Dockerfile index be4d70913..397e07dff 100644 --- a/local/kong/Dockerfile +++ b/local/kong/Dockerfile @@ -20,7 +20,7 @@ RUN (cd kong-oidc && luarocks make && luarocks pack kong-oidc ${PLUGIN_OIDC_VERS RUN git clone https://github.com/ikethecoder/kong-oidc-consumer.git RUN (cd kong-oidc-consumer && luarocks make && luarocks pack kong-oidc-consumer ${PLUGIN_OIDC_CONSUMER_VERSION}) -RUN git clone https://github.com/ikethecoder/kong-plugin-jwt-keycloak.git +RUN git clone -b kong28 https://github.com/ikethecoder/kong-plugin-jwt-keycloak.git RUN (cd kong-plugin-jwt-keycloak && luarocks make && luarocks pack kong-plugin-jwt-keycloak ${PLUGIN_VERSION}) RUN git clone -b feature/kong-2.0-upgrade https://github.com/bcgov/gwa-kong-endpoint.git