-
Notifications
You must be signed in to change notification settings - Fork 486
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into issues/7403/fixed-rendering-mic-permissio…
…n-warning
- Loading branch information
Showing
21 changed files
with
239 additions
and
154 deletions.
There are no files selected for viewing
This file contains 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 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,59 @@ | ||
name: Create Release on Branch Push | ||
|
||
on: | ||
push: | ||
branches: | ||
- production | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
release: | ||
name: Release on Push | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Necessary to fetch all tags | ||
|
||
- name: Calculate next tag | ||
id: calc_tag | ||
run: | | ||
YEAR=$(date +"%y") | ||
WEEK=$(date +"%V") | ||
LAST_TAG=$(git tag -l "v$YEAR.$WEEK.*" | sort -V | tail -n1) | ||
LAST_TAG=$(echo "$LAST_TAG" | tr -d '\r' | sed 's/[[:space:]]*$//') | ||
echo "Last Tag: $LAST_TAG" | ||
if [[ $LAST_TAG == "" ]]; then | ||
MINOR=0 | ||
else | ||
MINOR=$(echo $LAST_TAG | awk -F '.' '{print $NF}') | ||
echo "Minor Version: $MINOR" | ||
MINOR=$((MINOR + 1)) | ||
fi | ||
TAG="v$YEAR.$WEEK.$MINOR" | ||
echo "TAG=$TAG" >> $GITHUB_ENV | ||
echo "Next Tag: $TAG" | ||
- name: Configure git | ||
run: | | ||
git config user.name github-actions | ||
git config user.email [email protected] | ||
- name: Create and push tag | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
git tag -a "$TAG" -m "Release $TAG" | ||
git push origin "$TAG" | ||
- name: Create release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh release create "$TAG" \ | ||
--repo="$GITHUB_REPOSITORY" \ | ||
--title="$TAG" \ | ||
--generate-notes \ | ||
--draft |
This file contains 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 was deleted.
Oops, something went wrong.
This file contains 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,117 @@ | ||
import { afterEach, before, beforeEach, cy, describe, it } from "local-cypress"; | ||
import LoginPage from "../../pageobject/Login/LoginPage"; | ||
import { PatientPage } from "../../pageobject/Patient/PatientCreation"; | ||
import { PatientFileUpload } from "../../pageobject/Patient/PatientFileupload"; | ||
const loginPage = new LoginPage(); | ||
const patientPage = new PatientPage(); | ||
const patientFileUpload = new PatientFileUpload(); | ||
|
||
function runTests(testDescription, visitPatientFileUploadSection) { | ||
describe(testDescription, () => { | ||
const cypressAudioName = "cypress audio"; | ||
const cypressFileName = "cypress name"; | ||
const newFileName = "cypress modified name"; | ||
const patientNameOne = "Dummy Patient 3"; | ||
const patientNameTwo = "Dummy Patient 4"; | ||
const patientNameThree = "Dummy Patient 5"; | ||
before(() => { | ||
loginPage.loginAsDisctrictAdmin(); | ||
cy.saveLocalStorage(); | ||
}); | ||
|
||
beforeEach(() => { | ||
cy.restoreLocalStorage(); | ||
cy.clearLocalStorage(/filters--.+/); | ||
cy.awaitUrl("/patients"); | ||
}); | ||
|
||
it("Record an Audio and download the file", () => { | ||
// Record an audio | ||
patientPage.visitPatient(patientNameOne); | ||
visitPatientFileUploadSection.call(patientFileUpload); | ||
patientFileUpload.recordAudio(); | ||
patientFileUpload.typeAudioName(cypressAudioName); | ||
patientFileUpload.clickUploadAudioFile(); | ||
// Verify the audio file is uploaded | ||
cy.verifyNotification("File Uploaded Successfully"); | ||
patientFileUpload.verifyUploadFilePresence(cypressAudioName); | ||
// Verify the download of the audio file | ||
cy.get("button").contains("DOWNLOAD").click(); | ||
cy.verifyNotification("Downloading file..."); | ||
}); | ||
|
||
it("Upload a File and archive it", () => { | ||
// Upload the file | ||
patientPage.visitPatient(patientNameTwo); | ||
visitPatientFileUploadSection.call(patientFileUpload); | ||
patientFileUpload.uploadFile(); | ||
patientFileUpload.typeFileName(cypressFileName); | ||
patientFileUpload.clickUploadFile(); | ||
// Verify the file is uploaded | ||
cy.verifyNotification("File Uploaded Successfully"); | ||
cy.closeNotification(); | ||
patientFileUpload.verifyUploadFilePresence(cypressFileName); | ||
// Archive the file | ||
patientFileUpload.archiveFile(); | ||
patientFileUpload.clickSaveArchiveFile(); | ||
cy.verifyNotification("File archived successfully"); | ||
patientFileUpload.verifyArchiveFile(cypressFileName); | ||
}); | ||
|
||
it("User-level Based Permission for File Modification", () => { | ||
// Login as Nurse 1 | ||
loginPage.login("dummynurse1", "Coronasafe@123"); | ||
cy.reload(); | ||
// Visit the patient details page | ||
patientPage.visitPatient(patientNameThree); | ||
visitPatientFileUploadSection.call(patientFileUpload); | ||
// Upload the file | ||
patientFileUpload.uploadFile(); | ||
patientFileUpload.typeFileName(cypressFileName); | ||
patientFileUpload.clickUploadFile(); | ||
// Verify the file is uploaded | ||
cy.verifyNotification("File Uploaded Successfully"); | ||
cy.closeNotification(); | ||
patientFileUpload.verifyUploadFilePresence(cypressFileName); | ||
// Edit the file name | ||
patientFileUpload.verifyFileRenameOption(true); | ||
patientFileUpload.renameFile(newFileName); | ||
patientFileUpload.clickSaveFileName(); | ||
// Verify the file name is changed | ||
cy.verifyNotification("File name changed successfully"); | ||
cy.closeNotification(); | ||
patientFileUpload.verifyUploadFilePresence(newFileName); | ||
// Login as Nurse 2 | ||
loginPage.login("dummynurse2", "Coronasafe@123"); | ||
cy.reload(); | ||
// Verify the file edit option is not available | ||
patientFileUpload.verifyUploadFilePresence(newFileName); | ||
patientFileUpload.verifyFileRenameOption(false); | ||
// Login as District Admin | ||
loginPage.loginAsDisctrictAdmin(); | ||
cy.reload(); | ||
// Verify the file edit option is available | ||
patientFileUpload.verifyUploadFilePresence(newFileName); | ||
patientFileUpload.verifyFileRenameOption(true); | ||
patientFileUpload.renameFile(cypressFileName); | ||
patientFileUpload.clickSaveFileName(); | ||
// Verify the file name is changed | ||
cy.verifyNotification("File name changed successfully"); | ||
cy.closeNotification(); | ||
patientFileUpload.verifyUploadFilePresence(cypressFileName); | ||
}); | ||
|
||
afterEach(() => { | ||
cy.saveLocalStorage(); | ||
}); | ||
}); | ||
} | ||
|
||
runTests( | ||
"Patient File upload in patient details page", | ||
patientFileUpload.clickFileUploadIcon | ||
); | ||
runTests( | ||
"Patient File upload in patient consultation page", | ||
patientFileUpload.clickFileTab | ||
); |
This file contains 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 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 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 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 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
Oops, something went wrong.