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
require_relative '../../../globalized'
include Globalized
describe "[Story #JRNL-2488: Personal Contacts - Add]", :broken => true, :regression => true do
before(:all) do
@ENTRY_FORM_1 = [
"* required field",
"",
"* First Name:",
"50 character maximum",
"* Last Name:",
"50 character maximum",
"Relationship:",
"Primary Phone:",
"Enter 10 digits",
"Primary Phone Type:",
"Other Phone:",
"Enter 10 digits",
"Other Phone Type:",
" Add Phone",
"Email:",
"100 character maximum",
"Address",
"Country:",
"Address Line 1:",
"100 character maximum",
"Address Line 2:",
"100 character maximum",
"City:",
"50 character maximum",
"State:",
"ZIP/Postal Code:",
"10 character maximum",
"Note:",
"250 character maximum",
"250 characters left",
"Save Cancel"
]
@ENTRY_FORM_2 = [
"* required field",
"",
"* First Name:",
"50 character maximum",
"* Last Name:",
"50 character maximum",
"Relationship:",
"Primary Phone:",
"Enter 10 digits",
"Primary Phone Type:",
"Other Phone:",
"Enter 10 digits",
"Other Phone Type:",
" Add Phone",
"Email:",
"100 character maximum",
"Address",
"Country:",
"Address Line 1:",
"100 character maximum",
"Address Line 2:",
"100 character maximum",
"City:",
"50 character maximum",
"State/Province:",
"50 character maximum",
"ZIP/Postal Code:",
"10 character maximum",
"Note:",
"250 character maximum",
"250 characters left",
"Save Cancel"
]
initializeConfigurations(BASE_URL)
resetCollection("contacts", "personalprofiledb", "personalContacts")
initializeAllObjects
@common.loginEndsOnLandingPage("zztest.patient01","patient01, zztest");
expect(@main.getFooterText()).to eq("Logged in as patient01, zztest");
@main.clickNavMenu()
!45.times{ break if (@navMenu.getNavMenuHeading() == "App Options"); sleep 1 }
@navMenu.clickContacts()
!45.times{ break if (@contacts.getSecondaryHeader() == "Contacts"); sleep 1 }
expect(@contacts.getSecondaryHeader()).to eq("Contacts")
@contacts.clickPersonalContacts()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::HEADER)
expect(getCount()).to eq(11)
end
after(:all) do
quitDriver()
end
describe "AC JRNL-1909|TC-2741: When the user views the Personal Contacts Table list" do
it "an Add button (+ icon, alt text Add), is available in the upper right corner of the Detail screen" do
expect(@contacts.isAddVisible()).to eq(true)
end
end
describe "AC JRNL-1909|TC-2741: When a user selects Add" do
it "the Add Personal Contacts screen is shown, header: Add Personal Contact" do
@contacts.clickAddButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::ADD_HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::ADD_HEADER)
end
describe "Detailed Personal Contact fields include the following" do
it "Unless otherwise indicated, all values default to null (or select for drop lists), no guidance text (light gray placeholder text) is shown, and all fields are optional" do
sleep 2.0 #Need this for screen to finish repainting
@form = @personalContacts.stripSelectTextFromScreen(
@personalContacts.getScreenContent().split("\n"),
['relationship', 'addressCountry', 'addressStateAbbreviation', "otherPhoneType1", "primaryPhoneType"]
)
@ENTRY_FORM_1.each_with_index do | expectedScreenRow, i |
expect(@form[i]).to eq(expectedScreenRow)
end
end
it "FirstName (Text, 50 characters, required)" do
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::FIRST_NAME)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::FIRST_NAME)).to eq(true)
end
it "LastName (Text, 50 characters, required)" do
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::LAST_NAME)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::LAST_NAME)).to eq(true)
end
it "Relationship (drop list, values: select, Family, Friend, Support, Lawyer, Co-Worker, Other)" do
expect(@personalContacts.getSelectBoxText(PersonalContacts::RELATIONSHIP)).to eq("Select")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::RELATIONSHIP)).to eq(false)
relationships = [ "Select", "Family", "Friend", "Support", "Lawyer", "Co-Worker", "Other" ]
@personalContacts.getElement(:css, "select[name='relationship']").text().split("\n").each_with_index do | foundText, i |
expect(foundText).to eq(relationships[i])
end
end
it "Primary Phone " do
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::PRIMARY_PHONE)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::PRIMARY_PHONE)).to eq(false)
expect(@personalContacts.getSelectBoxText(PersonalContacts::PRIMARY_PHONE_TYPE)).to eq("Select")
end
it "Other Phone" do
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::OTHER_PHONE_1)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::OTHER_PHONE_1)).to eq(false)
expect(@personalContacts.getSelectBoxText(PersonalContacts::OTHER_PHONE_TYPE_1)).to eq("Select")
end
it "Email (text, 100 characters)" do
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::EMAIL)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::EMAIL)).to eq(false)
end
it "Country (drop down)" do
expect(@personalContacts.getSelectBoxText(PersonalContacts::COUNTRY)).to eq("United States")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::COUNTRY)).to eq(false)
end
it "Address Line 1 (alphanumeric, text box, 100 characters)" do
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ADDRESS_LINE_1)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::ADDRESS_LINE_1)).to eq(false)
end
it "Address line 2 (alphanumeric, text box, 100 characters)" do
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ADDRESS_LINE_2)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::ADDRESS_LINE_2)).to eq(false)
end
it "City (alphanumeric, text box, 50 characters)" do
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::CITY)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::CITY)).to eq(false)
end
it "State (select list, select option shown as default and is equivalent to null; standard list to be used that includes DC and Puerto Rico)" do
expect(@personalContacts.getSelectBoxText(PersonalContacts::STATE)).to eq("Select")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::STATE)).to eq(false)
end
it "State/Province (text, 50 characters)" do
expect(@personalContacts.isElementVisible(:css, PersonalContacts::STATE_PROVINCE)).to eq(false)
@personalContacts.setSelectBoxValue(PersonalContacts::COUNTRY, "United Kingdom")
expect(@personalContacts.isElementVisible(:css, PersonalContacts::STATE_PROVINCE)).to eq(true)
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::STATE_PROVINCE)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::STATE_PROVINCE)).to eq(false)
end
it "ZIP/Postal Code (alphanumeric, text box, 10 characters)" do
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ZIP_POSTAL_CODE)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::ZIP_POSTAL_CODE)).to eq(false)
end
it "Note (text 250 Characters)" do
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::NOTE)).to eq("")
expect(@personalContacts.isFieldRequired(:css, PersonalContacts::NOTE)).to eq(false)
expect(@personalContacts.getTextForElement(:css, PersonalContacts::NOTE_CHARACTER_COUNT)).to eq("250 characters left")
end
it "Unless otherwise indicated, all values default to null (or select for drop lists), no guidance text (light gray placeholder text) is shown, and all fields are optional" do
@form = @personalContacts.stripSelectTextFromScreen(
@personalContacts.getScreenContent().split("\n"),
['relationship', 'addressCountry', 'addressStateAbbreviation', "otherPhoneType1", "primaryPhoneType"]
)
@ENTRY_FORM_2.each_with_index do | expectedScreenRow, i |
expect(@form[i]).to eq(expectedScreenRow)
end
end
it "Error Messages" do
expectedValidationSummaryHeader = "The following errors were found:"
@personalContacts.setPhoneInput(PersonalContacts::PRIMARY_PHONE, "10")
@personalContacts.setPhoneInput(PersonalContacts::OTHER_PHONE_1, "10")
@personalContacts.clickSaveButton()
!45.times{ break if (@error.getValidationSummaryHeader("entryForm") == expectedValidationSummaryHeader); sleep 1 }
expect(@error.getValidationSummaryHeader("entryForm")).to eq(expectedValidationSummaryHeader)
expect(@error.isErrorMessageDisplayed("entryForm", "First Name field is required.")).to eq(true)
expect(@error.isErrorMessageDisplayed("entryForm", "Last Name field is required.")).to eq(true)
expect(@error.isErrorMessageDisplayed("entryForm", "Primary Phone must be formatted (###) ###-####.")).to eq(true)
expect(@error.isErrorMessageDisplayed("entryForm", "Other Phone must be formatted (###) ###-####.")).to eq(true)
end
end
describe "Standard Save and Cancel options are available" do
it "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" do
expect(@personalContacts.isCancelButtonVisible()).to eq(true)
@personalContacts.clickCancelButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::HEADER)
expect(getCount()).to eq(11)
end
describe "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" do
it "min" do
@contacts.clickAddButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::ADD_HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::ADD_HEADER)
@personalContacts.setInput(PersonalContacts::FIRST_NAME, "Test First Name")
@personalContacts.setInput(PersonalContacts::LAST_NAME, "Test Last Name")
@personalContacts.clickSaveButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::HEADER)
expect(getCount()).to eq(12)
clickNthRow(10)
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::EDIT_HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::EDIT_HEADER)
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::FIRST_NAME)).to eq("Test First Name")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::LAST_NAME)).to eq("Test Last Name")
expect(@personalContacts.getSelectBoxText(PersonalContacts::RELATIONSHIP)).to eq("Select")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::PRIMARY_PHONE)).to eq("")
expect(@personalContacts.getSelectBoxText(PersonalContacts::PRIMARY_PHONE_TYPE)).to eq("Select")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::OTHER_PHONE_1)).to eq("")
expect(@personalContacts.getSelectBoxText(PersonalContacts::OTHER_PHONE_TYPE_1)).to eq("Select")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::EMAIL)).to eq("")
expect(@personalContacts.getSelectBoxText(PersonalContacts::COUNTRY)).to eq("United States")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ADDRESS_LINE_1)).to eq("")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ADDRESS_LINE_2)).to eq("")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::CITY)).to eq("")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::STATE_PROVINCE)).to eq("")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ZIP_POSTAL_CODE)).to eq("")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::NOTE)).to eq("")
expect(@personalContacts.getTextForElement(:css, PersonalContacts::NOTE_CHARACTER_COUNT)).to eq("250 characters left")
@personalContacts.clickCancelButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::HEADER)
expect(getCount()).to eq(12)
end
it "max" do
@contacts.clickAddButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::ADD_HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::ADD_HEADER)
@personalContacts.setInput(PersonalContacts::FIRST_NAME, "TestFirstNameTestFirstNameTestFirstNameTestFirstNA")
@personalContacts.setInput(PersonalContacts::LAST_NAME, "TestLastNameTestLastNameTestLastNameTestLastNameTA")
@personalContacts.setSelectBoxValue(PersonalContacts::RELATIONSHIP, "Family")
@personalContacts.setPhoneInput(PersonalContacts::PRIMARY_PHONE, "123a456b7890")
@personalContacts.setSelectBoxValue(PersonalContacts::PRIMARY_PHONE_TYPE, "Mobile")
@personalContacts.setPhoneInput(PersonalContacts::OTHER_PHONE_1, "123a456b9990")
@personalContacts.setSelectBoxValue(PersonalContacts::OTHER_PHONE_TYPE_1, "Home")
@personalContacts.setInput(PersonalContacts::EMAIL, "my.name@agilex.commy.name@agilex.commy.name@agilex.commy.name@agilex.commy.name@agilex.commy.name@agilex.com")
@personalContacts.setSelectBoxValue(PersonalContacts::COUNTRY, "Serbia")
@personalContacts.setInput(PersonalContacts::ADDRESS_LINE_1, "100 1st St 100 1st St 100 1st St 100 1st St 100 1st St 100 1st St 100 1st St 100 1st St 100 1st St 100 1st St ")
@personalContacts.setInput(PersonalContacts::ADDRESS_LINE_2, "Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 ")
@personalContacts.setInput(PersonalContacts::CITY, "SerbiniaSerbiniaSerbiniaSerbiniaSerbiniaSerbiniaSerbinia")
@personalContacts.setInput(PersonalContacts::STATE_PROVINCE, "SerbistateSerbistateSerbistateSerbistateSerbistateSerbistate")
@personalContacts.setInput(PersonalContacts::ZIP_POSTAL_CODE, "1a4561a4561a456")
@personalContacts.setInput(PersonalContacts::NOTE, "None of this info is real. None of this info is real. None of this info is real.")
expect(@personalContacts.getTextForElement(:css, PersonalContacts::NOTE_CHARACTER_COUNT)).to eq("170 characters left")
@personalContacts.setInput(PersonalContacts::NOTE, "None of this info is real. None of this info is real. None of this info is real.None of this info is real. None of this info is real. None of this info is real.None of this info is real. None of this info is real. None of this info is real. None of this info is real.")
expect(@personalContacts.getTextForElement(:css, PersonalContacts::NOTE_CHARACTER_COUNT)).to eq("0 characters left")
@personalContacts.clickSaveButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::HEADER)
expect(getCount()).to eq(13)
clickNthRow(11)
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::EDIT_HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::EDIT_HEADER)
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::FIRST_NAME)).to eq("TestFirstNameTestFirstNameTestFirstNameTestFirstNA")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::FIRST_NAME).length()).to eq(50)
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::LAST_NAME)).to eq("TestLastNameTestLastNameTestLastNameTestLastNameTA")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::LAST_NAME).length()).to eq(50)
expect(@personalContacts.getSelectBoxText(PersonalContacts::RELATIONSHIP)).to eq("Family")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::PRIMARY_PHONE)).to eq("(123) 456-7890")
expect(@personalContacts.getSelectBoxText(PersonalContacts::PRIMARY_PHONE_TYPE)).to eq("Mobile")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::OTHER_PHONE_1)).to eq("(123) 456-9990")
expect(@personalContacts.getSelectBoxText(PersonalContacts::OTHER_PHONE_TYPE_1)).to eq("Home")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::EMAIL)).to eq("my.name@agilex.commy.name@agilex.commy.name@agilex.commy.name@agilex.commy.name@agilex.commy.name@ag")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::EMAIL).length()).to eq(100)
expect(@personalContacts.getSelectBoxText(PersonalContacts::COUNTRY)).to eq("Serbia")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ADDRESS_LINE_1)).to eq("100 1st St 100 1st St 100 1st St 100 1st St 100 1st St 100 1st St 100 1st St 100 1st St 100 1st St 1")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ADDRESS_LINE_1).length()).to eq(100)
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ADDRESS_LINE_2)).to eq("Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suite 8 Suit")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ADDRESS_LINE_2).length()).to eq(100)
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::CITY)).to eq("SerbiniaSerbiniaSerbiniaSerbiniaSerbiniaSerbiniaSe")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::CITY).length()).to eq(50)
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::STATE_PROVINCE)).to eq("SerbistateSerbistateSerbistateSerbistateSerbistate")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::STATE_PROVINCE).length()).to eq(50)
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ZIP_POSTAL_CODE)).to eq("1a4561a456")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::ZIP_POSTAL_CODE).length()).to eq(10)
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::NOTE)).to eq("None of this info is real. None of this info is real. None of this info is real.None of this info is real. None of this info is real. None of this info is real.None of this info is real. None of this info is real. None of this info is real. None of t")
expect(@personalContacts.getTextFromInput(:css, PersonalContacts::NOTE).length()).to eq(250)
expect(@personalContacts.getTextForElement(:css, PersonalContacts::NOTE_CHARACTER_COUNT)).to eq("0 characters left")
@personalContacts.clickCancelButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::HEADER)
expect(getCount()).to eq(13)
end
end
end
describe "Navigation Without Saving" do
it "No changes" do
@contacts.clickAddButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::ADD_HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::ADD_HEADER)
@contacts.clickPersonalContacts()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::HEADER); sleep 1 }
expect(getCount()).to eq(13)
end
it "Changes" do
@contacts.clickAddButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::ADD_HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::ADD_HEADER)
@personalContacts.setInput(PersonalContacts::FIRST_NAME, "XYZ")
@contacts.clickPersonalContacts()
!45.times{ break if (@modal.getConfirmationHeading() == "Confirmation"); sleep 1 }
expect(@modal.getConfirmationHeading()).to eq("Confirmation")
expect(@modal.getConfirmationMessage()).to eq("You have not saved your changes. You may continue without saving or return to the entry screen.")
expect(@modal.getConfirmButtonText()).to eq("Continue")
expect(@modal.getCancelButtonText()).to eq("Return")
@modal.clickReturnButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::ADD_HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::ADD_HEADER)
@contacts.clickPersonalContacts()
!45.times{ break if (@modal.getConfirmationHeading() == "Confirmation"); sleep 1 }
expect(@modal.getConfirmationHeading()).to eq("Confirmation")
expect(@modal.getConfirmationMessage()).to eq("You have not saved your changes. You may continue without saving or return to the entry screen.")
expect(@modal.getConfirmButtonText()).to eq("Continue")
expect(@modal.getCancelButtonText()).to eq("Return")
@modal.clickContinueButton()
!45.times{ break if (@personalContacts.getPrimaryHeader() == PersonalContacts::ADD_HEADER); sleep 1 }
expect(@personalContacts.getPrimaryHeader()).to eq(PersonalContacts::HEADER)
expect(getCount()).to eq(13)
end
end
end
end