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-2519: Assessment - Current and Desired State Questions ]", :regression => true do
before(:all) do
initializeConfigurations(BASE_URL)
removeCollection("assessments", "healthinventorydb")
initializeAllObjects
@accordion = ["Working the body",
"Recharge",
"Food and Drink",
"Personal Development",
"Family, Friends, and Co-Workers",
"Spirit and Soul",
"Surroundings",
"Power of the Mind" ]
!5.times{ break if (@eula.acceptEulaVisible?() == true); sleep 1 }
@eula.clickAccept()
!5.times{ break if (@landing.getTitle() == "My VA Health"); sleep 1 }
expect(@landing.getTitle()).to eq("My VA Health")
expect(@landing.getFooterText()).to eq("Not logged in")
@loginpage.passingByTheLandingPage()
!5.times{ break if (getPageTitle() == "Department of Veterans Affairs - Veteran Login Page"); sleep 1 }
@loginpage.loginAsVeteran("zztest.patient05")
!5.times{ break if (@main.getFooterText() == "Logged in as patient05, zztest"); sleep 1 }
expect(@main.getFooterText()).to eq("Logged in as patient05, zztest")
@main.clickNavMenu()
!5.times{ break if (@nav_menu.getNavMenuHeading() == "App Options"); sleep 1 }
expect(@nav_menu.getNavMenuHeading()).to eq("App Options")
expect(@nav_menu.isMyStoryButtonVisible).to eq(true)
waitForPageToFinishLoading
@driver.find_element(:css, "button[id='MyStory']").click
waitForPageToFinishLoading
!5.times{ break if (@my_story.getSecondaryHeader == "My Story"); sleep 1 }
expect(@my_story.getSecondaryHeader).to eq("My Story")
@my_story.clickAssessment
!5.times{ break if (@my_story.getPrimaryHeader == "Assessment"); sleep 1 }
expect(@my_story.getPrimaryHeader).to eq("Assessment")
end
after(:all) do
quitDriver()
end
it "AC #JRNL-3252|TC #JRNL-3309: Once a user makes a change, the Save Changes button is enabled in the title bar ", :broken => true do
resetCollection("assessments", "healthinventorydb", "assessments")
refreshBrowser
!5.times{ break if (@my_story.getPrimaryHeader == "Assessment"); sleep 1 }
expect(@my_story.getPrimaryHeader).to eq("Assessment")
for i in 0..(@accordion.length - 1)
puts "Accordion selected: " + @accordion[i]
expect(@my_story.isSaveChangesDisabled).to eq(true)
@my_story.clickAccordionByHeading(@accordion[i])
!5.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.getRateWhereYouAreLabelByHeading(@accordion[i])).to eq("Rate where you are (1 (low) to 5 (high))")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "2")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "Select")
!5.times{ break if (@my_story.isSaveChangesDisabled == false); sleep 1 }
@my_story.clickSaveChangesBtn
today = getDateNthDaysAgo(0,"%m/%d/%Y")
!5.times{ break if (@my_story.getLastUpdatedDateByHeading(@accordion[i]) == "Last updated: " + today.to_s); sleep 1 }
expect(@my_story.getLastUpdatedDateByHeading(@accordion[i])).to eq("Last updated: " + today.to_s)
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("Select")
@my_story.collapseAccordionByHeading(@accordion[i])
end
removeCollection("assessments", "healthinventorydb")
refreshBrowser
waitForPageToFinishLoading
!5.times{ break if (@my_story.getCollapsedAccordionLabelByHeading("Well-being") == "Well-being"); sleep 1 }
end
it "AC #JRNL-3238|TC #JRNL-3309: User is presented the self care sections, each with their own accordion. When the accordion is expanded, language is shown at the top of the section for each question group. ", :broken => true do
infoText = ['"Energy and Flexibility" Includes movement and physical activities like walking, dancing, gardening, sports, lifting weights, yoga, cycling, swimming, and working out in a gym.',
'"Sleep and Refresh" Getting enough rest, relaxation, and sleep.',
'"Nourish and Fuel" Eating healthy, balanced meals with plenty of fruits and vegetables each day. Drinking enough water and limiting sodas, sweetened drinks, and alcohol.',
'"Personal life and Work life" Learning and growing. Developing abilities and talents. Balancing responsibilities where you live, volunteer, and work.',
'"Relationships" Feeling listened to and connected to people you love and care about. The quality of your communication with family, friends and people you work with.',
'"Growing and Connecting" Having a sense of purpose and meaning in your life. Feeling connected to something larger than yourself. Finding strength in difficult times.',
'"Physical and Emotional" Feeling safe. Having comfortable, healthy spaces where you work and live. The quality of the lighting, color, air, and water. Decreasing unpleasant clutter, noises, and smells.',
'"Strengthen and Listen" Tapping into the power of your mind to heal and cope. Using mind-body techniques like relaxation, breathing, or guided imagery.'
]
for i in 0..(@accordion.length - 1)
@my_story.clickAccordionByHeading(@accordion[i])
!5.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.getAccordionLabelByHeading(@accordion[i])).to eq(@accordion[i])
expect(@my_story.getAccordionInfoTextByHeading(@accordion[i])).to eq(infoText[i])
end
end
it "AC #JRNL-3248|TC #JRNL-3309: Within the accordion for the self care areas, the user is able to answer respective questions using a drop-down of values from 1-5 for each - AC #JRNL-3252:Once a user makes a change, the Save Changes button is enabled in the title bar ", :broken => true do
#Enter a current state, with a label “Rate where you are (1 (low) to 5 (high))”
for i in 0..(@accordion.length - 1)
puts "selected Accordion : " + @accordion[i]
@my_story.clickAccordionByHeading(@accordion[i])
!5.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.getRateWhereYouAreLabelByHeading(@accordion[i])).to eq("Rate where you are (1 (low) to 5 (high))")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "1")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("1")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "2")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("2")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "3")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("3")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "4")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("4")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "5")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("5")
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
sleep 2
!5.times{ break if (@my_story.isSaveChangesDisabled == true); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("5")
#The “Select” option remains available for users to replace previous answers with null values
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "Select")
!5.times{ break if (@my_story.getRateWhereYouAreValueByHeading(@accordion[i]) == "Select"); sleep 1 }
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("Select")
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
today = getDateNthDaysAgo(0,"%m/%d/%Y")
!5.times{ break if (@my_story.getLastUpdatedDateByHeading(@accordion[i]) == "Last updated: " + today.to_s); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
#AC #JRNL-3252: Last updated dates are captured for null entries
expect(@my_story.getLastUpdatedDateByHeading(@accordion[i])).to eq("Last updated: " + today.to_s)
#Enter a desired state, with a label “Where would you like to be? (1 (low) to 5 (high))”
expect(@my_story.getWhereYouLikedToBeLabelByHeading(@accordion[i])).to eq("Where would you like to be? (1 (low) to 5 (high))")
#expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("Select")
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "1")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("1")
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "2")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("2")
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "3")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("3")
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "4")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("4")
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "5")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("5")
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
!5.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("5")
#The “Select” option remains available for users to replace previous answers with null values
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "Select")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("Select")
#AC #JRNL-3252: Last updated dates are captured for null entries
expect(@my_story.getLastUpdatedDateByHeading(@accordion[i])).to eq("Last updated: " + today.to_s)
end
end
it "AC #JRNL-3258|TC #JRNL-3309: Within the accordion for the self care areas, the user is able to add reasons associated with each value.", :broken => true do
for i in 0..(@accordion.length - 1)
#User can enter comments related to current state, under a section labeled “What are the reasons you choose this number?”
@my_story.clickAccordionByHeading(@accordion[i])
!5.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.getWhatAreTheReasonsLabelByHeading(@accordion[i])).to eq("What are the reasons you choose this number?")
text20 = "12345678901234567890"
@my_story.setReasonsByHeading(@accordion[i], text20)
expect(@my_story.getReasonByHeading(@accordion[i]).length).to eq(20)
expect(@my_story.getReasonByHeading(@accordion[i])).to eq(text20)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForReasons(@accordion[i])).to eq("235 characters left")
text255 = "123451234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
@my_story.setReasonsByHeading(@accordion[i], text255)
expect(@my_story.getReasonByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getReasonByHeading(@accordion[i])).to eq(text255)
expect(@my_story.getCountDownDisplayForReasons(@accordion[i])).to eq("0 characters left")
text260 = text255 + "ABCDE"
@my_story.setReasonsByHeading(@accordion[i], text260)
expect(@my_story.getReasonByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getReasonByHeading(@accordion[i])).to eq(text255)
expect(@my_story.getCountDownDisplayForReasons(@accordion[i])).to eq("0 characters left")
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
!5.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
expect(@my_story.getReasonByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getReasonByHeading(@accordion[i])).to eq(text255)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForReasons(@accordion[i])).to eq("0 characters left")
#User can enter comments related to desired state, under a section labeled “What changes could you make to help you get there?”
expect(@my_story.getWhatChangesYouCanMakeLabelByHeading(@accordion[i])).to eq("What changes could you make to help you get there?")
@my_story.setWhatChangesByHeading(@accordion[i], text20)
expect(@my_story.getWhatChangesByHeading(@accordion[i]).length).to eq(20)
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq(text20)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForWhatChanges(@accordion[i])).to eq("235 characters left")
@my_story.setWhatChangesByHeading(@accordion[i], text255)
expect(@my_story.getWhatChangesByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq(text255)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForWhatChanges(@accordion[i])).to eq("0 characters left")
@my_story.setWhatChangesByHeading(@accordion[i], text260)
expect(@my_story.getWhatChangesByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq(text255)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForWhatChanges(@accordion[i])).to eq("0 characters left")
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
!5.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
expect(@my_story.getWhatChangesByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq(text255)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForWhatChanges(@accordion[i])).to eq("0 characters left")
end
end
it "AC #JRNL-3240|TC #JRNL-3309: Prompt for Unsaved Changes", :broken => true do
@main.clickNavMenu()
waitForPageToFinishLoading
@driver.find_element(:css, "button[id='MyStory']").click
waitForPageToFinishLoading
#@my_story.clickPersonalValues
waitForPageToFinishLoading
@driver.find_element(:css, "button[class='btn btn-default personal-values']").click
waitForPageToFinishLoading
!5.times{ break if (@my_story.getWhatReallyQuestionLabelInPersonalValues == "What REALLY matters to you in your life?"); sleep 1 }
expect(@my_story.getPrimaryHeader).to eq("Personal Values")
waitForPageToFinishLoading
end
it "AC #JRNL-3243|TC #JRNL-3309: Until a value is entered (in any section), the 'Save Changes' button is disabled, and the disabled status is conveyed by the screen reader - AC #JRNL-3245|TC #JRNL-3309: When the user makes a change to the state of any input (in any section), the 'Save Changes' button becomes enabled on the right-hand of the title bar - AC #JRNL-3247|TC #JRNL-3309: Upon saving using the Save Changes button, the page is refreshed - AC#JRNL-3250: After an initial submission users are presented thier most recently submitted answers within each section", :broken => true do
waitForPageToFinishLoading
@my_story.clickAssessment
waitForPageToFinishLoading
#@my_story.clickAccordionByHeading(@accordion[i])
@driver.find_element(:css, "a[aria-controls='aa2']").click
waitForPageToFinishLoading
expect(@my_story.getPrimaryHeader).to eq("Assessment")
end
end
############################################################################ ORIGINAL CODE ################################################################
###########################################################################################################################################################
=begin
require_relative '../../globalized'
include Globalized
describe "[ Story #JRNL-2519: Assessment - Current and Desired State Questions ]", :regression => true do
before(:all) do
initializeConfigurations(BASE_URL)
removeCollection("assessments", "healthinventorydb")
initializeAllObjects
@accordion = ["Working the body",
"Recharge",
"Food and Drink",
"Personal Development",
"Family, Friends, and Co-Workers",
"Spirit and Soul",
"Surroundings",
"Power of the Mind" ]
!45.times{ break if (@eula.acceptEulaVisible?() == true); sleep 1 }
@eula.clickAccept()
!45.times{ break if (@landing.getTitle() == "My VA Health"); sleep 1 }
expect(@landing.getTitle()).to eq("My VA Health")
expect(@landing.getFooterText()).to eq("Not logged in")
@loginpage.passingByTheLandingPage()
!45.times{ break if (getPageTitle() == "Department of Veterans Affairs - Veteran Login Page"); sleep 1 }
@loginpage.loginAsVeteran("zztest.patient01")
!45.times{ break if (@main.getFooterText() == "Logged in as patient01, zztest"); sleep 1 }
expect(@main.getFooterText()).to eq("Logged in as patient01, zztest")
@main.clickNavMenu()
!45.times{ break if (@nav_menu.getNavMenuHeading() == "App Options"); sleep 1 }
expect(@nav_menu.getNavMenuHeading()).to eq("App Options")
expect(@nav_menu.isMyStoryButtonVisible).to eq(true)
@nav_menu.clickMyStory
!45.times{ break if (@my_story.getSecondaryHeader == "My Story"); sleep 1 }
expect(@my_story.getSecondaryHeader).to eq("My Story")
@my_story.clickAssessment
!45.times{ break if (@my_story.getPrimaryHeader == "Assessment"); sleep 1 }
expect(@my_story.getPrimaryHeader).to eq("Assessment")
end
after(:all) do
quitDriver()
end
it "AC #JRNL-3252|TC #JRNL-3309: Once a user makes a change, the Save Changes button is enabled in the title bar ", :broken => true do
resetCollection("assessments", "healthinventorydb", "assessments")
refreshBrowser
!45.times{ break if (@my_story.getPrimaryHeader == "Assessment"); sleep 1 }
expect(@my_story.getPrimaryHeader).to eq("Assessment")
for i in 0..(@accordion.length - 1)
puts "Accordion selected: " + @accordion[i]
expect(@my_story.isSaveChangesDisabled).to eq(true)
@my_story.clickAccordionByHeading(@accordion[i])
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.getRateWhereYouAreLabelByHeading(@accordion[i])).to eq("Rate where you are (1 (low) to 5 (high))")
expect(@my_story.getLastUpdatedDateByHeading(@accordion[i])).to eq("Last updated: 07/25/2014")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "2")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "Select")
!45.times{ break if (@my_story.isSaveChangesDisabled == false); sleep 1 }
@my_story.clickSaveChangesBtn
today = getDateNthDaysAgo(0,"%m/%d/%Y")
!45.times{ break if (@my_story.getLastUpdatedDateByHeading(@accordion[i]) == "Last updated: " + today.to_s); sleep 1 }
expect(@my_story.getLastUpdatedDateByHeading(@accordion[i])).to eq("Last updated: " + today.to_s)
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("Select")
@my_story.collapseAccordionByHeading(@accordion[i])
end
removeCollection("assessments", "healthinventorydb")
refreshBrowser
!45.times{ break if (@my_story.getCollapsedAccordionLabelByHeading("Well-being") == "Well-being"); sleep 1 }
expect(@my_story.getPrimaryHeader).to eq("Assessment")
end
it "AC #JRNL-3238|TC #JRNL-3309: User is presented the self care sections, each with their own accordion. When the accordion is expanded, language is shown at the top of the section for each question group. ", :broken => true do
infoText = ['"Energy and Flexibility" Includes movement and physical activities like walking, dancing, gardening, sports, lifting weights, yoga, cycling, swimming, and working out in a gym.',
'"Sleep and Refresh" Getting enough rest, relaxation, and sleep.',
'"Nourish and Fuel" Eating healthy, balanced meals with plenty of fruits and vegetables each day. Drinking enough water and limiting sodas, sweetened drinks, and alcohol.',
'"Personal life and Work life" Learning and growing. Developing abilities and talents. Balancing responsibilities where you live, volunteer, and work.',
'"Relationships" Feeling listened to and connected to people you love and care about. The quality of your communication with family, friends and people you work with.',
'"Growing and Connecting" Having a sense of purpose and meaning in your life. Feeling connected to something larger than yourself. Finding strength in difficult times.',
'"Physical and Emotional" Feeling safe. Having comfortable, healthy spaces where you work and live. The quality of the lighting, color, air, and water. Decreasing unpleasant clutter, noises, and smells.',
'"Strengthen and Listen" Tapping into the power of your mind to heal and cope. Using mind-body techniques like relaxation, breathing, or guided imagery.'
]
for i in 0..(@accordion.length - 1)
@my_story.clickAccordionByHeading(@accordion[i])
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.getAccordionLabelByHeading(@accordion[i])).to eq(@accordion[i])
expect(@my_story.getAccordionInfoTextByHeading(@accordion[i])).to eq(infoText[i])
end
end
it "AC #JRNL-3248|TC #JRNL-3309: Within the accordion for the self care areas, the user is able to answer respective questions using a drop-down of values from 1-5 for each - AC #JRNL-3252:Once a user makes a change, the Save Changes button is enabled in the title bar ", :broken => true do
#Enter a current state, with a label “Rate where you are (1 (low) to 5 (high))”
for i in 0..(@accordion.length - 1)
puts "selected Accordion : " + @accordion[i]
@my_story.clickAccordionByHeading(@accordion[i])
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.getRateWhereYouAreLabelByHeading(@accordion[i])).to eq("Rate where you are (1 (low) to 5 (high))")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("Select")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "1")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("1")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "2")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("2")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "3")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("3")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "4")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("4")
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "5")
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("5")
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
sleep 2
!45.times{ break if (@my_story.isSaveChangesDisabled == true); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("5")
#The “Select” option remains available for users to replace previous answers with null values
@my_story.selectRateWhereYouAreByHeading(@accordion[i], "Select")
!45.times{ break if (@my_story.getRateWhereYouAreValueByHeading(@accordion[i]) == "Select"); sleep 1 }
expect(@my_story.getRateWhereYouAreValueByHeading(@accordion[i])).to eq("Select")
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
today = getDateNthDaysAgo(0,"%m/%d/%Y")
!45.times{ break if (@my_story.getLastUpdatedDateByHeading(@accordion[i]) == "Last updated: " + today.to_s); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
#AC #JRNL-3252: Last updated dates are captured for null entries
expect(@my_story.getLastUpdatedDateByHeading(@accordion[i])).to eq("Last updated: " + today.to_s)
#Enter a desired state, with a label “Where would you like to be? (1 (low) to 5 (high))”
expect(@my_story.getWhereYouLikedToBeLabelByHeading(@accordion[i])).to eq("Where would you like to be? (1 (low) to 5 (high))")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("Select")
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "1")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("1")
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "2")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("2")
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "3")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("3")
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "4")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("4")
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "5")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("5")
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("5")
#The “Select” option remains available for users to replace previous answers with null values
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "Select")
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("Select")
#AC #JRNL-3252: Last updated dates are captured for null entries
expect(@my_story.getLastUpdatedDateByHeading(@accordion[i])).to eq("Last updated: " + today.to_s)
end
end
it "AC #JRNL-3258|TC #JRNL-3309: Within the accordion for the self care areas, the user is able to add reasons associated with each value.", :broken => true do
for i in 0..(@accordion.length - 1)
#User can enter comments related to current state, under a section labeled “What are the reasons you choose this number?”
@my_story.clickAccordionByHeading(@accordion[i])
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.getWhatAreTheReasonsLabelByHeading(@accordion[i])).to eq("What are the reasons you choose this number?")
expect(@my_story.getReasonByHeading(@accordion[i])).to eq("")
text20 = "12345678901234567890"
@my_story.setReasonsByHeading(@accordion[i], text20)
expect(@my_story.getReasonByHeading(@accordion[i]).length).to eq(20)
expect(@my_story.getReasonByHeading(@accordion[i])).to eq(text20)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForReasons(@accordion[i])).to eq("235 characters left")
text255 = "123451234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890"
@my_story.setReasonsByHeading(@accordion[i], text255)
expect(@my_story.getReasonByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getReasonByHeading(@accordion[i])).to eq(text255)
expect(@my_story.getCountDownDisplayForReasons(@accordion[i])).to eq("0 characters left")
text260 = text255 + "ABCDE"
@my_story.setReasonsByHeading(@accordion[i], text260)
expect(@my_story.getReasonByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getReasonByHeading(@accordion[i])).to eq(text255)
expect(@my_story.getCountDownDisplayForReasons(@accordion[i])).to eq("0 characters left")
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
expect(@my_story.getReasonByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getReasonByHeading(@accordion[i])).to eq(text255)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForReasons(@accordion[i])).to eq("0 characters left")
#User can enter comments related to desired state, under a section labeled “What changes could you make to help you get there?”
expect(@my_story.getWhatChangesYouCanMakeLabelByHeading(@accordion[i])).to eq("What changes could you make to help you get there?")
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq("")
@my_story.setWhatChangesByHeading(@accordion[i], text20)
expect(@my_story.getWhatChangesByHeading(@accordion[i]).length).to eq(20)
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq(text20)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForWhatChanges(@accordion[i])).to eq("235 characters left")
@my_story.setWhatChangesByHeading(@accordion[i], text255)
expect(@my_story.getWhatChangesByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq(text255)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForWhatChanges(@accordion[i])).to eq("0 characters left")
@my_story.setWhatChangesByHeading(@accordion[i], text260)
expect(@my_story.getWhatChangesByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq(text255)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForWhatChanges(@accordion[i])).to eq("0 characters left")
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
expect(@my_story.getWhatChangesByHeading(@accordion[i]).length).to eq(255)
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq(text255)
waitForPageToFinishLoading
expect(@my_story.getCountDownDisplayForWhatChanges(@accordion[i])).to eq("0 characters left")
end
end
it "AC #JRNL-3240|TC #JRNL-3309: Prompt for Unsaved Changes", :broken => true do
for i in 0..(@accordion.length - 1)
puts "Accordion Selected " + @accordion[i]
@my_story.clickAccordionByHeading(@accordion[i])
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
@my_story.setWhatChangesByHeading(@accordion[i], "Updated text")
@my_story.clickSaveChangesBtn()
!45.times{ break if (@my_story.getAccordionLabelByHeading(@accordion[i]) == @accordion[i]); sleep 1 }
expect(@my_story.getAccordionLabelByHeading(@accordion[i])).to eq(@accordion[i])
@my_story.setWhatChangesByHeading(@accordion[i], "Updated text - Edited")
@my_story.clickPersonalValues
!45.times{ break if (@modal.getConfirmationHeading() == "Confirmation"); sleep 1 }
expect(@modal.getConfirmationHeading()).to eq("Confirmation")
################################################################################################################################################################################################################
# THE CONFIRMATION MESSAGE TEXT IS DISPLAYING AS "You have not saved your changes. You may continue without saving or return to the entry screen." IN THE APP #
########################################################### SHOULD THE BELOW CODE BE UPDATED OR IS THIS A BUG ? ################################################################################################
################################################################################################################################################################################################################
# expect(@modal.getConfirmationMessage()).to eq("You have not saved your changes. You may continue without saving or return to the entry screen.")
################################################################################################################################################################################################################
# THE CONFIRMATION MESSAGE TEXT IS DISPLAYING AS "You have not saved your changes. You may continue without saving or return to the entry screen." IN THE APP #
########################################################### SHOULD THE ABOVE CODE BE UPDATED OR IS THIS A BUG ? ################################################################################################
################################################################################################################################################################################################################
@modal.clickReturnButton()
!45.times{ break if ( @modal.isConfirmationPopUpNotPresent); sleep 1 }
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq("Updated text - Edited")
@my_story.clickPersonalValues
!45.times{ break if (@modal.getConfirmationHeading() == "Confirmation"); sleep 1 }
expect(@modal.getConfirmationHeading()).to eq("Confirmation")
################################################################################################################################################################################################################
# THE CONFIRMATION MESSAGE TEXT IS DISPLAYING AS "You have not saved your changes. You may continue without saving or return to the entry screen." IN THE APP #
########################################################### SHOULD THE BELOW CODE BE UPDATED OR IS THIS A BUG ? ################################################################################################
################################################################################################################################################################################################################
# expect(@modal.getConfirmationMessage()).to eq("You have not saved your changes. You may continue without saving or return to the entry screen.")
################################################################################################################################################################################################################
# THE CONFIRMATION MESSAGE TEXT IS DISPLAYING AS "You have not saved your changes. You may continue without saving or return to the entry screen." IN THE APP #
########################################################### SHOULD THE ABOVE CODE BE UPDATED OR IS THIS A BUG ? ################################################################################################
################################################################################################################################################################################################################
@modal.clickContinueButton
!45.times{ break if (@my_story.getWhatReallyQuestionLabelInPersonalValues == "What REALLY matters to you in your life?"); sleep 1 }
expect(@my_story.getPrimaryHeader).to eq("Personal Values")
@my_story.clickAssessment
!45.times{ break if (@my_story.isAccordionCollapsed(@accordion[i]) == true); sleep 1 }
expect(@my_story.isAccordionCollapsed(@accordion[i])).to eq(true)
@my_story.clickAccordionByHeading(@accordion[i])
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.getPrimaryHeader).to eq("Assessment")
#Accordion is already open
expect(@my_story.getWhatChangesByHeading(@accordion[i])).to eq("Updated text")
end
end
it "AC #JRNL-3243|TC #JRNL-3309: Until a value is entered (in any section), the 'Save Changes' button is disabled, and the disabled status is conveyed by the screen reader - AC #JRNL-3245|TC #JRNL-3309: When the user makes a change to the state of any input (in any section), the 'Save Changes' button becomes enabled on the right-hand of the title bar - AC #JRNL-3247|TC #JRNL-3309: Upon saving using the Save Changes button, the page is refreshed - AC#JRNL-3250: After an initial submission users are presented thier most recently submitted answers within each section", :broken => true do
if(@my_story.isSaveChangesDisabled == false)
@my_story.clickSaveChangesBtn
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
expect(@my_story.isSaveChangesDisabled).to eq(true)
end
for i in 0..(@accordion.length - 1)
puts "Accordion Selected " + @accordion[i]
@my_story.clickAccordionByHeading(@accordion[i])
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
#AC JRNL-3243: the save chagnes button is disabled
expect(@my_story.isSaveChangesDisabled).to eq(true)
@my_story.selectWhereYouLikedToBeByHeading(@accordion[i], "4")
#AC JRNL-3245: the save changes button is enabled
expect(@my_story.isSaveChangesDisabled).to eq(false)
@my_story.clickSaveChangesBtn
!45.times{ break if (@my_story.getRateWhereYouAreLabelByHeading(@accordion[i]) == "Rate where you are (1 (low) to 5 (high))"); sleep 1 }
#AC JRNL-3247
#date format mm/dd/yyyy
#page is refreshed
expect(@my_story.isSaveChangesDisabled).to eq(true)
today = getDateNthDaysAgo(0,"%m/%d/%Y")
#AC JRNL-3250: "Last updated" label
expect(@my_story.getLastUpdatedDateByHeading(@accordion[i])).to eq("Last updated: " + today.to_s)
#update is saved
expect(@my_story.getWhereYouLikedToBeByHeading(@accordion[i])).to eq("4")
end
end
end
=end