Skip to content
Merged
Show file tree
Hide file tree
Changes from 114 commits
Commits
Show all changes
124 commits
Select commit Hold shift + click to select a range
f382fc9
changes to get docker compose to launch cleanly
ikethecoder Nov 22, 2024
12c86c0
fix group issue by upgrading admin client
ikethecoder Nov 22, 2024
44e29a4
fix group issue by upgrading admin client
ikethecoder Nov 22, 2024
850e0fa
refactor keycloak admin client
ikethecoder Nov 25, 2024
8d0e77c
try to build with openssl legacy provider
ikethecoder Nov 25, 2024
afd5b74
try to build with openssl legacy provider
ikethecoder Nov 25, 2024
eebd7c1
upd all build steps with ssl flag
ikethecoder Nov 25, 2024
abe24cc
fix dockerfile
ikethecoder Nov 26, 2024
1dbd99e
fix cypress
ikethecoder Nov 27, 2024
00af7ce
add some output to cypress automation logs
ikethecoder Nov 27, 2024
3a4d590
upd cypress log
ikethecoder Nov 27, 2024
f8320fe
use nightly keycloak and use 2 isntances in docker compose
ikethecoder Nov 30, 2024
d3ff9b0
use kc-upgrade gwa for cypress e2e
ikethecoder Nov 30, 2024
5dae9ab
add data plane info as gwa needs for upstream validation check
ikethecoder Nov 30, 2024
da49add
fix group mgmt
ikethecoder Dec 1, 2024
03be8db
Test api-key plugin with kong 3.9.0
Elson9 Mar 6, 2025
45ef5dc
fix for kong-spec-expose and kong-upstream-jwt
Elson9 Nov 7, 2025
306a791
remove commented out cypress tests
Elson9 Nov 7, 2025
0e3cf81
use our latest Kong 3 docker image
rustyjux Nov 13, 2025
bc6f7e7
upgrade gwa-api version in e2e tests workflow
rustyjux Nov 13, 2025
b775320
Fix expected error response for IP restriction
rustyjux Nov 13, 2025
905c4fb
update gwa-cli to 3.0.6 for e2e
rustyjux Nov 13, 2025
a867036
provide DECK_CLI env var, eliminate docker compose warnings
rustyjux Nov 14, 2025
1732945
replace test host httpbin.org with httpbun.com
rustyjux Nov 14, 2025
a6634f9
accept 97 to 99
rustyjux Nov 14, 2025
cfa6051
correct name of template
rustyjux Nov 14, 2025
b8ee779
Retry if product/dataset fails to publish
rustyjux Nov 17, 2025
8b84d54
exclude `gwa status` from e2e tests
rustyjux Nov 17, 2025
1dc4036
Expect 200 when using allowed methods (POST/PUT)
rustyjux Nov 17, 2025
cad4b3b
add retry for `gwa apply` for two-tiered
rustyjux Nov 17, 2025
9873b39
Only enable code coverage in CI (GitHub Actions)
rustyjux Nov 17, 2025
a1fec0e
remove it.onlys - oops
rustyjux Nov 17, 2025
ffcd34e
Clear redis rate limit key before new rate limiting test
rustyjux Nov 18, 2025
84a8598
move clear redis timing
rustyjux Nov 18, 2025
e59d812
upgrade local postgres to 12.8 > 15
rustyjux Nov 19, 2025
6042f6f
bump actions/cache v2 > v4
rustyjux Nov 19, 2025
0c38d2d
use postgres 14 in e2e
rustyjux Nov 19, 2025
54468e6
Changes to get docker compose to run (with authz issues)
rustyjux Nov 24, 2025
be32ec4
Merge remote-tracking branch 'origin/feature/kc-upgrade' into feature…
rustyjux Nov 24, 2025
0115b3b
use updated gwa-api, only run cypress tests 01 and 02
rustyjux Nov 25, 2025
7357a31
update cypress logout action
rustyjux Nov 25, 2025
706a8ff
fixes for updated keycloak ui
rustyjux Nov 25, 2025
0dd5bec
fix expected state for scope not found
rustyjux Nov 25, 2025
81336cb
run all tests
rustyjux Nov 25, 2025
ffc00a1
test 01 02
rustyjux Nov 25, 2025
28b5e84
run all tests
rustyjux Nov 25, 2025
4a59668
update node version in nvmrc and ci-feat-sonar GHA
rustyjux Nov 26, 2025
4e0957b
fix decision strategy for default permission
rustyjux Nov 26, 2025
915f0a5
fix and cleanup keycloak tests
rustyjux Nov 27, 2025
aa4078a
more test fixes
rustyjux Nov 27, 2025
fae9366
bump postgres to 14 in docker compose
rustyjux Nov 28, 2025
1c6215a
parameterize in docker compose
rustyjux Nov 28, 2025
b088151
set rate limit to 1 for expected one successful call
rustyjux Dec 1, 2025
020ed9c
add wait before Kong requests after updating auth plugin
rustyjux Dec 1, 2025
44e21dd
remove echo from local kong dockerfile
rustyjux Dec 1, 2025
ecbe36b
Merge branch 'cypress/kong3' into feature/kc-26
rustyjux Dec 1, 2025
8f40177
merge consecutive RUN calls
rustyjux Dec 1, 2025
26709a9
Merge branch 'cypress/kong3' into feature/kc-26
rustyjux Dec 1, 2025
00ca8bc
add Namespace.View on Namespace creation
rustyjux Dec 1, 2025
fd1b4a8
Add explicit pagination for Keycloak group retrieval with max 1000
rustyjux Dec 2, 2025
969fac7
Update Jest setup with polyfills for Web APIs and updated mocks for K…
rustyjux Dec 2, 2025
84e3ef7
adjust depenencies
rustyjux Dec 2, 2025
92b3795
fix UMA permission assertion
rustyjux Dec 2, 2025
ec6e665
remove Namespace.View (return to previous state)
rustyjux Dec 2, 2025
6cc9242
update SonarCloud Scan action
rustyjux Dec 2, 2025
c9a5ef2
remove project from sonar arg
rustyjux Dec 2, 2025
19b47bf
add api-services-portal project
rustyjux Dec 2, 2025
5126f93
restore sonar
rustyjux Dec 2, 2025
68861a3
upgrade keycloak-connect
rustyjux Dec 2, 2025
ef417f0
Replacing local keycloak-admin-client package with official @keycloak…
rustyjux Dec 3, 2025
ee849f9
stop copying keycloak-admin-client in dockerfiles
rustyjux Dec 3, 2025
dd6c22c
fix sonar scan action
rustyjux Dec 3, 2025
a44306f
code cleanup: use find instead of filter
rustyjux Dec 3, 2025
1535a72
code cleanup: remove await on non-promise
rustyjux Dec 3, 2025
f5ff931
Add test to verify authorization scope enforcement (for ds/api)
rustyjux Dec 3, 2025
cbd7eb9
Merge branch 'cypress/kong3' into feature/kc-26
rustyjux Dec 3, 2025
2e833e0
Add ForbiddenError class and update authorization handling to use it …
rustyjux Dec 3, 2025
68ae45a
cypress: update expected response code
rustyjux Dec 3, 2025
c7b7ad8
cypress: disable documentation tests
rustyjux Dec 3, 2025
e3dec96
restore cypress to v13
rustyjux Dec 4, 2025
52ecd7f
Merge branch 'cypress/kong3' into feature/kc-26
rustyjux Dec 4, 2025
f8e656f
cypress: add necessary role for Janis for activity tests
rustyjux Dec 4, 2025
0dc7744
cypress: fix error message
rustyjux Dec 4, 2025
973a669
Cypress: add permissions for Janis in client cred ns
rustyjux Dec 4, 2025
33d433b
cypress: force click
rustyjux Dec 4, 2025
848dc5c
enable keycloak metrics and health
rustyjux Dec 4, 2025
3909ec9
Cypress: add missing fixture
rustyjux Dec 4, 2025
877b7e6
cypress: update expected error code to 401 for service account disabled
rustyjux Dec 4, 2025
d129061
cypress: visit admin access page
rustyjux Dec 4, 2025
72a8b07
Optimize calls to Keycloak
Elson9 Feb 28, 2026
546d40c
Fix test for keycloak optimization
Elson9 Feb 28, 2026
12cbb3b
kc26 logout fix
Elson9 Mar 4, 2026
8a75a7c
fix Missing parameters: id_token_hint when logging out
Elson9 Mar 4, 2026
ee6d686
fix2: Missing parameters: id_token_hint when logging out
Elson9 Mar 4, 2026
1b5f97c
remove backend_logout_url
Elson9 Mar 5, 2026
2e33a8f
Fix redirect to home page, fix signout page typo
Elson9 Mar 5, 2026
36f5bf1
Portal attempt fix to redirect to /signout
Elson9 Mar 5, 2026
ec73399
Remove comment that's no longer applicable
Elson9 Mar 5, 2026
6bf88f2
use latest cli
rustyjux Mar 11, 2026
4da8817
better handle errors for getOrganization + getOrganizationUnit
rustyjux Mar 11, 2026
76ce9f2
guard gql error if org-unit is null
rustyjux Mar 11, 2026
23d8050
fix logout assertion
rustyjux Mar 11, 2026
3a8070b
Fix merge conflicts from dev
Elson9 Mar 11, 2026
bc1d92e
Merge branch 'feature/kc-26' of https://github.com/bcgov/api-services…
Elson9 Mar 11, 2026
ffa26ef
Few more merge conflicts, couple remaining
Elson9 Mar 11, 2026
ceb32a6
Another merge conflict, just package-lock remaining
Elson9 Mar 11, 2026
f631ba2
fix merge conflict package-lock.json, yarn.lock update
Elson9 Mar 11, 2026
644ae81
Add skipLibCheck. This is a standard way to avoid dependency type-def…
Elson9 Mar 11, 2026
372d8db
Fix portal build
Elson9 Mar 11, 2026
a9d556e
Fix portal build 2
Elson9 Mar 11, 2026
64f5d00
Fix portal build 3
Elson9 Mar 11, 2026
59fdd6d
Fix portal build 4
Elson9 Mar 11, 2026
3607444
Fix portal build 5
Elson9 Mar 11, 2026
353eaf6
Fix portal build 6
Elson9 Mar 11, 2026
a4a3b0e
Fix portal build 7
Elson9 Mar 11, 2026
899b364
Upgrade babel/core
Elson9 Mar 12, 2026
c25211a
Fix sonar tests
Elson9 Mar 12, 2026
982c9bb
Fix last remaining test
Elson9 Mar 12, 2026
a39144e
Fix last remaining test 2
Elson9 Mar 12, 2026
4f4cd71
Fix scope loading issue with cypress
Elson9 Mar 12, 2026
8f04b9e
Fix for 14/04 cypress tests
Elson9 Mar 12, 2026
09fd413
accept Namespace.Manage or View for /activity endpoints
rustyjux Mar 12, 2026
2c6b6d4
use gwa-api `dev` branch for e2e
rustyjux Mar 12, 2026
aff23a4
kc bump + minor tweaks
Elson9 Mar 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
src/node_modules
src/.npm
src/_tmp
src/.cache
src/.config
src/.nyc_output
src/dist
**/.next
_data
_data
**/node_modules
__coverage__
1 change: 1 addition & 0 deletions .env.local
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ EMAIL_USER=
EMAIL_PASS=
EXTERNAL_URL=http://oauth2proxy.localtest.me:4180
OIDC_ISSUER=http://keycloak.localtest.me:9081/auth/realms/master
OIDC_CLIENT_ID=aps-portal
LOCAL_ENV=true
WORKING_PATH=/tmp
DESTINATION_URL=
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/aps-cypress-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
steps:
- name: Build GWA API Image
run: |
git clone https://github.com/bcgov/gwa-api.git --branch v1.0.47
git clone https://github.com/bcgov/gwa-api.git --branch feature/kc-26
cd gwa-api/microservices/gatewayApi
docker build -t gwa-api:e2e .

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/ci-build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand Down Expand Up @@ -318,6 +318,9 @@ jobs:
- name: X-Forwarded-Access-Token
values:
- claim: access_token
- name: X-Forwarded-Id-Token
values:
- claim: IDToken
injectResponseHeaders: []
metricsServer:
BindAddress: ""
Expand Down Expand Up @@ -394,6 +397,8 @@ jobs:
secure: true
OIDC_ISSUER:
value: '${{ secrets.OIDC_ISSUER }}'
OIDC_CLIENT_ID:
value: '${{ secrets.OIDC_CLIENT_ID }}'
JWKS_URL:
value: '${{ secrets.OIDC_ISSUER }}/protocol/openid-connect/certs'
EXTERNAL_URL:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-build-feeders.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-build-only.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
username: ${{ env.REGISTRY_USERNAME }}
password: ${{ env.REGISTRY_PASSWORD }}

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/ci-feat-sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,14 @@ jobs:
docker compose down
- name: SonarCloud Scan
uses: sonarsource/sonarqube-scan-action@master
uses: sonarsource/sonarqube-scan-action@v6
with:
args: >
-Dsonar.organization=bcgov-sonarcloud
-Dsonar.projectKey=bcgov_api-services-portal
-Dsonar.sources=src/auth,src/authz,src/batch,src/services
-Dsonar.javascript.lcov.reportPaths=./src/__coverage__/lcov.info
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
SONAR_HOST_URL: https://sonarcloud.io
2 changes: 1 addition & 1 deletion .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
echo "::set-output name=APP_REVISION::${GITHUB_SHA}"
id: set-deploy-id

