-
Notifications
You must be signed in to change notification settings - Fork 4
Pepper 1251 playwright place an order in mercury #2412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Rinchan20
wants to merge
37
commits into
develop
Choose a base branch
from
pepper-1251-playwright-place-an-order-in-mercury
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
66c1857
WIP
Rinchan20 77f02ad
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 36ba812
putting in method to get relevant ptps
Rinchan20 c9eb0d1
in sequencing order tab
Rinchan20 cc32002
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 414dacf
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 bfbfb5b
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 fb683a5
continuing with placing a clinical order
Rinchan20 5571344
beginnings of placing a mercury order also installed gcp pubsub library
Rinchan20 0bbe6cb
ran npm audit fix to fix some vulnerabilities
Rinchan20 a106f63
placed mercury order and checking for the resulting order in Clinical…
Rinchan20 e03e40f
small fixes
Rinchan20 b8c5a2c
took out topic line
Rinchan20 36b7572
test for putting in mercury order for lost to followup pediatric ptp …
Rinchan20 103ac23
inputting test case for a lost to followup ptp whose residence is in …
Rinchan20 28c11bb
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 667f73c
adding LMS to test
Rinchan20 feb2e22
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 6a6d495
making changes to allow LMS to be used
Rinchan20 89143da
slight changes
Rinchan20 b9b6a9b
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 81adeef
get rid of empty method
Rinchan20 b00e788
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 acce255
cleanup
Rinchan20 88f4a47
got rid of space
Rinchan20 31085ef
more cleanup
Rinchan20 560f169
connecting to mercury info in vault
Rinchan20 e2b5faf
implement feedback
Rinchan20 bc42eec
decreasing intervals for waiting for expectToPass
Rinchan20 20890c8
adding expectToPass since it seems it might need it on a circleci run
Rinchan20 d7af043
checking if timing works better for circleci since it passes locally
Rinchan20 52b6429
adding more logging to try to find where test is failing in circleci
Rinchan20 0d30582
description change
Rinchan20 cb7b72d
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 cf0b52b
attempting to fix one pixel difference error
Rinchan20 ac69c59
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 b8c63e5
Merge branch 'develop' into pepper-1251-playwright-place-an-order-in-…
Rinchan20 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
141 changes: 141 additions & 0 deletions
141
playwright-e2e/tests/dsm/clinical-orders/place-clinical-order-in-mercury.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
import { expect, Locator } from '@playwright/test'; | ||
import { ParticipantListTable } from 'dsm/component/tables/participant-list-table'; | ||
import { CustomizeView, DataFilter, Label, Tab } from 'dsm/enums'; | ||
import { Navigation, Study, StudyName } from 'dsm/navigation'; | ||
import ParticipantListPage from 'dsm/pages/participant-list-page'; | ||
import ParticipantPage from 'dsm/pages/participant-page'; | ||
import SequeuncingOrderTab from 'dsm/pages/tablist/sequencing-order-tab'; | ||
import Select from 'dss/component/select'; | ||
import { test } from 'fixtures/dsm-fixture'; | ||
import { studyShortName } from 'utils/test-utils'; | ||
|
||
const pecgsStudies = [StudyName.OSTEO2]; //Checking OS2 first | ||
test.describe.serial('Verify that clinical orders can be placed in mercury @dsm @functional', () => { | ||
let navigation; | ||
let shortID; | ||
let participantPage: ParticipantPage; | ||
let sequencingOrderTab: SequeuncingOrderTab; | ||
let normalSample: Locator; | ||
let tumorSample: Locator; | ||
let previousLatestOrderNumber: string; | ||
|
||
for (const study of pecgsStudies) { | ||
test(`${study}: Verify a clinical order can be placed for a participant with Enrolled status`, async ({ page, request }) => { | ||
navigation = new Navigation(page, request); | ||
await new Select(page, { label: 'Select study' }).selectOption(study); | ||
|
||
const participantListPage = await navigation.selectFromStudy<ParticipantListPage>(Study.PARTICIPANT_LIST); | ||
await participantListPage.waitForReady(); | ||
const participantListTable = participantListPage.participantListTable; | ||
|
||
await test.step('Chose an enrolled participant that will get a clinical order placed', async () => { | ||
shortID = await findParticipantForGermlineSequencing({ | ||
enrollmentStatus: DataFilter.ENROLLED, | ||
participantList: participantListPage, | ||
participantTable: participantListTable, | ||
studyName: study | ||
}); | ||
|
||
await participantListPage.filterListByShortId(shortID); | ||
participantPage = await participantListTable.openParticipantPageAt({ position: 0 }); | ||
await participantPage.waitForReady(); | ||
}); | ||
|
||
await test.step('Make sure that the Sequencing Order tab is visible', async () => { | ||
await participantPage.tablist(Tab.SEQUENCING_ORDER).isVisible(); | ||
sequencingOrderTab = await participantPage.tablist(Tab.SEQUENCING_ORDER).click<SequeuncingOrderTab>(); | ||
await sequencingOrderTab.waitForReady(); | ||
}); | ||
|
||
await test.step('Place a clinical order using the Sequencing Order tab', async () => { | ||
normalSample = await sequencingOrderTab.getFirstAvailableNormalSample(); | ||
await sequencingOrderTab.selectSampleCheckbox(normalSample); | ||
|
||
tumorSample = await sequencingOrderTab.getFirstAvailableTumorSample(); | ||
await sequencingOrderTab.selectSampleCheckbox(tumorSample); | ||
|
||
await sequencingOrderTab.assertPlaceOrderButtonDisplayed(); | ||
await sequencingOrderTab.placeOrder(); | ||
|
||
await sequencingOrderTab.assertClinicalOrderModalDisplayed(); | ||
await sequencingOrderTab.submitClinicalOrder(); | ||
}); | ||
|
||
/* NOTE: Need to go from Participant Page -> Participant List -> (refresh) -> Participant Page in order to see the new info */ | ||
await test.step('Use the new Latest Order Number to place the order in mercury', async () => { | ||
//Verify that Latest Sequencing Order Date is the current date and Latest Order Number has received new input | ||
}); | ||
}) | ||
|
||
test(`${study}: Verify a clinical order can be placed for a participant with Lost-to-FollowUp status`, async ({ page, request }) => { | ||
navigation = new Navigation(page, request); | ||
await new Select(page, { label: 'Select study' }).selectOption(study); | ||
|
||
const participantListPage = await navigation.selectFromStudy<ParticipantListPage>(Study.PARTICIPANT_LIST); | ||
await participantListPage.waitForReady(); | ||
|
||
const participantListTable = participantListPage.participantListTable; | ||
}) | ||
} | ||
}) | ||
|
||
async function findParticipantForGermlineSequencing(opts: { | ||
enrollmentStatus: DataFilter.ENROLLED | DataFilter.LOST_TO_FOLLOWUP, | ||
participantList: ParticipantListPage, | ||
participantTable: ParticipantListTable, | ||
studyName: StudyName, | ||
usePediatricParticipant?: boolean, | ||
residenceInUSTerritory?: boolean | ||
}): Promise<string> { | ||
const { enrollmentStatus, participantList, participantTable, studyName, usePediatricParticipant = false, residenceInUSTerritory = false } = opts; | ||
|
||
const studyInformation = studyShortName(studyName); | ||
let participantPrefix = studyInformation.playwrightPrefixAdult; | ||
if (usePediatricParticipant) { | ||
participantPrefix = studyInformation.playwrightPrefixChild; | ||
} | ||
console.log(`prefix: ${participantPrefix}`); | ||
|
||
const customizeViewPanel = participantList.filters.customizeViewPanel; | ||
await customizeViewPanel.open(); | ||
await customizeViewPanel.selectColumns(CustomizeView.CLINICAL_ORDERS, [ | ||
Label.CLINICAL_ORDER_DATE, | ||
Label.CLINICAL_ORDER_ID, | ||
Label.CLINICAL_ORDER_PDO_NUMBER, | ||
Label.CLINICAL_ORDER_STATUS, | ||
Label.CLINICAL_ORDER_STATUS_DATE | ||
]); | ||
await customizeViewPanel.selectColumns(CustomizeView.CONTACT_INFORMATION, [Label.CITY, Label.COUNTRY]); | ||
await customizeViewPanel.close(); | ||
|
||
const searchPanel = participantList.filters.searchPanel; | ||
await searchPanel.open(); | ||
await searchPanel.text(Label.FIRST_NAME, { textValue: participantPrefix, additionalFilters: [DataFilter.EXACT_MATCH], exactMatch: false }); | ||
await searchPanel.checkboxes(Label.STATUS, { checkboxValues: [enrollmentStatus] }); | ||
await searchPanel.dates(Label.CLINICAL_ORDER_DATE, { additionalFilters: [DataFilter.NOT_EMPTY] }); | ||
await searchPanel.text(Label.CLINICAL_ORDER_ID, { additionalFilters: [DataFilter.NOT_EMPTY] }); | ||
|
||
if (residenceInUSTerritory) { | ||
//Location used: Yigo, Guam | ||
await searchPanel.text(Label.CITY, { textValue: 'YIGO' }); | ||
await searchPanel.text(Label.COUNTRY, { textValue: 'GU' }); | ||
} else { | ||
await searchPanel.text(Label.CITY, { textValue: 'CAMBRIDGE' }); | ||
await searchPanel.text(Label.COUNTRY, { textValue: 'US' }); | ||
} | ||
|
||
await searchPanel.search({ uri: 'filterList' }); | ||
|
||
const numberOfReturnedParticipants = await participantTable.getRowsCount(); | ||
expect(numberOfReturnedParticipants).toBeGreaterThanOrEqual(1); | ||
|
||
//Randomly chose a participant to get a clinical order who had previously had an order placed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reason for choosing a ptp who previously had an order placed: test is a bit smaller if it does not need to send+receive a kit and accession sm-ids |
||
const randomizedParticipantRows = await participantTable.randomizeRows(); | ||
const rowNumber = randomizedParticipantRows[0]; | ||
|
||
const shortID = await participantTable.getParticipantDataAt(rowNumber, Label.SHORT_ID); | ||
console.log(`Participant chosen for clinical order: ${shortID}`); | ||
|
||
return shortID; | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just moved things into alphabetical order