From 52bd41987aac56c33c80f59a3484fda2da5b4e08 Mon Sep 17 00:00:00 2001 From: Ayush <54752747+ayush-AI@users.noreply.github.com> Date: Sun, 6 Aug 2023 00:13:21 +0530 Subject: [PATCH 1/3] (test) O3-2292: Add tests for encounter-observations (#772) --- .../encounter-observations.test.tsx | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 packages/esm-active-visits-app/src/visits-summary/visits-components/encounter-observations.test.tsx diff --git a/packages/esm-active-visits-app/src/visits-summary/visits-components/encounter-observations.test.tsx b/packages/esm-active-visits-app/src/visits-summary/visits-components/encounter-observations.test.tsx new file mode 100644 index 0000000000..0dffa88337 --- /dev/null +++ b/packages/esm-active-visits-app/src/visits-summary/visits-components/encounter-observations.test.tsx @@ -0,0 +1,36 @@ +import React from 'react'; +import { render, screen } from '@testing-library/react'; +import EncounterObservations from './encounter-observations.component'; + +describe('EncounterObservations', () => { + test('renders skeleton text while loading', () => { + render(); + + expect(screen.queryByText('Temperature')).not.toBeInTheDocument(); + }); + + test('renders "No observations found" message when observations list is empty', () => { + const emptyObservations = []; + render(); + + expect(screen.getByText('No observations found')).toBeInTheDocument(); + }); + + test('renders observations list correctly', () => { + const observations = [ + { display: 'Temperature: 98.6°F' }, + { display: 'Blood Pressure: 120/80 mmHg' }, + { display: 'Heart Rate: 72 bpm' }, + ]; + render(); + + expect(screen.getByText('Temperature:')).toBeInTheDocument(); + expect(screen.getByText('98.6°F')).toBeInTheDocument(); + + expect(screen.getByText('Blood Pressure:')).toBeInTheDocument(); + expect(screen.getByText('120/80 mmHg')).toBeInTheDocument(); + + expect(screen.getByText('Heart Rate:')).toBeInTheDocument(); + expect(screen.getByText('72 bpm')).toBeInTheDocument(); + }); +}); From 012ca1246d8189db3622d070f703829a2aa89b45 Mon Sep 17 00:00:00 2001 From: Piumal Rathnayake Date: Mon, 7 Aug 2023 18:44:22 +0530 Subject: [PATCH 2/3] O3-2309: Implement dynamic frontend docker images for e2e test (#765) * Dynamic frontend Docker image for e2e test * Change directory * Fix tests * Update e2e/support/github/run-e2e-docker-env.sh Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com> * Update e2e/support/github/Dockerfile Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com> * Fix the port numbers * Remove unwanted MFs * Remove unwanted MFs * Remove unwanted MFs * Remove unwanted MFs * Remove unwanted MFs * Test only with login and home apps * Test with navigation, chart and home apps * (Breaking) Revert the changes related to #763 --------- Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com> --- .github/workflows/e2e.yml | 45 +++-- e2e/support/github/Dockerfile | 34 ++++ e2e/support/github/docker-compose.yml | 14 +- e2e/support/github/run-e2e-docker-env.sh | 49 +++++ yarn.lock | 223 ++++++++++++----------- 5 files changed, 241 insertions(+), 124 deletions(-) create mode 100644 e2e/support/github/Dockerfile create mode 100644 e2e/support/github/run-e2e-docker-env.sh diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 3e02fceded..3a5ae08345 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -12,19 +12,18 @@ jobs: testOnPR: if: ${{ github.event_name == 'pull_request' }} runs-on: ubuntu-latest + timeout-minutes: 60 steps: - name: Checkout repo uses: actions/checkout@v3 - name: Copy test environment variables - run: | - cp example.env .env - sed -i 's/8080/8180/g' .env + run: cp example.env .env - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: "18.x" - name: Cache dependencies id: cache @@ -40,12 +39,22 @@ jobs: - name: Install Playwright Browsers run: npx playwright install chromium --with-deps + - name: Build apps + run: yarn turbo run build --color --concurrency=5 + - name: Run dev server - run: yarn start --sources 'packages/esm-*-app/' --port 8180 & # Refer to O3-1994 + run: bash e2e/support/github/run-e2e-docker-env.sh + + - name: Wait for OpenMRS instance to start + run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/openmrs/login.htm)" != "200" ]]; do sleep 10; done - name: Run E2E tests run: yarn playwright test + - name: Stop dev server + if: "!cancelled()" + run: docker stop $(docker ps -a -q) + - name: Upload Report uses: actions/upload-artifact@v3 if: always() @@ -56,21 +65,19 @@ jobs: testOnPush: if: ${{ github.event_name == 'push' }} - timeout-minutes: 60 runs-on: ubuntu-latest + timeout-minutes: 60 steps: - name: Checkout repo uses: actions/checkout@v3 - name: Copy test environment variables - run: | - cp example.env .env - sed -i 's/8080/8180/g' .env + run: cp example.env .env - name: Setup node uses: actions/setup-node@v3 with: - node-version: 16 + node-version: "18.x" - name: Cache dependencies id: cache @@ -86,20 +93,22 @@ jobs: - name: Install Playwright Browsers run: npx playwright install chromium --with-deps - - name: Run db and web containers - run: | - cd e2e/support/github - docker-compose up -d - - - name: Wait for OpenMRS instance to start - run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:9000/openmrs/login.htm)" != "200" ]]; do sleep 10; done + - name: Build apps + run: yarn turbo run build --color --concurrency=5 - name: Run dev server - run: yarn start --sources 'packages/esm-*-app/' --backend "http://localhost:9000" --port 8180 & # Refer to O3-1994 + run: bash e2e/support/github/run-e2e-docker-env.sh + + - name: Wait for OpenMRS instance to start + run: while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' http://localhost:8080/openmrs/login.htm)" != "200" ]]; do sleep 10; done - name: Run E2E tests run: yarn playwright test + - name: Stop dev server + if: "!cancelled()" + run: docker stop $(docker ps -a -q) + - name: Upload report uses: actions/upload-artifact@v3 if: always() diff --git a/e2e/support/github/Dockerfile b/e2e/support/github/Dockerfile new file mode 100644 index 0000000000..6823603219 --- /dev/null +++ b/e2e/support/github/Dockerfile @@ -0,0 +1,34 @@ +# syntax=docker/dockerfile:1.3 +FROM --platform=$BUILDPLATFORM node:18-alpine as dev + +ARG APP_SHELL_VERSION=next + +RUN mkdir -p /app +WORKDIR /app + +COPY . . + +RUN npm_config_legacy_peer_deps=true npm install -g openmrs@${APP_SHELL_VERSION:-next} +ARG CACHE_BUST +RUN npm_config_legacy_peer_deps=true openmrs assemble --manifest --mode config --config spa-assemble-config.json --target ./spa + +FROM --platform=$BUILDPLATFORM openmrs/openmrs-reference-application-3-frontend:nightly as frontend +FROM nginx:1.23-alpine + +RUN apk update && \ + apk upgrade && \ + # add more utils for sponge to support our startup script + apk add --no-cache moreutils + +# clear any default files installed by nginx +RUN rm -rf /usr/share/nginx/html/* + +COPY --from=frontend /etc/nginx/nginx.conf /etc/nginx/nginx.conf +# this assumes that NOTHING in the framework is in a subdirectory +COPY --from=frontend /usr/share/nginx/html/* /usr/share/nginx/html/ +COPY --from=frontend /usr/local/bin/startup.sh /usr/local/bin/startup.sh +RUN chmod +x /usr/local/bin/startup.sh + +COPY --from=dev /app/spa/ /usr/share/nginx/html/ + +CMD ["/usr/local/bin/startup.sh"] diff --git a/e2e/support/github/docker-compose.yml b/e2e/support/github/docker-compose.yml index 23c3b5a43e..0c49fd169e 100644 --- a/e2e/support/github/docker-compose.yml +++ b/e2e/support/github/docker-compose.yml @@ -2,6 +2,18 @@ version: "3.7" services: + gateway: + image: openmrs/openmrs-reference-application-3-gateway:${TAG:-nightly} + ports: + - "8080:80" + + frontend: + build: + context: . + environment: + SPA_PATH: /openmrs/spa + API_URL: /openmrs + backend: image: openmrs/openmrs-reference-application-3-backend:${TAG:-nightly} depends_on: @@ -19,8 +31,6 @@ services: timeout: 5s volumes: - openmrs-data:/openmrs/data - ports: - - 9000:8080 # MariaDB db: diff --git a/e2e/support/github/run-e2e-docker-env.sh b/e2e/support/github/run-e2e-docker-env.sh new file mode 100644 index 0000000000..69c62f9dbc --- /dev/null +++ b/e2e/support/github/run-e2e-docker-env.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash -eu + +# get the dir containing the script +script_dir=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) +# create a temporary working directory +working_dir=$(mktemp -d "${TMPDIR:-/tmp/}openmrs-e2e-frontends.XXXXXXXXXX") +# get a list of all the apps in this workspace +apps=$(yarn workspaces list --json | jq -r 'if ((.location == ".") or (.location | test("-app") | not)) then halt else .name end') +# this array will hold all of the packed app names +app_names=() + +echo "Creating packed archives of apps..." +# for each app +for app in $apps +do + # @openmrs/esm-whatever -> _openmrs_esm_whatever + app_name=$(echo "$app" | tr '[:punct:]' '_'); + # add to our array + app_names+=("$app_name.tgz"); + # run yarn pack for our app and add it to the working directory + yarn workspace "$app" pack -o "$working_dir/$app_name.tgz" >/dev/null; +done; +echo "Created packed app archives" + +echo "Creating dynamic spa-assemble-config.json..." +# dynamically assemble our list of frontend modules, prepending the login app and +# primary navigation apps; apps will all be in the /app directory of the Docker +# container +jq -n \ + --arg apps "$apps" \ + --arg app_names "$(echo ${app_names[@]})" \ + '{"@openmrs/esm-primary-navigation-app": "next", "@openmrs/esm-home-app": "next", "@openmrs/esm-patient-chart-app": "next"} + ( + ($apps | split("\n")) as $apps | ($app_names | split(" ") | map("/app/" + .)) as $app_files + | [$apps, $app_files] + | transpose + | map({"key": .[0], "value": .[1]}) + | from_entries + )' | jq '{"frontendModules": .}' > "$working_dir/spa-assemble-config.json" +echo "Created dynamic spa-assemble-config.json" + +echo "Copying Docker configuration..." +cp "$script_dir/Dockerfile" "$working_dir/Dockerfile" +cp "$script_dir/docker-compose.yml" "$working_dir/docker-compose.yml" + +cd $working_dir +echo "Starting Docker containers..." +# CACHE_BUST to ensure the assemble step is always run +docker compose build --build-arg CACHE_BUST=$(date +%s) frontend +docker compose up -d diff --git a/yarn.lock b/yarn.lock index ffc4312628..2df23a3df6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3551,27 +3551,27 @@ __metadata: languageName: unknown linkType: soft -"@openmrs/esm-api@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-api@npm:5.0.3-pre.846" +"@openmrs/esm-api@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-api@npm:5.1.1-pre.922" dependencies: "@types/fhir": 0.0.31 lodash-es: ^4.17.21 peerDependencies: - "@openmrs/esm-config": 4.x - "@openmrs/esm-error-handling": 4.x - "@openmrs/esm-offline": 4.x - checksum: 66e02f30e4a30536d835dc8630cc9e3d7866330e57bedc7cc629bf338b30558a51b03980ce19b7e83eba35011f57edcaf28e8e01c102f47e407f3d06b8043349 + "@openmrs/esm-config": 5.x + "@openmrs/esm-error-handling": 5.x + "@openmrs/esm-offline": 5.x + checksum: 0c6924f74e1eebbbf3f632554c78078f7684c3f078e6499ab15c8f01bdfde20db48548a2712ad4bf4298cfb1ee93f019dfb75956e1e8c096c82528b6c5360c53 languageName: node linkType: hard -"@openmrs/esm-app-shell@npm:5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-app-shell@npm:5.0.3-pre.846" +"@openmrs/esm-app-shell@npm:5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-app-shell@npm:5.1.1-pre.922" dependencies: "@carbon/react": ^1.12.0 - "@openmrs/esm-framework": 5.0.3-pre.846 - "@openmrs/esm-styleguide": 5.0.3-pre.846 + "@openmrs/esm-framework": 5.1.1-pre.922 + "@openmrs/esm-styleguide": 5.1.1-pre.922 dayjs: ^1.10.4 dexie: ^3.0.3 html-webpack-plugin: ^5.5.0 @@ -3595,7 +3595,7 @@ __metadata: workbox-strategies: ^6.1.5 workbox-webpack-plugin: ^6.1.5 workbox-window: ^6.1.5 - checksum: d2630dc61cbcd26345a2685b9b52ec3744807e703a8af2341ffc7c48d7b5a9d06d7071fef86976fa24e33e3b5f737e517c8b30a18c493e01e7b283fd6944b400 + checksum: 43615699b28524ce7e72fd7ee613e1a54d08cacd27452ebb4947d270ace10af9ce712cadc2b361c6b779ae9f7fbd3a305ea59ffdec443ad6f503bece26f78f82 languageName: node linkType: hard @@ -3616,78 +3616,93 @@ __metadata: languageName: unknown linkType: soft -"@openmrs/esm-breadcrumbs@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-breadcrumbs@npm:5.0.3-pre.846" +"@openmrs/esm-breadcrumbs@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-breadcrumbs@npm:5.1.1-pre.922" dependencies: path-to-regexp: 6.1.0 peerDependencies: - "@openmrs/esm-state": 4.x - checksum: 80fe62635efe320dfd6e74f1f6d4730bf627f3451888d5b78951100868581aca922cad8bb7b3e4ac6f2068e6af55157a23ec1bf81f659720f33ff75a05cd76e1 + "@openmrs/esm-state": 5.x + checksum: a71a76bb8900e0f38849ed5fb390f4ced805e44bf17263060510e87d74e9225fcc3a11fc385e83801fa7d9eb69c0bf0aaa90d9bf6c377b28275c492e052a1ff5 languageName: node linkType: hard -"@openmrs/esm-config@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-config@npm:5.0.3-pre.846" +"@openmrs/esm-config@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-config@npm:5.1.1-pre.922" dependencies: ramda: ^0.26.1 peerDependencies: - "@openmrs/esm-globals": 4.x - "@openmrs/esm-state": 4.x + "@openmrs/esm-globals": 5.x + "@openmrs/esm-state": 5.x single-spa: 5.x - checksum: 208c1fddc6af6ca2499b4881f9a16cd279ea3ef264b82cdde0c7abfb7d55530c768d42abc1f3aa10eaecb405995fb8e03bc028c461f2464b14ad9bf9d9420486 + checksum: 89f2a61c5d10cef335330c73563651acd1d033d878c709d173c139cd84f2a274bdc1876077d136a262917053d669fe722f2c9656aa6471dec9e4a33d955e1912 languageName: node linkType: hard -"@openmrs/esm-dynamic-loading@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-dynamic-loading@npm:5.0.3-pre.846" +"@openmrs/esm-dynamic-loading@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-dynamic-loading@npm:5.1.1-pre.922" peerDependencies: - "@openmrs/esm-globals": 4.x - checksum: a71098117aef13d19a04d6871c49c1531ca105d032adbf64fd23604c8e4bd27c7adb467a27b809ea46351f4e8030a55afcebb0a4219808d0dcad84668550d31b + "@openmrs/esm-globals": 5.x + checksum: a6a89dc8d2c8a27695985587dd2b93e7585add3a3d04dc07e2646b4afa974fa606048d4e39c503ba95d19f4e5fe5eb4366e70d0a457203d1394db6901755a023 languageName: node linkType: hard -"@openmrs/esm-error-handling@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-error-handling@npm:5.0.3-pre.846" +"@openmrs/esm-error-handling@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-error-handling@npm:5.1.1-pre.922" peerDependencies: - "@openmrs/esm-globals": 4.x - checksum: c899aa829383e739b575c0428291966cab87b6a16b86beb56d8a2654ac17c329c2018a9542d7e1dbadaa55163b1380f81fab821784da8839180e72385c708142 + "@openmrs/esm-globals": 5.x + checksum: 5dd80bc2ae104deb487c25df512f0af93f1ea81b71d03c1f18c1955bfa458bad81cf27bb4f1ca72ccf51400eb49739839b45ae74a01b247adeba025ea967024b languageName: node linkType: hard -"@openmrs/esm-extensions@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-extensions@npm:5.0.3-pre.846" +"@openmrs/esm-extensions@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-extensions@npm:5.1.1-pre.922" dependencies: lodash-es: ^4.17.21 peerDependencies: - "@openmrs/esm-api": 4.x - "@openmrs/esm-config": 4.x - "@openmrs/esm-state": 4.x + "@openmrs/esm-api": 5.x + "@openmrs/esm-config": 5.x + "@openmrs/esm-feature-flags": 5.x + "@openmrs/esm-state": 5.x single-spa: 5.x - checksum: 258f08331703a4e688121f7106d92f0e9eaf1cf26d05fc549a2723c098d8519b82372b0d701052e6a5bd29e1ea340ed60f24bf4cd588b191060276790078571b - languageName: node - linkType: hard - -"@openmrs/esm-framework@npm:5.0.3-pre.846, @openmrs/esm-framework@npm:next": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-framework@npm:5.0.3-pre.846" - dependencies: - "@openmrs/esm-api": ^5.0.3-pre.846 - "@openmrs/esm-breadcrumbs": ^5.0.3-pre.846 - "@openmrs/esm-config": ^5.0.3-pre.846 - "@openmrs/esm-dynamic-loading": ^5.0.3-pre.846 - "@openmrs/esm-error-handling": ^5.0.3-pre.846 - "@openmrs/esm-extensions": ^5.0.3-pre.846 - "@openmrs/esm-globals": ^5.0.3-pre.846 - "@openmrs/esm-offline": ^5.0.3-pre.846 - "@openmrs/esm-react-utils": ^5.0.3-pre.846 - "@openmrs/esm-state": ^5.0.3-pre.846 - "@openmrs/esm-styleguide": ^5.0.3-pre.846 - "@openmrs/esm-utils": ^5.0.3-pre.846 + checksum: 8eb9b929d9aafe9e1919635d14d18ca8535343405f8c18fdfaf84ffbcd121b441bc69498dbdd087469db0ea10f83dd7821340b61a22b262085568a3c73d80b74 + languageName: node + linkType: hard + +"@openmrs/esm-feature-flags@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-feature-flags@npm:5.1.1-pre.922" + dependencies: + ramda: ^0.26.1 + peerDependencies: + "@openmrs/esm-globals": 5.x + "@openmrs/esm-state": 5.x + single-spa: 5.x + checksum: 57b942dda4e3fdbd22874a00b4f24915ec6c2cb9c60e2194c62a011b564e2910cd63ba9402399a717021472749483f84cd71a96b2dd7d1f69832ddebd9f80f36 + languageName: node + linkType: hard + +"@openmrs/esm-framework@npm:5.1.1-pre.922, @openmrs/esm-framework@npm:next": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-framework@npm:5.1.1-pre.922" + dependencies: + "@openmrs/esm-api": ^5.1.1-pre.922 + "@openmrs/esm-breadcrumbs": ^5.1.1-pre.922 + "@openmrs/esm-config": ^5.1.1-pre.922 + "@openmrs/esm-dynamic-loading": ^5.1.1-pre.922 + "@openmrs/esm-error-handling": ^5.1.1-pre.922 + "@openmrs/esm-extensions": ^5.1.1-pre.922 + "@openmrs/esm-feature-flags": ^5.1.1-pre.922 + "@openmrs/esm-globals": ^5.1.1-pre.922 + "@openmrs/esm-offline": ^5.1.1-pre.922 + "@openmrs/esm-react-utils": ^5.1.1-pre.922 + "@openmrs/esm-state": ^5.1.1-pre.922 + "@openmrs/esm-styleguide": ^5.1.1-pre.922 + "@openmrs/esm-utils": ^5.1.1-pre.922 dayjs: ^1.10.7 peerDependencies: dayjs: 1.x @@ -3697,34 +3712,34 @@ __metadata: react-i18next: 11.x rxjs: 6.x single-spa: 5.x - checksum: a6a844e7dc3f734122b291768ead75767f27482cb399d47a09c885c8054e5747d31f3c92dc1b1ea6f74bfb64ea167b5f79fe14220ece8f5929298c6cbac40dee + checksum: 2140dc6d36e82bb3faf6b8adae6c5d563b595670e11e70a19fbfc2548bc3bf65bff6d4a0d6ab2f635ef3fd1368c6f50184068eef53e1336b4d53def06b2c9cc3 languageName: node linkType: hard -"@openmrs/esm-globals@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-globals@npm:5.0.3-pre.846" +"@openmrs/esm-globals@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-globals@npm:5.1.1-pre.922" peerDependencies: single-spa: 5.x - checksum: b19eaf9145adf6377ab43ad218bd13c506f101520b92fc9f0cda75ed40a00955a5c16f3777ffd47155e613625fc7d7db012c8e15c824afed0ff8cd85f481e72c + checksum: 4f86ae423f3e6e1a0cdab712e0f46942c638d395681ebacda8c72b4305439c85d38fecdea4d2d681c49429a4bae9567aa1e528114b2166acc31e04f54ccf5a22 languageName: node linkType: hard -"@openmrs/esm-offline@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-offline@npm:5.0.3-pre.846" +"@openmrs/esm-offline@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-offline@npm:5.1.1-pre.922" dependencies: dexie: ^3.0.3 lodash-es: ^4.17.21 uuid: ^9.0.0 workbox-window: ^6.1.5 peerDependencies: - "@openmrs/esm-api": 4.x - "@openmrs/esm-globals": 4.x - "@openmrs/esm-state": 4.x - "@openmrs/esm-styleguide": 4.x + "@openmrs/esm-api": 5.x + "@openmrs/esm-globals": 5.x + "@openmrs/esm-state": 5.x + "@openmrs/esm-styleguide": 5.x rxjs: 6.x - checksum: ab4325e53794d8f70db0569086aa405a0f9194ea771d78540208755f244e146182b5ae40286152e8446490fd4214d91f1a660973fc852660db9f2d694a7f3aaa + checksum: 55650559828e64eebe84b67de1218b822b64f0a119faf9414fd5017a0a2361772070f33ebf98c914a24915c1c886d12a941602a53acb2238010042fa85c5cb62 languageName: node linkType: hard @@ -3857,70 +3872,70 @@ __metadata: languageName: unknown linkType: soft -"@openmrs/esm-react-utils@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-react-utils@npm:5.0.3-pre.846" +"@openmrs/esm-react-utils@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-react-utils@npm:5.1.1-pre.922" dependencies: lodash-es: ^4.17.21 single-spa-react: ~5.0.0 swr: ^2.0.1 peerDependencies: - "@openmrs/esm-api": 4.x - "@openmrs/esm-config": 4.x - "@openmrs/esm-error-handling": 4.x - "@openmrs/esm-extensions": 4.x - "@openmrs/esm-globals": 4.x + "@openmrs/esm-api": 5.x + "@openmrs/esm-config": 5.x + "@openmrs/esm-error-handling": 5.x + "@openmrs/esm-extensions": 5.x + "@openmrs/esm-globals": 5.x dayjs: 1.x i18next: 19.x react: 18.x react-dom: 18.x react-i18next: 11.x - checksum: 6aade00f8031216485ca05533b4777258c9e9b623ac2e2494356e26d093946b89e3026a871fc8eb1e8c1be07d39a2dce0f76e5fb3026e6b3e51c52014a1b0593 + checksum: 5031672d9d4431f873ac3cf19709ee5fca2a195e3c1581ccae58927ff5d6649a852b568ca408b777d631b5868b3d54f630a785c952d0298451ddef7f78032f5a languageName: node linkType: hard -"@openmrs/esm-state@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-state@npm:5.0.3-pre.846" +"@openmrs/esm-state@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-state@npm:5.1.1-pre.922" dependencies: zustand: ^4.3.6 - checksum: 396d85fe53f81c3695848d72f04f2e39bd2a71997417653e86cfb6f679a1f1559821c6484bdde3f70b26873f615344edcd1eac1974650da8c39636cfcd9b64ca + checksum: bea9adbecfd8a6b1b7296cce21612ebf70d0423dceee040be15da82106c10b93f9218e7c8886e72be1b13b2c8f6730e16c255d63bb3a05e417b620648b3ec6b1 languageName: node linkType: hard -"@openmrs/esm-styleguide@npm:5.0.3-pre.846, @openmrs/esm-styleguide@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-styleguide@npm:5.0.3-pre.846" +"@openmrs/esm-styleguide@npm:5.1.1-pre.922, @openmrs/esm-styleguide@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-styleguide@npm:5.1.1-pre.922" dependencies: "@carbon/charts": ^1.6.3 "@carbon/react": ^1.12.0 d3: ^7.8.0 lodash-es: ^4.17.21 peerDependencies: - "@openmrs/esm-framework": 4.x + "@openmrs/esm-framework": 5.x react: 18.x react-dom: 18.x rxjs: 6.x - checksum: 13c6ceeb1ced15bd2ca96be347d399a20a0e2a88de23f5670224a20f8b81e9afa8c86f28b14e6fbd8153917514a328d91a279b64cf006ca7b34af26fc41a419d + checksum: bc83f1d28bcb8aa62f79e0e1425ec4b2c976e89da20938049fa340a99183d645e5719d647cc8e6e58de7a6a10f5eb98b9d89ec2c73caa41db5e97ac5e1a90d31 languageName: node linkType: hard -"@openmrs/esm-utils@npm:^5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/esm-utils@npm:5.0.3-pre.846" +"@openmrs/esm-utils@npm:^5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/esm-utils@npm:5.1.1-pre.922" dependencies: semver: 7.3.2 peerDependencies: dayjs: 1.x i18next: 19.x rxjs: 6.x - checksum: a6a136d67f1aba88922b7e6f4bd64dbd77bac57df35ed54f580c4d016539d65fda8f03580684fbcb1b20ec5d413e12e4125857ec553531e7ac5896ac442add1b + checksum: f1077c5db3299b27b4f79c78ebe9fe8417a8f367b56fa8a8432c5cec0ddba3cbbfc4729ad490c422490bfdb1160cbe05e6c6240a846922e92111878ee694d814 languageName: node linkType: hard -"@openmrs/webpack-config@npm:5.0.3-pre.846": - version: 5.0.3-pre.846 - resolution: "@openmrs/webpack-config@npm:5.0.3-pre.846" +"@openmrs/webpack-config@npm:5.1.1-pre.922": + version: 5.1.1-pre.922 + resolution: "@openmrs/webpack-config@npm:5.1.1-pre.922" dependencies: "@swc/core": ^1.3.58 babel-preset-minify: ^0.5.1 @@ -3938,7 +3953,7 @@ __metadata: webpack-stats-plugin: ^1.0.3 peerDependencies: webpack: 5.x - checksum: 4f4a16d6114536e3c3ee2c90cef97e8c5f0448b0dd1f3bed693c6ceab03fbd3c75369371b9dfdb5f575ccdc4ebcac835545149ec39368c5d49dc257400476fc0 + checksum: 9b0f87a9a76d0df15e80186e95b68c462b26b8145f6c324b9bd2e7af7449b6c69569c3e3fd6a046704917fec1471aff41115c0097bb83d2401b71e36b13ba80b languageName: node linkType: hard @@ -15199,11 +15214,11 @@ __metadata: linkType: hard "openmrs@npm:next": - version: 5.0.3-pre.846 - resolution: "openmrs@npm:5.0.3-pre.846" + version: 5.1.1-pre.922 + resolution: "openmrs@npm:5.1.1-pre.922" dependencies: - "@openmrs/esm-app-shell": 5.0.3-pre.846 - "@openmrs/webpack-config": 5.0.3-pre.846 + "@openmrs/esm-app-shell": 5.1.1-pre.922 + "@openmrs/webpack-config": 5.1.1-pre.922 "@pnpm/npm-conf": ^2.1.0 "@swc/core": ^1.3.58 autoprefixer: ^10.4.2 @@ -15232,7 +15247,7 @@ __metadata: yargs: ^17.6.2 bin: openmrs: dist/cli.js - checksum: 10a7f9aee91ff868f99ac16319dae5b87300f72d7e52f97bb55d866f0d13c93ee10b36475af53c9a0a5954a07d980af1810347f4f925fcf6499ea3b63b214bc8 + checksum: cc174cd477f05b010b7c24ddcc49e628c0397947c462888f44adcd6a1cac1c72e1a58da6483c10eebcde859ece1a0a47865d3cbb4bc2d4f738da871e11c1f4d8 languageName: node linkType: hard From 4c9aca4a2273bcbe6ed1a10baeedc57983d1d82e Mon Sep 17 00:00:00 2001 From: Piumal Rathnayake Date: Mon, 7 Aug 2023 23:48:51 +0530 Subject: [PATCH 3/3] (fix) O3-2284: Fix failing patient registration test (#763) * (fix) O3-2284: Fix failing patient registration test * Increase expect timeout to 60 seconds * Increase expect timeout to 80 seconds * Try changing the starting script * Try changing the server * Revert Try changing the starting script * Change expect timeout to 60 seconds * Update e2e/commands/patient-operations.ts Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com> * Change the server to localhost --------- Co-authored-by: Dennis Kigen Co-authored-by: Ian <52504170+ibacher@users.noreply.github.com> Co-authored-by: Jayasanka Weerasinghe <33048395+jayasanka-sack@users.noreply.github.com> --- e2e/commands/patient-operations.ts | 4 ++-- e2e/pages/registration-and-edit-page.ts | 6 +++++- e2e/specs/edit-patient.spec.ts | 1 + e2e/specs/register-new-patient.spec.ts | 1 + 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/e2e/commands/patient-operations.ts b/e2e/commands/patient-operations.ts index 64002360b7..98d558bda0 100644 --- a/e2e/commands/patient-operations.ts +++ b/e2e/commands/patient-operations.ts @@ -76,8 +76,8 @@ export const generateRandomPatient = async (api: APIRequestContext): Promise value && locator.fill(value); formValues.sex && (await this.sexRadioButton(formValues.sex).check()); diff --git a/e2e/specs/edit-patient.spec.ts b/e2e/specs/edit-patient.spec.ts index 6ae0c153ec..50ad67470e 100644 --- a/e2e/specs/edit-patient.spec.ts +++ b/e2e/specs/edit-patient.spec.ts @@ -32,6 +32,7 @@ test('Edit a patient', async ({ page, api }) => { await test.step("When I visit the registration page to a patient's details", async () => { await patientEditPage.goto(patient.uuid); + await patientEditPage.waitUntilTheFormIsLoaded(); }); await test.step('And then I click on fill new values into the registration form and then click the `Submit` button', async () => { diff --git a/e2e/specs/register-new-patient.spec.ts b/e2e/specs/register-new-patient.spec.ts index f3bf62f9d8..377603f424 100644 --- a/e2e/specs/register-new-patient.spec.ts +++ b/e2e/specs/register-new-patient.spec.ts @@ -29,6 +29,7 @@ test('Register a new patient', async ({ page, api }) => { await test.step('When I visit the registration page', async () => { await patientRegistrationPage.goto(); + await patientRegistrationPage.waitUntilTheFormIsLoaded(); }); await test.step('And then I click on fill new values into the registration form and then click the `Submit` button', async () => {