- uses: actions/cache@v3
- uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v16.15.1
v22.21.1
58 changes: 35 additions & 23 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,51 @@ secrets:

services:
keycloak:
image: quay.io/keycloak/keycloak:15.1.1
image: keycloak-quarkus:e2e
container_name: keycloak
hostname: keycloak
build:
context: local/keycloak
dockerfile: Dockerfile
args:
- KC_VERSION=${KC_VERSION:-26.4.5}
depends_on:
kong-db:
condition: service_healthy
environment:
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: local
command:
[
'-b',
'0.0.0.0',
'-Djboss.socket.binding.port-offset=1001',
'-Dkeycloak.migration.action=import',
'-Dkeycloak.migration.provider=singleFile',
'-Dkeycloak.migration.file=/tmp/realm-config/master-realm.json',
'-Dkeycloak.migration.strategy=OVERWRITE_EXISTING',
'-Dkeycloak.profile.feature.upload_scripts=enabled',
"start",
"--optimized",
"--hostname",
"http://keycloak.localtest.me:9081/auth",
"--db-url",
"jdbc:postgresql://kong-db/${KEYCLOAK_DB_NAME:-keycloak}",
"--db-username",
"keycloakuser",
"--db-password",
"keycloakuser",
"--http-enabled",
"true",
"--http-port",
"9081",
"--import-realm",
]
ports:
- 9081:9081/tcp
environment:
#KEYCLOAK_USER: local
#KEYCLOAK_PASSWORD: local
DB_VENDOR: POSTGRES
DB_SCHEMA: public
DB_ADDR: kong-db:5432
DB_USER: keycloakuser
DB_PASSWORD: keycloakuser
volumes:
- ./local/keycloak/master-realm.json:/tmp/realm-config/master-realm.json
- ./local/keycloak/master-realm.json:/opt/keycloak/data/import/master-realm.json
ports:
- 9081:9081
- 9000:9000
networks:
aps-net:
aliases:
- keycloak.localtest.me
healthcheck:
test: timeout 10s bash -c ':> /dev/tcp/localhost/9081'
interval: 5s
timeout: 5s
retries: 5
oauth2-proxy:
image: quay.io/oauth2-proxy/oauth2-proxy:v7.8.1
container_name: oauth2-proxy
Expand All @@ -62,7 +74,7 @@ services:
- oauth2proxy.localtest.me
apsportal:
container_name: apsportal
image: apsportal:latest
image: apsportal:${APSPORTAL_TAG:-latest}
depends_on:
- keycloak
build:
Expand Down Expand Up @@ -198,7 +210,7 @@ services:
aliases:
- redis-master
gwa-api:
image: gwa-api:e2e
image: gwa-api:${GWA_API_TAG:-e2e}
container_name: gwa-api
entrypoint: sh -c "chmod +x /tmp/gwa/entrypoint.sh && sh /tmp/gwa/entrypoint.sh"
ports:
Expand Down
2 changes: 1 addition & 1 deletion e2e/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ COPY e2e/*.yml /e2e
COPY e2e/entrypoint.sh /tmp
ADD e2e/cypress /e2e/cypress

RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/download/v3.0.6/gwa_Linux_x86_64.tgz \
RUN curl -v -L -O https://github.com/bcgov/gwa-cli/releases/latest/download/gwa_Linux_x86_64.tgz \
&& tar -xzf gwa_Linux_x86_64.tgz \
&& mv gwa /usr/local/bin/.

Expand Down
15 changes: 14 additions & 1 deletion e2e/cypress/fixtures/apiowner.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,23 @@
},
"Wendy": {
"userName": "wendy",
"keycloakUsername": "wendy@idir",
"email": "wendy@test.com",
"accessRole": [
"CredentialIssuer.Admin"
]
},
"Janis": {
"userName": "Janis Smith",
"email": "janis@testmail.com",
"accessRole": [
"CredentialIssuer.Admin",
"Gateway.Manage",
"Gateway.View",
"GatewayConfig.Publish",
"Access.Manage"
]
},
"jwtKeyPair": {
"authProfile": {
"name": "cy-jwt-kp-auth",
Expand Down Expand Up @@ -552,7 +564,8 @@
"email": "janis@testmail.com",
"accessRole": [
"CredentialIssuer.Admin",
"Gateway.Manage"
"Gateway.Manage",
"Gateway.View"
]
},
"OldUser": {
Expand Down
10 changes: 6 additions & 4 deletions e2e/cypress/pageObjects/keycloakClientScopes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,21 @@ import { Assertion } from "chai"
class keycloakClientScopesPage {
path: string = '/'

clientTab: string = '[data-ng-controller="ClientTabCtrl"]'
clientTabs: string = '[data-testid="client-tabs"]'
tableSearchInput: string = '[data-testid="table-search-input"]'

selectTab(tabName: string){
cy.get(this.clientTab).contains('a',tabName).click()
cy.get(this.clientTabs).contains('a',tabName).click({ force: true })
}

verifyAssignedScope(scope: string, expResult:boolean)
{
cy.get(this.tableSearchInput).clear().type(scope).type('{enter}');
if(expResult){
cy.get('[id="assigned"]').find('[title="'+scope+'"]').should('exist');
cy.get('.pf-v5-c-table__tbody > .pf-v5-c-table__tr > :nth-child(2)').contains(scope).should('exist');
}
else{
cy.get('[id="assigned"]').find('[title="'+scope+'"]').should('not.exist');
cy.get('[data-testid="empty-state"]').should('exist');
}
}
}
Expand Down
19 changes: 11 additions & 8 deletions e2e/cypress/pageObjects/keycloakClients.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
class keycloakClientsPage {
path: string = '/'

clientTab: string = '[data-ng-controller="ClientTabCtrl"]'
roleNameTextField: string = '[id="name"]'
clientTabs: string = '[data-testid="client-tabs"]'
createRoleBtn: string = '[data-testid="create-role"]'
roleNameTextField: string = '[data-testid="name"]'
saveBtn: string = '[data-testid="save"]'
addAttributeBtn: string = '[data-ng-click="addAttribute()"]'

selectTab(tabName: string){
cy.get(this.clientTab).contains('a',tabName).click()
cy.get(this.clientTabs).contains('a',tabName).click({ force: true })
}

setRoles(roleName: string, clientName: string){
cy.wait(2000)
cy.get('[id=nav-toggle').click()
cy.contains('Clients').click()
cy.contains(clientName).click()
cy.get('[id=nav-toggle').click()
cy.get('input[placeholder="Search for client"]').type(clientName).type('{enter}')
cy.get('a').contains(clientName).click({ force: true })
this.selectTab('Roles')
cy.contains('Add Role').click()
cy.get(this.createRoleBtn).click()
cy.get(this.roleNameTextField).type(roleName)
cy.contains('Save').click()
cy.wait(4000)
cy.get(this.saveBtn).click()
}
}

Expand Down
20 changes: 8 additions & 12 deletions e2e/cypress/pageObjects/keycloakGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,20 @@ class keycloakGroupPage {
path: string = '/'

groupTab: string = '[data-ng-controller="GroupTabCtrl"]'
attributeKey: string = '[ng-model="newAttribute.key"]'
attributeValue: string = '[ng-model="newAttribute.value"]'
addAttributeBtn: string = '[data-ng-click="addAttribute()"]'
addAttributeKey: string = '[data-testid="attributes-add-row"]'
attributeKey: string = '[data-testid="attributes-key"]'
attributeValue: string = '[data-testid="attributes-value"]'
saveBtn: string = '[data-testid="attributes-save"]'

selectTab(tabName: string){
cy.get(this.groupTab).contains('a',tabName).click()
}

setAttribute(attKey: string, attValue: string){
cy.wait(2000)
cy.get(this.attributeKey).type(attKey)
cy.get(this.attributeValue).type(attValue)
cy.get(this.addAttributeBtn).click()
cy.contains('button','Save').click()
}

navigateToUserGroups() {
cy.contains('Groups').click()
cy.get(this.addAttributeKey).click()
cy.get(this.attributeKey).last().type(attKey)
cy.get(this.attributeValue).last().type(attValue)
cy.get(this.saveBtn).click()
}
}

Expand Down
11 changes: 1 addition & 10 deletions e2e/cypress/pageObjects/keycloakUserGroup.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,8 @@
class KeycloakUserGroupPage {
path: string = '/'

editButton: string = '[id="editGroup"]'
groupTab: string = '[data-ng-controller="GroupTabCtrl"]'
attributeTab: string = '[data-testid="attributesTab"]'

selectTab(tabName: string){
cy.get(this.groupTab).contains('a',tabName).click()
}

clickOnEditButton()
{
cy.get(this.editButton).click()
}
}

export default KeycloakUserGroupPage
25 changes: 13 additions & 12 deletions e2e/cypress/pageObjects/keycloakUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,32 @@ class keycloakUsersPage {

path: string = '/'

userNameTxt: string = '[placeholder="Search..."]'
userSearch: string = '[id="userSearch"]'
userSearchInput: string = '[data-testid="table-search-input"]'
userTab: string = '[data-ng-controller="UserTabCtrl"]'
groupsTab: string = '[data-testid="user-groups-tab"]'


selectTab(tabName: string) {
cy.get(this.userTab).contains('a', tabName).click()
}

editUser(userName: string) {
cy.get(this.userNameTxt).type(userName)
cy.get(this.userSearch).click()
cy.wait(1000)
cy.contains('Edit').click()
cy.get(this.userSearchInput).type(userName).type('{enter}')
cy.get('a').contains(userName).click({ force: true })
}

setUserToOrganization(orgName: string) {
cy.contains(orgName).click()
cy.contains('Join').click()
cy.contains('Join Group').click()
cy.get('input[placeholder="Search group"]').type(orgName).type('{enter}')
cy.get(`input[data-testid="${orgName}-check"]`).click()
cy.get('[data-testid="join-button"]').click()
}

resetAssociation() {
cy.get('[data-ng-click="membershipTree.selectNodeLabel(node)"]').click()
cy.contains('Leave').click({force:true})
leaveGroup(orgName: string) {
cy.get(`[data-testid="leave-${orgName}"]`).click()
cy.get('[data-testid="confirm"]').click()
}

}

export default keycloakUsersPage
Loading
Loading