From a330e2bcd1302b3038445c60dea285d68ba41e35 Mon Sep 17 00:00:00 2001 From: Kathrin Koebel Date: Wed, 14 Aug 2024 15:53:38 +0545 Subject: [PATCH 01/10] renaming page object to match naming conventions --- tests/e2e/pageObjects/{DicomViewer.ts => dicomViewerPage.ts} | 2 +- tests/e2e/steps/dicomViewerContext.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename tests/e2e/pageObjects/{DicomViewer.ts => dicomViewerPage.ts} (98%) diff --git a/tests/e2e/pageObjects/DicomViewer.ts b/tests/e2e/pageObjects/dicomViewerPage.ts similarity index 98% rename from tests/e2e/pageObjects/DicomViewer.ts rename to tests/e2e/pageObjects/dicomViewerPage.ts index 103b1977..fcdfc071 100644 --- a/tests/e2e/pageObjects/DicomViewer.ts +++ b/tests/e2e/pageObjects/dicomViewerPage.ts @@ -1,7 +1,7 @@ import util from 'util' import { getUser } from '../userStore' -export class DicomViewer { +export class dicomViewerPage { elements: Readonly> = { userNameSelector: '#oc-login-username', passwordSelector: '#oc-login-password', diff --git a/tests/e2e/steps/dicomViewerContext.ts b/tests/e2e/steps/dicomViewerContext.ts index cd6e614d..912a49d2 100644 --- a/tests/e2e/steps/dicomViewerContext.ts +++ b/tests/e2e/steps/dicomViewerContext.ts @@ -3,9 +3,9 @@ import { expect } from '@playwright/test' import util from 'util' import { config } from '../config.js' -import { DicomViewer } from '../pageObjects/DicomViewer' +import { dicomViewerPage } from '../pageObjects/dicomViewerPage' -const dicomViewer = new DicomViewer() +const dicomViewer = new dicomViewerPage() import { apiUpload } from '../api/apiUpload' Given('the user {string} has logged in', async function (user: string): Promise { From abb93a4ffb6cf6cea02a5ed17d808cd23697013f Mon Sep 17 00:00:00 2001 From: Kathrin Koebel Date: Wed, 14 Aug 2024 15:56:34 +0545 Subject: [PATCH 02/10] fix typo in feature file --- tests/e2e/features/dicomViewer.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/features/dicomViewer.feature b/tests/e2e/features/dicomViewer.feature index 7f075516..00034f2e 100644 --- a/tests/e2e/features/dicomViewer.feature +++ b/tests/e2e/features/dicomViewer.feature @@ -6,7 +6,7 @@ Feature: Preview dicom image Scenario: user previews dicom image Given the dicom file "MRBRAIN.dcm" has been uploaded - And the user "Admin" has logged in + And the user "admin" has logged in When the user previews the dicom file "MRBRAIN.dcm" Then the user should see the dicom file "MRBRAIN.dcm" And the user should see patient name "MR/BRAIN/GRASE/1024" in the VIP metadata section From 760a8c6214966167cfe4f4d690ef8d6299f87418 Mon Sep 17 00:00:00 2001 From: Kathrin Koebel Date: Wed, 14 Aug 2024 15:58:34 +0545 Subject: [PATCH 03/10] rename apiHelper file to comply with naming conventions --- tests/e2e/api/{APIHelper.ts => apiHelper.ts} | 0 tests/e2e/api/apiUpload.ts | 2 +- tests/e2e/hooks.ts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename tests/e2e/api/{APIHelper.ts => apiHelper.ts} (100%) diff --git a/tests/e2e/api/APIHelper.ts b/tests/e2e/api/apiHelper.ts similarity index 100% rename from tests/e2e/api/APIHelper.ts rename to tests/e2e/api/apiHelper.ts diff --git a/tests/e2e/api/apiUpload.ts b/tests/e2e/api/apiUpload.ts index 72d7451f..3be9e42e 100644 --- a/tests/e2e/api/apiUpload.ts +++ b/tests/e2e/api/apiUpload.ts @@ -1,6 +1,6 @@ import fs from 'fs' import { config } from '../config.js' -import { sendRequest } from './APIHelper' +import { sendRequest } from './apiHelper' export const apiUpload = async function ({ filename }): Promise { const response = await sendRequest({ diff --git a/tests/e2e/hooks.ts b/tests/e2e/hooks.ts index bd73dfda..12efb4d5 100644 --- a/tests/e2e/hooks.ts +++ b/tests/e2e/hooks.ts @@ -3,7 +3,7 @@ import { chromium } from '@playwright/test' import { xml2js } from 'xml-js' import { _ } from 'lodash' import { config } from './config.js' -import { sendRequest } from './api/APIHelper' +import { sendRequest } from './api/apiHelper' setDefaultTimeout(config.timeout * 1000) From aa3a6ad4e7f33ce29e7e233ff08e1b18a3bf68e7 Mon Sep 17 00:00:00 2001 From: Kathrin Koebel Date: Wed, 14 Aug 2024 16:04:22 +0545 Subject: [PATCH 04/10] update wording of user story to match the user story given by project owner --- tests/e2e/features/dicomViewer.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/features/dicomViewer.feature b/tests/e2e/features/dicomViewer.feature index 00034f2e..1ada2950 100644 --- a/tests/e2e/features/dicomViewer.feature +++ b/tests/e2e/features/dicomViewer.feature @@ -1,7 +1,7 @@ Feature: Preview dicom image - As a user - I want to preview a DICOM file - so that I can preview DICOM image and its metadata + As a user who has a DICOM file + I want to preview the file + so that I can reassure that it contains the right image and check its metadata Scenario: user previews dicom image From 53cc50ef0ac818c5f3653c97eae8cd6f9914765b Mon Sep 17 00:00:00 2001 From: Kathrin Koebel Date: Tue, 20 Aug 2024 10:59:15 +0545 Subject: [PATCH 05/10] Apply suggestions from code review Co-authored-by: Phil Davis --- tests/e2e/features/dicomViewer.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/features/dicomViewer.feature b/tests/e2e/features/dicomViewer.feature index 1ada2950..59517703 100644 --- a/tests/e2e/features/dicomViewer.feature +++ b/tests/e2e/features/dicomViewer.feature @@ -1,7 +1,7 @@ Feature: Preview dicom image As a user who has a DICOM file I want to preview the file - so that I can reassure that it contains the right image and check its metadata + so that I can assure myself that it contains the right image and check its metadata Scenario: user previews dicom image From 133efbe4e88b7b82de20ffdaa704f2716d2ad8ee Mon Sep 17 00:00:00 2001 From: Kathrin Koebel Date: Wed, 14 Aug 2024 15:53:38 +0545 Subject: [PATCH 06/10] renaming page object to match naming conventions --- tests/e2e/pageObjects/{DicomViewer.ts => dicomViewerPage.ts} | 2 +- tests/e2e/steps/dicomViewerContext.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename tests/e2e/pageObjects/{DicomViewer.ts => dicomViewerPage.ts} (98%) diff --git a/tests/e2e/pageObjects/DicomViewer.ts b/tests/e2e/pageObjects/dicomViewerPage.ts similarity index 98% rename from tests/e2e/pageObjects/DicomViewer.ts rename to tests/e2e/pageObjects/dicomViewerPage.ts index 103b1977..fcdfc071 100644 --- a/tests/e2e/pageObjects/DicomViewer.ts +++ b/tests/e2e/pageObjects/dicomViewerPage.ts @@ -1,7 +1,7 @@ import util from 'util' import { getUser } from '../userStore' -export class DicomViewer { +export class dicomViewerPage { elements: Readonly> = { userNameSelector: '#oc-login-username', passwordSelector: '#oc-login-password', diff --git a/tests/e2e/steps/dicomViewerContext.ts b/tests/e2e/steps/dicomViewerContext.ts index cd6e614d..912a49d2 100644 --- a/tests/e2e/steps/dicomViewerContext.ts +++ b/tests/e2e/steps/dicomViewerContext.ts @@ -3,9 +3,9 @@ import { expect } from '@playwright/test' import util from 'util' import { config } from '../config.js' -import { DicomViewer } from '../pageObjects/DicomViewer' +import { dicomViewerPage } from '../pageObjects/dicomViewerPage' -const dicomViewer = new DicomViewer() +const dicomViewer = new dicomViewerPage() import { apiUpload } from '../api/apiUpload' Given('the user {string} has logged in', async function (user: string): Promise { From 5c8f1f35fddc2710b8a699b4d337ec16f9b3403c Mon Sep 17 00:00:00 2001 From: Kathrin Koebel Date: Wed, 14 Aug 2024 15:56:34 +0545 Subject: [PATCH 07/10] fix typo in feature file --- tests/e2e/features/dicomViewer.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/features/dicomViewer.feature b/tests/e2e/features/dicomViewer.feature index 7f075516..00034f2e 100644 --- a/tests/e2e/features/dicomViewer.feature +++ b/tests/e2e/features/dicomViewer.feature @@ -6,7 +6,7 @@ Feature: Preview dicom image Scenario: user previews dicom image Given the dicom file "MRBRAIN.dcm" has been uploaded - And the user "Admin" has logged in + And the user "admin" has logged in When the user previews the dicom file "MRBRAIN.dcm" Then the user should see the dicom file "MRBRAIN.dcm" And the user should see patient name "MR/BRAIN/GRASE/1024" in the VIP metadata section From cc2185c725ce54eac3894597f60a5d54f396d1d4 Mon Sep 17 00:00:00 2001 From: Kathrin Koebel Date: Wed, 14 Aug 2024 15:58:34 +0545 Subject: [PATCH 08/10] rename apiHelper file to comply with naming conventions --- tests/e2e/api/{APIHelper.ts => apiHelper.ts} | 0 tests/e2e/api/apiUpload.ts | 2 +- tests/e2e/hooks.ts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename tests/e2e/api/{APIHelper.ts => apiHelper.ts} (100%) diff --git a/tests/e2e/api/APIHelper.ts b/tests/e2e/api/apiHelper.ts similarity index 100% rename from tests/e2e/api/APIHelper.ts rename to tests/e2e/api/apiHelper.ts diff --git a/tests/e2e/api/apiUpload.ts b/tests/e2e/api/apiUpload.ts index 72d7451f..3be9e42e 100644 --- a/tests/e2e/api/apiUpload.ts +++ b/tests/e2e/api/apiUpload.ts @@ -1,6 +1,6 @@ import fs from 'fs' import { config } from '../config.js' -import { sendRequest } from './APIHelper' +import { sendRequest } from './apiHelper' export const apiUpload = async function ({ filename }): Promise { const response = await sendRequest({ diff --git a/tests/e2e/hooks.ts b/tests/e2e/hooks.ts index f6d61d23..59d0028c 100644 --- a/tests/e2e/hooks.ts +++ b/tests/e2e/hooks.ts @@ -3,7 +3,7 @@ import { chromium } from '@playwright/test' import { xml2js } from 'xml-js' import { _ } from 'lodash' import { config } from './config.js' -import { sendRequest } from './api/APIHelper' +import { sendRequest } from './api/apiHelper' setDefaultTimeout(config.timeout * 1000) From b078fec10b95b41e50d7c31d07620d55b92bebc7 Mon Sep 17 00:00:00 2001 From: Kathrin Koebel Date: Wed, 14 Aug 2024 16:04:22 +0545 Subject: [PATCH 09/10] update wording of user story to match the user story given by project owner --- tests/e2e/features/dicomViewer.feature | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/e2e/features/dicomViewer.feature b/tests/e2e/features/dicomViewer.feature index 00034f2e..1ada2950 100644 --- a/tests/e2e/features/dicomViewer.feature +++ b/tests/e2e/features/dicomViewer.feature @@ -1,7 +1,7 @@ Feature: Preview dicom image - As a user - I want to preview a DICOM file - so that I can preview DICOM image and its metadata + As a user who has a DICOM file + I want to preview the file + so that I can reassure that it contains the right image and check its metadata Scenario: user previews dicom image From af5f19a93b6bc00bf31f36cc2266960441ae793b Mon Sep 17 00:00:00 2001 From: Kathrin Koebel Date: Tue, 20 Aug 2024 10:59:15 +0545 Subject: [PATCH 10/10] Apply suggestions from code review Co-authored-by: Phil Davis --- tests/e2e/features/dicomViewer.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/e2e/features/dicomViewer.feature b/tests/e2e/features/dicomViewer.feature index 1ada2950..59517703 100644 --- a/tests/e2e/features/dicomViewer.feature +++ b/tests/e2e/features/dicomViewer.feature @@ -1,7 +1,7 @@ Feature: Preview dicom image As a user who has a DICOM file I want to preview the file - so that I can reassure that it contains the right image and check its metadata + so that I can assure myself that it contains the right image and check its metadata Scenario: user previews dicom image