Skip to content

Commit

Permalink
Merge pull request #608 from bcgov/test
Browse files Browse the repository at this point in the history
Create Latest Release 1.2.5
  • Loading branch information
ikethecoder authored Oct 27, 2022
2 parents acbda4b + 7e4d1a9 commit 5a84bb6
Show file tree
Hide file tree
Showing 151 changed files with 7,807 additions and 4,035 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,10 @@ jobs:
value: '${{ secrets.KEYCLOAK_REALM }}'
COOKIE_SECURE:
value: 'true'
LOG_LEVEL:
value: 'debug'
DISABLE_LOGGING:
value: 'true'
EMAIL_ENABLED:
value: 'true'
EMAIL_FROM:
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/fixtures/access-manager.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"user": {
"credentials": {
"username": "mark",
"username": "mark@idir",
"password": "mark"
}
},
Expand Down
3 changes: 2 additions & 1 deletion e2e/cypress/fixtures/api.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
"members": [
{
"member": {
"username": "janis@idir"
"id": "janis@idir",
"email":"[email protected]"
},
"roles": ["organization-admin"]
}
Expand Down
32 changes: 26 additions & 6 deletions e2e/cypress/fixtures/apiowner.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"user": {
"credentials": {
"username": "janis@idir",
"email":"[email protected]",
"password": "awsummer"
}
},
Expand Down Expand Up @@ -54,10 +55,12 @@
"serviceName": "cc-service-for-platform",
"Mark": {
"userName": "mark",
"email":"[email protected]",
"accessRole": ["Access.Manage"]
},
"Wendy": {
"userName": "wendy",
"email":"[email protected]",
"accessRole": ["CredentialIssuer.Admin"]
},
"jwtKeyPair": {
Expand Down Expand Up @@ -207,27 +210,33 @@
},
"grantPermission": {
"Mark": {
"userName": "mark",
"userName": "Mark F Mark L",
"email":"[email protected]",
"accessRole": ["Access.Manage"]
},
"Mark_NV": {
"userName": "mark",
"userName": "Mark F Mark L",
"email":"[email protected]",
"accessRole": ["Namespace.View"]
},
"Wendy": {
"userName": "wendy",
"userName": "Wendy F Wendy L",
"email":"[email protected]",
"accessRole": ["Namespace.Manage", "CredentialIssuer.Admin"]
},
"Wendy_CA": {
"userName": "wendy",
"userName": "Wendy F Wendy L",
"email":"[email protected]",
"accessRole": ["CredentialIssuer.Admin"]
},
"Wendy_GC": {
"userName": "wendy",
"userName": "Wendy F Wendy L",
"email":"[email protected]",
"accessRole": ["GatewayConfig.Publish", "Namespace.View"]
},
"Janis": {
"userName": "janis@idir",
"userName": "Janis Smith",
"email":"[email protected]",
"accessRole": ["Namespace.Manage", "CredentialIssuer.Admin"]
}
},
Expand Down Expand Up @@ -256,7 +265,18 @@
"grantPermission": {
"Mark": {
"userName": "mark",
"email": "[email protected]",
"accessRole": ["Access.Manage", "Namespace.View"]
},
"Janis": {
"userName": "janis@idir",
"email": "[email protected]",
"accessRole": ["CredentialIssuer.Admin"]
},
"OldUser": {
"userName": "olduser@idir",
"email": "[email protected]",
"accessRole": ["Access.Manage", "Namespace.View","Namespace.Manage"]
}
},
"permission": {
Expand Down
2 changes: 1 addition & 1 deletion e2e/cypress/fixtures/credential-issuer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"user": {
"credentials": {
"username": "wendy",
"username": "wendy@idir",
"password": "wendy"
}
},
Expand Down
14 changes: 14 additions & 0 deletions e2e/cypress/fixtures/developer.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,19 @@
"name": "New-Auto Test Product",
"environment": "dev"
}
},
"deleteApplication":{
"application": {
"name": "delete-application-without-access",
"description": "Test application for auto test"
},
"pendingRequest": {
"name": "delete-application-with-pending-request",
"description": "Test application for auto test"
},
"approvedRequest": {
"name": "delete-application-with-approved-request",
"description": "Test application for auto test"
}
}
}
15 changes: 15 additions & 0 deletions e2e/cypress/fixtures/usermigration.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"oldUser": {
"credentials": {
"username": "olduser@idir",
"password": "awsummer"
}
},
"newUser": {
"credentials": {
"username": "220469e037c84a7abdfab15204a60701@olduser",
"password": "awsummer"
}
},
"namespace": "newplatform"
}
2 changes: 0 additions & 2 deletions e2e/cypress/pageObjects/activity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class ActivityPage {
this.setFilterCondition(filterCondition, value)
var filteredResponse: any
let result: any
debugger
if (value == "") {
filteredResponse = response
}
Expand All @@ -28,7 +27,6 @@ class ActivityPage {
cy.wrap($e1).find('p').invoke('text').then((text) => {
activityText = text
filteredResponse.forEach((record: any) => {
debugger
responseText = record.message
responseText = responseText.replaceAll("{", "${filteredResponse[index].params.")
const regexp = /\${([^{]+)}/g;
Expand Down
2 changes: 0 additions & 2 deletions e2e/cypress/pageObjects/apiDirectory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,8 @@ class ApiDirectoryPage {
isProductDisplay(productName: string): Boolean {
var flag = false;
cy.get('body', {timeout: 6000}).then(($body) => {
debugger
const pname: string = productName.toLowerCase().replaceAll(' ', '-')
var ele : string = `[data-testid=api-${pname}]`
debugger
cy.log('Body -> '+ $body)
if ($body.find(ele).length > 0) {
flag = true
Expand Down
20 changes: 20 additions & 0 deletions e2e/cypress/pageObjects/applications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class ApplicationPage {
appName: string = '[data-testid=create-app-name-input]'
appDescription: string = '[data-testid=create-app-description-input]'
createAppSubmitBtn: string = '[data-testid=create-app-submit-btn]'
applicationTbl = '[role="table"]'

createApplication(app: any) {
cy.get(this.createAppBtn).first().click()
Expand All @@ -12,6 +13,25 @@ class ApplicationPage {
cy.get(this.createAppSubmitBtn).click()
cy.get('table').contains('td', app.name).should('be.visible');
}

deleteApplication(appName: any) {
cy.get(this.applicationTbl).find('tr').each(($e1, index, $list) => {
let applicationName = $e1.find('td:nth-child(1)').text()
if (applicationName.toLowerCase() === appName.toLowerCase() ) {
cy.wrap($e1).find('button').first().click()
cy.get('[data-testid="delete-application-btn"]').filter(':visible').first().click()
}
})
}

checkDeletedApplication(appName: any) {
cy.get(this.applicationTbl).find('tr').each(($e1, index, $list) => {
let applicationName = $e1.find('td:nth-child(1)').text()
if (applicationName.toLowerCase() === appName.toLowerCase() ) {
assert.fail("Application is not deleted")
}
})
}
}

export default ApplicationPage
8 changes: 2 additions & 6 deletions e2e/cypress/pageObjects/consumers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ export default class ConsumersPage {
// cy.wait(500)
cy.get(this.consumerDialogSaveBtn).click()
cy.get(this.consumerDialogSaveBtn, { timeout: 2000 }).should('not.exist')
debugger
cy.wait(3000)
}

Expand Down Expand Up @@ -148,6 +147,8 @@ export default class ConsumersPage {

approvePendingRequest() {
cy.get(this.approveBtn).click({ force: true })
cy.wait(1000)
cy.verifyToastMessage("Access request approved")
}

reviewThePendingRequest() : Boolean{
Expand Down Expand Up @@ -178,7 +179,6 @@ export default class ConsumersPage {
});
cy.get(this.filterType).select(type).invoke('val')
cy.get(this.filterValue).select(value).invoke('val')
debugger
if (type == 'Labels') {
cy.get(this.labelValueInput).type(labelValue)
}
Expand All @@ -203,7 +203,6 @@ export default class ConsumersPage {
expect($e1.next().text().trim()).to.eq('Dev')
}
if ($e1.text() === 'Application') {
debugger
expect($e1.next().text().trim()).to.eq(applicationDetails.name)
}
if ($e1.text() === 'Instructions from the API Provider') {
Expand All @@ -217,7 +216,6 @@ export default class ConsumersPage {

addGroupLabels(groupLabels: any) {
Object.entries(groupLabels.labels).forEach((entry, index) => {
debugger
cy.get(this.labelsGroupSelection).select('[+] Add New Label Group...').invoke('val')
cy.get(this.labelName).type(entry[0])
cy.contains('Add').click()
Expand Down Expand Up @@ -285,9 +283,7 @@ export default class ConsumersPage {

addManageLabels() {
cy.wait(2000)
debugger
cy.get(this.manageLabelsBtn).parents('ul').find('li').then(($ele) => {
debugger
const index = $ele.length - 1
this.openManageLabelsWindow()
cy.get(this.labelsGroupSelection).select('[+] Add New Label Group...').invoke('val')
Expand Down
5 changes: 5 additions & 0 deletions e2e/cypress/pageObjects/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ class LoginPage {
usernameInput: string = '[id=username]'
passwordInput: string = '[id=password]'
loginSubmitButton: string = '[id=kc-login]'

checkUnsuccessfulSignIn(){
cy.contains('Account is disabled, contact your administrator.').should('be.visible')
cy.get(this.loginSubmitButton).should('be.visible')
}
}

export default LoginPage
6 changes: 3 additions & 3 deletions e2e/cypress/pageObjects/namespaceAccess.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
class NamespaceAccessPage {

userNameInput: string = '[data-testid="nsa-gua-username-field"]'
userNameInput: string = '[data-testid="nsa-gua-email-field"]'
grantUserAccessBtn: string = '[data-testid="nsa-grant-access-btn"]'

grantPermission(accessRqst: any) {
cy.get(this.userNameInput,{ timeout: 2000 }).should('be.visible');
cy.get(this.userNameInput).type(accessRqst.userName);
cy.get(this.userNameInput).type(accessRqst.email);
let accessRole: Array<string> = accessRqst.accessRole
accessRole.forEach(function (accessName) {
cy.contains("Permissions").next().find('li').each(($el, index, $list) => {
Expand Down Expand Up @@ -36,7 +36,7 @@ class NamespaceAccessPage {

revokeAllPermission(user :string)
{
cy.contains(user.toLowerCase()).parents('tr').find('td:nth-child(3)').children('button').click()
cy.contains(user).parents('tr').find('td:nth-child(3)').children('button').click()
cy.get('[data-testid$="-revoke-btn"]').filter(':visible').first().click()
cy.wait(2000)
}
Expand Down
Loading

0 comments on commit 5a84bb6

Please sign in to comment.