Skip to content

Commit 23a447e

Browse files
KasinhouMatus Kasak
andauthored
UI tests for each customer (#865)
* Playright after deploy running here * Using different token * Corrected path in copying json file * Checkout only branch in UI tests not master * Added copilot changes --------- Co-authored-by: Matus Kasak <matus.kasak@dataquest.sk>
1 parent cc18e5f commit 23a447e

2 files changed

Lines changed: 35 additions & 27 deletions

File tree

.github/workflows/deploy.yml

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -150,41 +150,39 @@ jobs:
150150
docker exec $DNAME /bin/bash -c "cd /dspace/bin && ./dspace healthcheck -v"
151151
152152
playwright-after-deploy8:
153-
runs-on: ubuntu-latest
153+
runs-on: dspace-test-1
154154
needs: deploy-8
155155
timeout-minutes: 45
156156
if: '!inputs.IMPORT'
157157
steps:
158-
- name: run playwright
159-
run: |
160-
# wait until FE stabilizes a bit
161-
sleep 3m
162-
163-
curl -H "Accept: application/vnd.github.everest-preview+json" \
164-
-H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" \
165-
--request POST \
166-
https://api.github.com/repos/dataquest-dev/\
167-
dspace-ui-tests/actions/workflows/cron-test.yml/dispatches \
168-
--data "{\"ref\":\"refs/heads/master\"}" 2> /dev/null
158+
- name: Checkout Playwright tests
159+
uses: actions/checkout@v4
160+
with:
161+
repository: dataquest-dev/dspace-ui-tests
162+
path: dspace-ui-tests
163+
token: ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}
169164

170-
# wait for it to start
171-
sleep 30s
165+
- name: Checkout main repository
166+
uses: actions/checkout@v4
167+
with:
168+
path: this-repository
172169

173-
# get result of last job
174-
RES=$(curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" https://api.github.com/repos/dataquest-dev/dspace-ui-tests/actions/workflows/cron-test.yml/runs?per_page=1 2> /dev/null | jq .workflow_runs[0].conclusion)
170+
- name: Copy customer config to UI tests repository for merging
171+
run: |
172+
cp this-repository/config/config.lindat.ui.tests.json dspace-ui-tests/customer-constants/
175173
176-
# while job did not finish, sleep
177-
while [[ $RES == 'null' ]]; do
178-
sleep 10s
179-
RES=$(curl -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${{ secrets.DEPLOY_DEV5_GH_ACTION_DISPATCH }}" https://api.github.com/repos/dataquest-dev/dspace-ui-tests/actions/workflows/cron-test.yml/runs?per_page=1 2> /dev/null | jq .workflow_runs[0].conclusion)
180-
done;
174+
- name: test
175+
working-directory: dspace-ui-tests/scripts
176+
env:
177+
HOME_URL: https://dev-5.pc:8443/repository/
178+
NAME: LINDAT
179+
run: |
180+
./test.sh
181181
182-
echo $RES
183-
# if last result is not success, return -1 and fail
184-
if [[ $RES != \"success\" ]]; then
185-
echo "playwright tests have failed! check appropriate action run in the dspace-ui-tests repository"
186-
exit 1
187-
fi;
182+
- uses: mazoea/ga-maz/end@master
183+
with:
184+
CHOWN_DIR: ./
185+
if: ${{ always() }}
188186

189187
rest-tests-after-deploy8:
190188
runs-on: ubuntu-latest

config/config.lindat.ui.tests.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"locators": {
3+
"title": "LINDAT/CLARIAH-CZ Repository Home"
4+
},
5+
"urls": {
6+
"oaipmh_response": "https://dev-5.pc:8443/repository/server/oai/request?verb=ListRecords&metadataPrefix=oai_dc",
7+
"redirect_to_login": "https://dev-5.pc:8443/repository/login?redirectUrl=http:%2F%2Fdev-5.pc:82%2Fhome",
8+
"not_exposed_data": "https://dev-5.pc:8443/repository/server/oai/request?verb=GetRecord&metadataPrefix=cmdi&identifier=oai:dev-5.pc:20.500.12800/1-4740"
9+
}
10+
}

0 commit comments

Comments
 (0)