Skip to content

Commit

Permalink
Fix for UploadDifferentMeasureTypes.spec and skipped VirusScan.spec
Browse files Browse the repository at this point in the history
  • Loading branch information
praveenavas committed Nov 28, 2023
1 parent 3c7d9bd commit cfea7e4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 34 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ describe('Different Measure Types Upload', () => {
beforeEach('Login', () => {
bonnieLogin.login()
})

afterEach('Log Out', () => {
after('Log Out', () => {
bonnieLogin.logout()
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,16 @@ import * as homePage from '../../../../pom/BonnieQDM/WI/Homepage'
import * as importMeasureDialog from '../../../../pom/BonnieQDM/WI/ImportMeasureDialog'
import * as helper from '../../../../support/helpers'

describe('Smoke Test: Virus Scan', () => {

// WAF Issue
describe.skip('Smoke Test: Virus Scan', () => {
beforeEach('Login', () => {

bonnieLogin.login()

})
afterEach('Log Out', () => {

bonnieLogin.logout()

})

it('Verify successful error message when uploading simulated virus', () => {

bonnieUploadMeasure.VirusScanUpload()

// Verify error message
Expand All @@ -33,6 +28,5 @@ describe('Smoke Test: Virus Scan', () => {
cy.get(importMeasureDialog.closeBtn).click()

helper.notVisibleWithTimeout(importMeasureDialog.importMeasureDialog)

})
})
41 changes: 17 additions & 24 deletions cypress/support/Bonnie/BonnieUploadMeasure.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import * as importMeasureDialog from '../../pom/BonnieFHIR/WI/ImportMeasureDialo
import * as dashboard from '../../pom/BonnieFHIR/WI/Dashboard'
import * as measureDetailsPage from '../../pom/BonnieFHIR/WI/MeasureDetailsPage'


const VsacApiKey = Cypress.env('VSAC_API_KEY')

export const UploadMeasureToBonnie = (fileToUpload, calculation, vsacLoggedIn, includeSDE) => {
Expand All @@ -16,13 +15,13 @@ export const UploadMeasureToBonnie = (fileToUpload, calculation, vsacLoggedIn, i
helper.visibleWithTimeout(dashboard.uploadBtn)
helper.enabledWithTimeout(dashboard.uploadBtn)

//setup for grabbing the VSAC call profile_names
// setup for grabbing the VSAC call profile_names
cy.server({ method: 'GET' })
cy.route('/vsac_util/profile_names').as('vsac')

cy.get(dashboard.uploadBtn).click()

//waiting for VSAC call return 200
// waiting for VSAC call return 200
cy.wait('@vsac').its('status').should('eq', 200)

if (calculation === 'episode') {
Expand All @@ -31,19 +30,16 @@ export const UploadMeasureToBonnie = (fileToUpload, calculation, vsacLoggedIn, i

helper.visibleWithTimeout(importMeasureDialog.importMeasureDialog)
helper.visibleWithTimeout(importMeasureDialog.importLoadBtn)
//helper.visibleWithTimeout(importMeasureDialog.fileImportInput)
// helper.visibleWithTimeout(importMeasureDialog.fileImportInput)

//upload the file to the modal
//helper.enabledWithTimeout(importMeasureDialog.fileImportInput)
// upload the file to the modal
// helper.enabledWithTimeout(importMeasureDialog.fileImportInput)
cy.get(importMeasureDialog.fileImportInput).attachFile(fileToUpload)

if (vsacLoggedIn === true) {

helper.visibleWithTimeout(importMeasureDialog.vsacLogOut)

} else if (vsacLoggedIn === undefined || vsacLoggedIn === false) {

//wait for VSAC api key field to display for the user, and enter api key
// wait for VSAC api key field to display for the user, and enter api key
helper.visibleWithTimeout(importMeasureDialog.vsacApiKeyTextBox)
helper.enabledWithTimeout(importMeasureDialog.vsacApiKeyTextBox)
helper.enterText(importMeasureDialog.vsacApiKeyTextBox, VsacApiKey)
Expand All @@ -54,8 +50,7 @@ export const UploadMeasureToBonnie = (fileToUpload, calculation, vsacLoggedIn, i
cy.get(importMeasureDialog.includeSDECheckbox).should('be.checked')
}


//click load button to import the measure
// click load button to import the measure
helper.visibleWithTimeout(importMeasureDialog.importLoadBtn)
helper.enabled(importMeasureDialog.importLoadBtn)
helper.click(importMeasureDialog.importLoadBtn)
Expand All @@ -71,13 +66,13 @@ export const UpdateMeasure = (fileToUpload) => {

helper.visibleWithTimeout(importMeasureDialog.importMeasureDialog)
helper.visibleWithTimeout(importMeasureDialog.importLoadBtn)
//helper.visibleWithTimeout(importMeasureDialog.fileImportInput)
// helper.visibleWithTimeout(importMeasureDialog.fileImportInput)

//upload the file to the modal
//helper.enabledWithTimeout(importMeasureDialog.fileImportInput)
// upload the file to the modal
// helper.enabledWithTimeout(importMeasureDialog.fileImportInput)
cy.get(importMeasureDialog.fileImportInput).attachFile(fileToUpload)

//click load button to import the measure
// click load button to import the measure
helper.visibleWithTimeout(importMeasureDialog.importLoadBtn)
helper.enabled(importMeasureDialog.importLoadBtn)
helper.click(importMeasureDialog.importLoadBtn)
Expand All @@ -87,7 +82,6 @@ export const UpdateMeasure = (fileToUpload) => {
}

export const VirusScanUpload = () => {

const virusString = 'X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*'

cy.log(VsacApiKey)
Expand All @@ -96,35 +90,34 @@ export const VirusScanUpload = () => {
helper.visibleWithTimeout(dashboard.uploadBtn)
helper.enabledWithTimeout(dashboard.uploadBtn)

//setup for grabbing the VSAC call profile_names
// setup for grabbing the VSAC call profile_names
cy.server({ method: 'GET' })
cy.route('/vsac_util/profile_names').as('vsac')

cy.get(dashboard.uploadBtn).click()

//waiting for VSAC call return 200
// waiting for VSAC call return 200
cy.wait('@vsac').its('status').should('eq', 200)

helper.visibleWithTimeout(importMeasureDialog.importMeasureDialog)
helper.visibleWithTimeout(importMeasureDialog.importLoadBtn)

cy.get(importMeasureDialog.fileImportInput).attachFile({
fileContent: virusString,
filePath: "VirusScan/VIRUS - Virus-v2-0-004-QDM-5-6.zip",
filePath: 'VirusScan/VIRUS - Virus-v2-0-004-QDM-5-6.zip',
encoding: 'utf-8',
lastModified: new Date().getTime()
})
cy.pause()
//wait for VSAC api key field to display for the user, and enter api key

// wait for VSAC api key field to display for the user, and enter api key
helper.visibleWithTimeout(importMeasureDialog.vsacApiKeyTextBox)
helper.enabledWithTimeout(importMeasureDialog.vsacApiKeyTextBox)
helper.enterText(importMeasureDialog.vsacApiKeyTextBox, VsacApiKey)

//click load button to import the measure
// click load button to import the measure
helper.visibleWithTimeout(importMeasureDialog.importLoadBtn)
helper.enabled(importMeasureDialog.importLoadBtn)
helper.click(importMeasureDialog.importLoadBtn)

}

function changeMeasureCalculation () {
Expand Down

0 comments on commit cfea7e4

Please sign in to comment.