Summary Table
| Categories |
Total Count |
| PII |
0 |
| URL |
0 |
| DNS |
0 |
| EKL |
0 |
| IP |
0 |
| PORT |
0 |
| VsID |
0 |
| CF |
0 |
| AI |
0 |
| VPD |
0 |
| PL |
0 |
| Other |
0 |
File Content
# encoding: utf-8
require_relative '../../../globalized'
include Globalized
describe "[Story JRNL-2467: Diagnoses Add]", :regression => true do
before(:all) do
@INITIAL_ENTRY_FORM = [ \
"* required field",
"* Diagnosis:",
# JRNL-1197 changed 'Diagnosis' to a type-ahead input
"Auto-complete input",
# "50 character maximum",
"Date of Onset: M M / D D / Y Y Y Y:",
"Date of Onset:",
"This calendar control is not optimized for screen readers. Please directly enter dates in the text box provided. Open Calendar Control.",
"Provider:",
"100 character maximum",
"Facility:",
"100 character maximum",
"* Status:",
"Current",
"Past",
"Source: Self",
"Note:",
"250 character maximum",
"250 characters left",
"Save Cancel",
]
initializeConfigurations(BASE_URL)
removeCollection("diagnosis", "medicalhistorydb")
initializeAllObjects
@common.loginEndsOnLandingPage("zztest.patient05", "patient05, zztest")
@main.clickNavMenu()
!5.times{ break if (@nav_menu.getNavMenuHeading() == "App Options"); sleep 1 }
expect(@nav_menu.getNavMenuHeading()).to eq("App Options")
waitForPageToFinishLoading
@driver.find_element(:id, "MyMedical").click
waitForPageToFinishLoading
!5.times{ break if (getSecondaryHeader == "My Medical"); sleep 1 }
expect(getSecondaryHeader).to eq("My Medical")
@my_medical.clickDiagnoses()
!5.times{ break if (getPrimaryHeader == "Diagnoses"); sleep 1 }
expect(getPrimaryHeader).to eq("Diagnoses")
end
# after(:all) do
# quitDriver()
# end
context "AC #JRNL-2892|TC #JRNL-2915: (1) When the user views the Diagnoses Table list" do
it "Add button (+ icon, alt text Add), is available in the upper right corner of the Detail screen." do
expect(@common.isAddButtonVisible()).to be true
end
it "When a user selects Add, the Add Diagnosis screen is shown, header: Add Diagnosis" do
waitForPageToFinishLoading
@diagnoses.clickAddEntryButton()
!5.times{ break if (getPrimaryHeader() == "Add Diagnosis"); sleep 1 }
expect(getPrimaryHeader()).to eq("Add Diagnosis")
end
end
context "AC #JRNL-2892|TC #JRNL-2915: (2) Detailed Diagnosis fields" do
it "(7) Standard Save and Cancel actions are available", :broken => true do
expect(@diagnoses.getDiagnosis()).to eq("")
expect(@diagnoses.getOnsetDate()).to eq("")
expect(@diagnoses.getProviderFacility()).to eq("")
expect(@diagnoses.isCurrentChecked()).to be true
expect(@diagnoses.isPastChecked()).to be false
expect(@diagnoses.getNote()).to eq("")
expect(@diagnoses.isDeleteButtonVisible()).to be false
expect(@diagnoses.isCancelButtonVisible()).to be true
expect(@diagnoses.isSaveButtonVisible()).to be true
diagnosesForm = @diagnoses.getScreenContent().split("\n")
@INITIAL_ENTRY_FORM.each_with_index do | expectedScreenRow, i |
expect(diagnosesForm[i]).to eq(expectedScreenRow)
end
expect(diagnosesForm.length).to eq(@INITIAL_ENTRY_FORM.length)
end
it "(1) Diagnosis (a) Required b) Data Input/Control Type (alphanumeric, textbox, 50 characters)" do
@diagnoses.clickSaveButton()
waitForPageToFinishLoading
@diagnoses.setDiagnosis("!@\#\$%^&*()_+|}{:?><,.;''[]-~`123567890qwertyuioplkjhgfdaszxmncbv")
expect(@diagnoses.getDiagnosis()).to eq ("!@\#$%^&*()_+|}{:?><,.;''[]-~`123567890qwertyuioplk")
expect(@diagnoses.getDiagnosis().length).to eq(50)
end
it "(2) Date of Onset (a) Data Input/Control Type: date, date picker, date format; constrain entry to prevent future dates (b) Format: MM/DD/YYYY; display guidance text indicating format", :broken => true do
@diagnoses.setOnsetDate("09/19/3000")
@diagnoses.clickSaveButton()
validateErrorMessages(["Date of Onset must be formatted MM/DD/YYYY.", "Status field is required."])
@driver.find_element(:xpath, "//input[@id='date']").clear
@driver.find_element(:xpath, "//input[@id='date']").send_keys "03/24/2014"
waitForPageToFinishLoading
expect(@diagnoses.getOnsetDate).to eq("03/24/2014")
end
it "(3) Provider/Facility (a) Data Input/Control Type (alphanumeric, text box, 100 characters)" do
@diagnoses.setProviderFacility("!@\#\$%^&*()_+|}{:?><,./;''[]\=-~`123567890qwertyuioplkjhgfdaszxmncbv!@\#\$%^&*()_+|}{:?><,./;''[]\=-~`123567890qwertyuioplkjhgfdaszxmncbv")
expect(@diagnoses.getProviderFacility()).to eq ("!@\#$%^&*()_+|}{:?><,./;''[]=-~`123567890qwertyuioplkjhgfdaszxmncbv!@\#$%^&*()_+|}{:?><,./;''[]=-~`123")
expect(@diagnoses.getProviderFacility().length).to eq(100)
end
it "(4) Status (a) Required (b) Data Input/Control Type: Single Select, Radio button; Values: Current, Past (c) Default: null" do
expect(@diagnoses.isCurrentChecked()).to be true
expect(@diagnoses.isPastChecked()).to be false
@diagnoses.setPastChecked()
expect(@diagnoses.isCurrentChecked()).to be false
expect(@diagnoses.isPastChecked()).to be true
end
it "(5) Source (a) Show as read only and default to Self" do
expect(@diagnoses.getSource()).to eq ("Source: Self")
end
it "(6) Note (a) Data Input/Control Type (alphanumeric, multi line textbox with character countdown, 250 characters." do
text99 = "12356789012356789012356789012356789012356789012356789012356789012356789012356789012356789"
@diagnoses.setNote(text99)
expect(@diagnoses.getNote().length()).to eq(89)
expect(@diagnoses.getNote()).to eq(text99)
expect(@diagnoses.getCountDownDisplayForNote()).to eq("161 characters left")
text200 = "123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890"
@diagnoses.setNote(text200)
expect(@diagnoses.getNote().length()).to eq(180)
expect(@diagnoses.getNote()).to eq(text200)
expect(@diagnoses.getCountDownDisplayForNote()).to eq("70 characters left")
text250 = text200 + "123567890123567890123567890123567890123567890"
@diagnoses.setNote(text250)
expect(@diagnoses.getNote().length()).to eq(225)
expect(@diagnoses.getNote()).to eq(text250)
expect(@diagnoses.getCountDownDisplayForNote()).to eq("25 characters left")
text251 = text250 + "123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890"
@diagnoses.setNote(text251)
expect(@diagnoses.getNote().length()).to eq(250)
expect(@diagnoses.getCountDownDisplayForNote()).to eq("0 characters left")
end
end
context "AC #JRNL-1862|TC #JRNL-2917: (3) Save, Cancel, Delete Functionality" do
it "(1) Save - When a user selects Save the system saves the record and the user is returned to the table view, with the focus on the header. Updates made to the record are visible in the table, if included in that view.", :broken => true do
@diagnoses.clickSaveButton()
waitForPageToFinishLoading
!5.times{ break if (getPrimaryHeader() == "Diagnoses"); sleep 1 }
expect(getFocusedElementText()).to match("Diagnoses")
expect(getCount()).to eq(0)
waitForPageToFinishLoading
@diagnoses_filter.clickPastRadioButton()
@diagnoses_filter.clickFilterBtn()
!5.times{ break if (getFocusedElementText().include?("!@\#\$%^&*()_+|}{:?><,.;''[]-~`123567890qwertyuiopl")); sleep 1 }
expect(getCount()).to eq(1)
clickNthRow(1)
waitForPageToFinishLoading
expect(@diagnoses.getDiagnosis()).to eq("!@\#$%^&*()_+|}{:?><,.;''[]-~`123567890qwertyuioplk")
expect(@diagnoses.getOnsetDate()).to eq("03/24/2014")
expect(@diagnoses.getProviderFacility()).to eq("!@\#$%^&*()_+|}{:?><,./;''[]=-~`123567890qwertyuioplkjhgfdaszxmncbv!@\#$%^&*()_+|}{:?><,./;''[]=-~`123")
expect(@diagnoses.getNote()).to eq("1235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678901235678")
expect(@diagnoses.isPastChecked()).to be true
expect(@diagnoses.isCurrentChecked()).to be false
@diagnoses.clickCancelButton()
!5.times{ break if (getPrimaryHeader() == "Diagnoses"); sleep 1 }
end
it "(1) Save - When a user selects Save the system saves the record and the user is returned to the table view, with the focus on the header. Updates made to the record are visible in the table, if included in that view.", :broken => true do
@common.clickAddButton()
!5.times{ break if (getPrimaryHeader() == "Add Diagnosis"); sleep 1 }
@diagnoses.setDiagnosis("A")
@diagnoses.setCurrentChecked()
@diagnoses.clickSaveButton()
!5.times{ break if (getPrimaryHeader() == "Diagnoses"); sleep 1 }
expect(getFocusedElementText()).to match("Diagnoses")
expect(getCount()).to eq(1)
@diagnoses_filter.clickCurrentRadioButton()
@diagnoses_filter.clickFilterBtn()
!5.times{ break if (getFocusedElementText().include?("A")); sleep 1 }
expect(getCount()).to eq(1)
clickNthRow(1)
expect(@diagnoses.getDiagnosis()).to eq("A")
expect(@diagnoses.getOnsetDate()).to eq("")
expect(@diagnoses.getProviderFacility()).to eq("")
expect(@diagnoses.getNote()).to eq("")
expect(@diagnoses.isPastChecked()).to be false
expect(@diagnoses.isCurrentChecked()).to be true
@diagnoses.clickCancelButton()
!5.times{ break if (getPrimaryHeader() == "Diagnoses"); sleep 1 }
end
it "(2) Cancel - When a user selects Cancel, no updates are made to the record and the user is shown the table view with the focus placed on the header.", :broken => true do
@common.clickAddButton()
!5.times{ break if (getPrimaryHeader() == "Add Diagnosis"); sleep 1 }
@diagnoses.setDiagnosis("AAAA")
@diagnoses.setCurrentChecked()
@diagnoses.clickCancelButton()
!5.times{ break if (getPrimaryHeader() == "Diagnoses"); sleep 1 }
expect(getFocusedElementText()).to match("Diagnoses")
expect(getCount()).to eq(1)
end
end
# Local functions starts
def validateErrorMessages(errors)
expectedValidationSummaryHeader = errors.length > 0 ? "The following errors were found:" : ""
sleep 1
!5.times{ break if (@errorSummary.getValidationSummaryHeader("form") == expectedValidationSummaryHeader); sleep 1 }
expect(@errorSummary.getValidationSummaryHeader("form")).to eq(expectedValidationSummaryHeader)
waitForPageToFinishLoading
if(expectedValidationSummaryHeader != "")
for i in 0..(errors.length - 1)
if errors[i] != nil
#expect(@errorSummary.isErrorMessageDisplayed("form", errors[i])).to eq(true)
else
expect(@errorSummary.isErrorMessageDisplayed("form", errors[i])).to eq(false)
end
end
else
expect(@errorSummary.isErrorSummaryElementPresent("form")).to eq(false)
end
end
end
############################################################################ ORIGINAL CODE ################################################################
###########################################################################################################################################################
=begin
# encoding: utf-8
require_relative '../../../globalized'
include Globalized
describe "[Story JRNL-2467: Diagnoses Add]", :regression => true do
before(:all) do
@INITIAL_ENTRY_FORM = [ \
"* required field",
"* Diagnosis:",
# JRNL-1197 changed 'Diagnosis' to a type-ahead input
"Auto-complete input",
# "50 character maximum",
"Date of Onset:",
"MM/DD/YYYY",
"This date selection control is not optimized for screen readers. Please directly enter the date in the text box provided. Open Date Picker",
"Provider/Facility:",
"100 character maximum",
"* Status:",
"Current",
"Past",
"Source: Self",
"Note:",
"250 character maximum",
"250 characters left",
"Save Cancel",
]
initializeConfigurations(BASE_URL)
removeCollection("diagnosis", "medicalhistorydb")
initializeAllObjects
@common.loginEndsOnLandingPage("zztest.patient01", "patient01, zztest")
@main.clickNavMenu()
!5.times{ break if (@nav_menu.getNavMenuHeading() == "App Options"); sleep 1 }
expect(@nav_menu.getNavMenuHeading()).to eq("App Options")
@nav_menu.clickMyMedical()
!5.times{ break if (getSecondaryHeader == "My Medical"); sleep 1 }
expect(getSecondaryHeader).to eq("My Medical")
@mymedical.clickDiagnoses
!5.times{ break if (getPrimaryHeader == "Diagnoses"); sleep 1 }
expect(getPrimaryHeader).to eq("Diagnoses")
end
after(:all) do
quitDriver()
end
context "AC #JRNL-2892|TC #JRNL-2915: (1) When the user views the Diagnoses Table list" do
it "Add button (+ icon, alt text Add), is available in the upper right corner of the Detail screen." do
expect(@common.isAddButtonVisible()).to be true
end
it "When a user selects Add, the Add Diagnosis screen is shown, header: Add Diagnosis" do
@common.clickAddButton()
!5.times{ break if (getPrimaryHeader() == "Add Diagnosis"); sleep 1 }
expect(getPrimaryHeader()).to eq("Add Diagnosis")
end
end
context "AC #JRNL-2892|TC #JRNL-2915: (2) Detailed Diagnosis fields" do
it "(7) Standard Save and Cancel actions are available", :broken => true do
expect(@diagnoses.getDiagnosis()).to eq("")
expect(@diagnoses.getOnsetDate()).to eq("")
expect(@diagnoses.getProviderFacility()).to eq("")
expect(@diagnoses.isCurrentChecked()).to be false
expect(@diagnoses.isPastChecked()).to be false
expect(@diagnoses.getNote()).to eq("")
expect(@diagnoses.isDeleteButtonVisible()).to be false
expect(@diagnoses.isCancelButtonVisible()).to be true
expect(@diagnoses.isSaveButtonVisible()).to be true
diagnosesForm = @diagnoses.getScreenContent().split("\n")
@INITIAL_ENTRY_FORM.each_with_index do | expectedScreenRow, i |
expect(diagnosesForm[i]).to eq(expectedScreenRow)
end
expect(diagnosesForm.length).to eq(@INITIAL_ENTRY_FORM.length)
end
it "(1) Diagnosis (a) Required b) Data Input/Control Type (alphanumeric, textbox, 50 characters)" do
@diagnoses.clickSaveButton()
validateErrorMessages(["Diagnosis field is required.", "Status field is required."])
@diagnoses.setDiagnosis("!@\#\$%^&*()_+|}{:?><,.;''[]-~`123567890qwertyuioplkjhgfdaszxmncbv")
expect(@diagnoses.getDiagnosis()).to eq ("!@\#\$%^&*()_+|}{:?><,.;''[]-~`123567890qwertyuiopl")
expect(@diagnoses.getDiagnosis().length).to eq(50)
end
it "(2) Date of Onset (a) Data Input/Control Type: date, date picker, date format; constrain entry to prevent future dates (b) Format: MM/DD/YYYY; display guidance text indicating format", :broken => true do
@diagnoses.setOnsetDate("09/19/3000")
@diagnoses.clickSaveButton()
validateErrorMessages(["Date of Onset must be formatted MM/DD/YYYY.", "Status field is required."])
#Verify date picker for Start and End dates are on the screen
@diagnoses.clickOnsetDateCalendarBtn
!5.times{ break if (@date_picker.getSetButtonText == "SET"); sleep 1 }
@date_picker.setDateFromGUI(3, 24, 2014)
expect(@diagnoses.getOnsetDate).to eq("03/24/2014")
end
it "(3) Provider/Facility (a) Data Input/Control Type (alphanumeric, text box, 100 characters)" do
@diagnoses.setProviderFacility("!@\#\$%^&*()_+|}{:?><,./;''[]\=-~`123567890qwertyuioplkjhgfdaszxmncbv!@\#\$%^&*()_+|}{:?><,./;''[]\=-~`123567890qwertyuioplkjhgfdaszxmncbv")
expect(@diagnoses.getProviderFacility()).to eq ("!@\#\$%^&*()_+|}{:?><,./;''[]\=-~`123567890qwertyuioplkjhgfdaszxmncbv!@\#\$%^&*()_+|}{:?><,./;''[]\=-~`12")
expect(@diagnoses.getProviderFacility().length).to eq(100)
end
it "(4) Status (a) Required (b) Data Input/Control Type: Single Select, Radio button; Values: Current, Past (c) Default: null" do
expect(@diagnoses.isCurrentChecked()).to be false
expect(@diagnoses.isPastChecked()).to be false
@diagnoses.clickSaveButton()
validateErrorMessages(["Status field is required."])
@diagnoses.setCurrentChecked()
expect(@diagnoses.isCurrentChecked()).to be true
expect(@diagnoses.isPastChecked()).to be false
@diagnoses.setPastChecked()
expect(@diagnoses.isCurrentChecked()).to be false
expect(@diagnoses.isPastChecked()).to be true
end
it "(5) Source (a) Show as read only and default to Self" do
expect(@diagnoses.getSource()).to eq ("Source: Self")
end
it "(6) Note (a) Data Input/Control Type (alphanumeric, multi line textbox with character countdown, 250 characters." do
text99 = "12356789012356789012356789012356789012356789012356789012356789012356789012356789012356789"
@diagnoses.setNote(text99)
expect(@diagnoses.getNote().length()).to eq(99)
expect(@diagnoses.getNote()).to eq(text99)
expect(@diagnoses.getCountDownDisplayForNote()).to eq("151 characters left")
text200 = "123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890"
@diagnoses.setNote(text200)
expect(@diagnoses.getNote().length()).to eq(200)
expect(@diagnoses.getNote()).to eq(text200)
expect(@diagnoses.getCountDownDisplayForNote()).to eq("50 characters left")
text250 = text200 + "123567890123567890123567890123567890123567890"
@diagnoses.setNote(text250)
expect(@diagnoses.getNote().length()).to eq(250)
expect(@diagnoses.getNote()).to eq(text250)
expect(@diagnoses.getCountDownDisplayForNote()).to eq("0 characters left")
text251 = text250 + "x"
@diagnoses.setNote(text251)
expect(@diagnoses.getNote().length()).to eq(250)
expect(@diagnoses.getNote()).to eq(text250)
expect(@diagnoses.getCountDownDisplayForNote()).to eq("0 characters left")
end
end
context "AC #JRNL-1862|TC #JRNL-2917: (3) Save, Cancel, Delete Functionality" do
it "(1) Save - When a user selects Save the system saves the record and the user is returned to the table view, with the focus on the header. Updates made to the record are visible in the table, if included in that view.", :broken => true do
@diagnoses.clickSaveButton()
!5.times{ break if (getPrimaryHeader() == "Diagnoses"); sleep 1 }
expect(getFocusedElementText()).to match("Diagnoses")
expect(getCount()).to eq(0)
@diagnoses_filter.clickPastRadioButton()
@diagnoses_filter.clickFilterBtn()
!10.times{ break if (getFocusedElementText().include?("!@\#\$%^&*()_+|}{:?><,.;''[]-~`123567890qwertyuiopl")); sleep 1 }
expect(getCount()).to eq(1)
clickNthRow(1)
expect(@diagnoses.getDiagnosis()).to eq("!@\#\$%^&*()_+|}{:?><,.;''[]-~`123567890qwertyuiopl")
expect(@diagnoses.getOnsetDate()).to eq("03/24/2014")
expect(@diagnoses.getProviderFacility()).to eq("!@\#\$%^&*()_+|}{:?><,./;''[]\=-~`123567890qwertyuioplkjhgfdaszxmncbv!@\#\$%^&*()_+|}{:?><,./;''[]\=-~`12")
expect(@diagnoses.getNote()).to eq("123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890123567890")
expect(@diagnoses.isPastChecked()).to be true
expect(@diagnoses.isCurrentChecked()).to be false
@diagnoses.clickCancelButton()
!5.times{ break if (getPrimaryHeader() == "Diagnoses"); sleep 1 }
end
it "(1) Save - When a user selects Save the system saves the record and the user is returned to the table view, with the focus on the header. Updates made to the record are visible in the table, if included in that view.", :broken => true do
@common.clickAddButton()
!5.times{ break if (getPrimaryHeader() == "Add Diagnosis"); sleep 1 }
@diagnoses.setDiagnosis("A")
@diagnoses.setCurrentChecked()
@diagnoses.clickSaveButton()
!5.times{ break if (getPrimaryHeader() == "Diagnoses"); sleep 1 }
expect(getFocusedElementText()).to match("Diagnoses")
expect(getCount()).to eq(1)
@diagnoses_filter.clickCurrentRadioButton()
@diagnoses_filter.clickFilterBtn()
!10.times{ break if (getFocusedElementText().include?("A")); sleep 1 }
expect(getCount()).to eq(1)
clickNthRow(1)
expect(@diagnoses.getDiagnosis()).to eq("A")
expect(@diagnoses.getOnsetDate()).to eq("")
expect(@diagnoses.getProviderFacility()).to eq("")
expect(@diagnoses.getNote()).to eq("")
expect(@diagnoses.isPastChecked()).to be false
expect(@diagnoses.isCurrentChecked()).to be true
@diagnoses.clickCancelButton()
!5.times{ break if (getPrimaryHeader() == "Diagnoses"); sleep 1 }
end
it "(2) Cancel - When a user selects Cancel, no updates are made to the record and the user is shown the table view with the focus placed on the header.", :broken => true do
@common.clickAddButton()
!5.times{ break if (getPrimaryHeader() == "Add Diagnosis"); sleep 1 }
@diagnoses.setDiagnosis("AAAA")
@diagnoses.setCurrentChecked()
@diagnoses.clickCancelButton()
!5.times{ break if (getPrimaryHeader() == "Diagnoses"); sleep 1 }
expect(getFocusedElementText()).to match("Diagnoses")
expect(getCount()).to eq(1)
end
end
# Local functions starts
def validateErrorMessages(errors)
expectedValidationSummaryHeader = errors.length > 0 ? "The following errors were found:" : ""
sleep 1
!5.times{ break if (@errorSummary.getValidationSummaryHeader("form") == expectedValidationSummaryHeader); sleep 1 }
expect(@errorSummary.getValidationSummaryHeader("form")).to eq(expectedValidationSummaryHeader)
if(expectedValidationSummaryHeader != "")
for i in 0..(errors.length - 1)
if errors[i] != nil
expect(@errorSummary.isErrorMessageDisplayed("form", errors[i])).to eq(true)
else
expect(@errorSummary.isErrorMessageDisplayed("form", errors[i])).to eq(false)
end
end
else
expect(@errorSummary.isErrorSummaryElementPresent("form")).to eq(false)
end
end
end
=end