306 lines
12 KiB
Ruby
306 lines
12 KiB
Ruby
#
|
|
# FAT005
|
|
#
|
|
class Test_05_FAT005 < Test::Unit::TestCase
|
|
|
|
def test_01_check_logon
|
|
# Logon as puw eden 1
|
|
login(PUW_CUST1, PUW_CUST1_PWD, 'y')
|
|
|
|
end
|
|
#
|
|
def test_02_check_cannot_nom_after_cont_wdw
|
|
@@ie.goto(ENTER_NOMS)
|
|
@@ie.wait
|
|
#
|
|
# Use the method to create a nomination 600 days in the future, contract has been created to allow 4 days in the future only.
|
|
#
|
|
setnomination('PUW_EDEN1', [[futuredate(600),'34246.60','0','0','0','136986.4','0','0','0']])
|
|
#
|
|
# TRUE if does find
|
|
#
|
|
assert(@@ie.contains_text('20512: Gas day does not fall within the contract dates'),'Nomination did not fail in expected manner: ' +geterrormess(@@ie))
|
|
end
|
|
#
|
|
def test_03_check_can_nom_within_cont_wdw
|
|
@@ie.goto(ENTER_NOMS)
|
|
@@ie.wait
|
|
#
|
|
# Use the method to create a nomination 6 days in the future, contract has been created to allow 4 days in the future only.
|
|
#
|
|
setnomination('PUW_EDEN1', [[futuredate(3),'34246.60','0','0','0','136986.40','0','0','0']])
|
|
#
|
|
# TRUE if does find
|
|
#
|
|
assert(@@ie.contains_text('Success!'),'Nomination did not succeed: ' +geterrormess(@@ie))
|
|
end
|
|
#
|
|
def test_04_check_can_multi_nom
|
|
# Logon link
|
|
login(PUW_CUST2, PUW_CUST2_PWD, 'y')
|
|
@@ie.goto(ENTER_NOMS)
|
|
@@ie.wait
|
|
#
|
|
# Use the method to create a nomination 6 days in the future, contract has been created to allow 4 days in the future only.
|
|
#
|
|
setmultinom('PUW_EDEN2', [[futuredate(1),'34246.60','0','0','0'],
|
|
[futuredate(2),'34246.60','0','0','0'],
|
|
[futuredate(3),'34246.60','0','0','0'],
|
|
[futuredate(4),'34246.60','0','0','0'],
|
|
[futuredate(5),'34246.60','0','0','0'],
|
|
[futuredate(6),'34246.60','0','0','0'],
|
|
[futuredate(7),'34246.60','0','0','0'],
|
|
[futuredate(1),'136986.40','0','0','0'],
|
|
[futuredate(2),'136986.40','0','0','0'],
|
|
[futuredate(3),'136986.40','0','0','0'],
|
|
[futuredate(4),'136986.40','0','0','0'],
|
|
[futuredate(5),'136986.40','0','0','0'],
|
|
[futuredate(6),'136986.40','0','0','0'],
|
|
[futuredate(7),'136986.40','0','0','0'],
|
|
])
|
|
#
|
|
# TRUE if does find
|
|
#
|
|
assert(@@ie.contains_text('Success!'),'Nomination did not succeed: ' +geterrormess(@@ie))
|
|
end
|
|
#
|
|
def test_05_can_view_nominations
|
|
#
|
|
|
|
@@ie.goto(VIEW_NOMS)
|
|
@@ie.wait
|
|
@@ie.button( :value, 'Query' ).click
|
|
@@ie.wait
|
|
assert(@@ie.contains_text('Enter query criteria for View Nominations'),'Could not access View nominations Query page ' +geterrormess(@@ie))
|
|
@@ie.text_field(:id, 'P_L_CONT_CONTRACT_NUMBER').set('PUW_EDEN2')
|
|
@@ie.button( :value, 'Find' ).click
|
|
@@ie.wait
|
|
#
|
|
assert(@@ie.contains_text('PUW_EDEN2'),'Could not find nomination identifier ' +geterrormess(@@ie))
|
|
#
|
|
assert(@@ie.contains_text(futuredate(1)),'Could not expected Start date ' +geterrormess(@@ie))
|
|
#
|
|
assert(@@ie.contains_text(futuredate(7)),'Could not expected End date ' +geterrormess(@@ie))
|
|
#
|
|
assert(@@ie.contains_text('Active'),'Nomination status is not active! ' +geterrormess(@@ie))
|
|
end
|
|
#
|
|
def test_06_check_can_enter_overlapping_multi_nom
|
|
@@ie.goto(ENTER_NOMS)
|
|
@@ie.wait
|
|
#
|
|
# Use the method to create a nomination 6 days in the future, contract has been created to allow 4 days in the future only.
|
|
#
|
|
setmultinom('PUW_EDEN2', [[futuredate(4),'34246.60','0','0','0'],
|
|
[futuredate(5),'34246.60','0','0','0'],
|
|
[futuredate(6),'34246.60','0','0','0'],
|
|
[futuredate(7),'34246.60','0','0','0'],
|
|
[futuredate(8),'34246.60','0','0','0'],
|
|
[futuredate(9),'34246.60','0','0','0'],
|
|
[futuredate(10),'34246.60','0','0','0'],
|
|
[futuredate(4),'136986.40','0','0','0'],
|
|
[futuredate(5),'136986.40','0','0','0'],
|
|
[futuredate(6),'136986.40','0','0','0'],
|
|
[futuredate(7),'136986.40','0','0','0'],
|
|
[futuredate(8),'136986.40','0','0','0'],
|
|
[futuredate(9),'136986.40','0','0','0'],
|
|
[futuredate(10),'136986.40','0','0','0'],
|
|
])
|
|
#
|
|
# TRUE if does find
|
|
#
|
|
assert(@@ie.contains_text('Success!'),'Overlapping nomination did not succeed: ' +geterrormess(@@ie))
|
|
end
|
|
#
|
|
def test_07_can_view_overlapping_nominations
|
|
#
|
|
@@ie.goto(VIEW_NOMS)
|
|
@@ie.wait
|
|
@@ie.button( :value, 'Query' ).click
|
|
@@ie.wait
|
|
assert(@@ie.contains_text('Enter query criteria for View Nominations'),'Could not access View nominations Query page ' +geterrormess(@@ie))
|
|
@@ie.text_field(:id, 'P_L_CONT_CONTRACT_NUMBER').set('PUW_EDEN2')
|
|
@@ie.button( :value, 'Find' ).click
|
|
@@ie.wait
|
|
#
|
|
assert(@@ie.contains_text('PUW_EDEN2'),'Could not find nomination identifier ' +geterrormess(@@ie))
|
|
#
|
|
assert(@@ie.contains_text(futuredate(4)),'Could not find expected Start date ' +geterrormess(@@ie))
|
|
#
|
|
assert(@@ie.contains_text(futuredate(10)),'Could not find expected End date ' +geterrormess(@@ie))
|
|
#
|
|
assert(@@ie.contains_text('Active'),'Nomination status is not active! ' +geterrormess(@@ie))
|
|
#
|
|
|
|
#
|
|
end
|
|
#
|
|
# Assumes that the system default is set to 20:00 and test is run prior to 20:00 hours
|
|
#
|
|
def test_08_can_submit_nom_before_system_submission_deadline
|
|
#
|
|
login(PUW_CUST1, PUW_CUST1_PWD, 'y')
|
|
@@ie.goto(ENTER_NOMS)
|
|
@@ie.wait
|
|
#
|
|
# Use the method to create a nomination 6 days in the future, contract has been created to allow 4 days in the future only.
|
|
#
|
|
setnomination('PUW_EDEN1', [[futuredate(1),'34246.60','0','0','0','136986.40','0','0','0']])
|
|
#
|
|
# TRUE if does find
|
|
#
|
|
assert(@@ie.contains_text('Success!'),'Nomination did not succeed: ' +geterrormess(@@ie))
|
|
puts "set the time to 07:00 nooow"
|
|
end
|
|
#
|
|
# Assumes tester is not in at 07:00
|
|
#
|
|
def test_09_cannot_submit_nom_after_system_submission_deadline
|
|
#
|
|
#dosql('begin UPDATE system_configuration SET value = \'07:00\'
|
|
# WHERE parameter = \'G_SUBMISSION_DEADLINE\'; commit; end; ')
|
|
#
|
|
|
|
sleep 120
|
|
puts "too late if you haven't set it!"
|
|
@@ie.goto(ENTER_NOMS)
|
|
@@ie.wait
|
|
#
|
|
# enter nom after 07:00 hrs ,should fail
|
|
#
|
|
setnomination('PUW_EDEN1', [[futuredate(1),'34246.60','0','0','0','136986.40','0','0','0']])
|
|
#
|
|
# TRUE if does not find
|
|
#
|
|
assert(@@ie.contains_text("20513: Cannot nominate for #{futuredate(1)} after #{futuredate(0)} 07:00."),'Nomination did not fail in expected manner: ' +geterrormess(@@ie))
|
|
#
|
|
#
|
|
end
|
|
#
|
|
def test_10_reset_sub_deadline
|
|
#
|
|
puts "set time back to 20:00, noooow!"
|
|
sleep 60
|
|
# assert(dosql('begin UPDATE system_configuration SET value = \'20:00\'
|
|
# WHERE parameter = \'G_SUBMISSION_DEADLINE\'; commit; end; '),'UPDATE submission deadline failed')
|
|
|
|
end
|
|
#
|
|
def test_11_can_send_confirmation
|
|
#
|
|
#Log in as puw admin
|
|
#
|
|
login(PUW_ADMIN, PUW_ADMIN_PWD, 'y')
|
|
#
|
|
@@ie.goto(CREATE_CONF)
|
|
@@ie.wait
|
|
#
|
|
@@ie.text_field(:id, 'p_gas_day').set(futuredate(1))
|
|
@@ie.button( :value, 'Find Nominations' ).click
|
|
@@ie.wait
|
|
#
|
|
assert_nil(@@ie.contains_text('<i>There are no nominations for the chosen gas day</i>'),'Expected nomination list, got (There are no nominations for the chosen gas day) ')
|
|
#
|
|
@@ie.checkbox(:index, 5).set
|
|
@@ie.checkbox(:index, 6).set
|
|
#
|
|
@@ie.button(:value,'Submit Selected').click
|
|
@@ie.wait
|
|
#
|
|
assert(@@ie.contains_text('Success!'),'Confirmation creation did not succeed: ' +geterrormess(@@ie))
|
|
#
|
|
@@ie.goto(APPROVE_CONF)
|
|
@@ie.wait
|
|
#
|
|
assert(@@ie.contains_text('PUW_EDEN1_'+(Time.now).strftime("%d%m%y")),'EDEN1 Confirmation creation not found: ')
|
|
assert(@@ie.contains_text('PUW_EDEN2_'+(Time.now).strftime("%d%m%y")),'EDEN2 Confirmation creation not found: ')
|
|
#
|
|
@@ie.checkbox(:index, 1).set
|
|
@@ie.checkbox(:index, 3).set
|
|
#
|
|
@@ie.button(:value,'Submit').click
|
|
@@ie.wait
|
|
#
|
|
#assert(@@ie.contains_text('Success!'),'Confirmation approval did not succeed: ' +geterrormess(@@ie))
|
|
assert_nil(@@ie.contains_text('PUW_EDEN1_'+(Time.now).strftime("%d%m%y")),'EDEN1 Confirmation approval did not succeed: ' +geterrormess(@@ie))
|
|
assert_nil(@@ie.contains_text('PUW_EDEN2_'+(Time.now).strftime("%d%m%y")),'EDEN2 Confirmation approval did not succeed: ' +geterrormess(@@ie))
|
|
#
|
|
end
|
|
#
|
|
#
|
|
#
|
|
def test_12_can_view_approved_Confirmations
|
|
#
|
|
@@ie.goto(VIEW_CONF)
|
|
@@ie.wait
|
|
#
|
|
assert_nil(@@ie.contains_text('No Records returned'),'Expected confirmation list, got "No Records returned" ')
|
|
assert(@@ie.contains_text('PUW_EDEN1_'+(Time.now).strftime("%d%m%y")),'EDEN1 Approved Confirmation not found: ')
|
|
assert(@@ie.contains_text('PUW_EDEN2_'+(Time.now).strftime("%d%m%y")),'EDEN2 Approved Confirmation not found: ')
|
|
#
|
|
end
|
|
#
|
|
#
|
|
#
|
|
def test_13_check_cannot_renom_for_current_day
|
|
#
|
|
#login as puw eden 1
|
|
login(PUW_CUST1, PUW_CUST1_PWD,'y')
|
|
@@ie.goto(ENTER_NOMS)
|
|
@@ie.wait
|
|
#
|
|
# Use the method to create a renomination today
|
|
#
|
|
setnomination('PUW_EDEN1', [[futuredate(0),'34246.60','0','0','0','136986.40','0','0','0']])
|
|
#
|
|
# TRUE if does find
|
|
#
|
|
assert(@@ie.contains_text('20514: Renomination window is not open, renominations cannot currently be accepted for today.'),'Renomination did not fail in expectd manner: ' +geterrormess(@@ie))
|
|
end
|
|
#
|
|
#
|
|
#
|
|
def test_14_can_enter_renom_wdw
|
|
#
|
|
#Log in as puw admin
|
|
#
|
|
|
|
login(PUW_ADMIN, PUW_ADMIN_PWD, 'y')
|
|
@@ie.goto(RENOM_WDW)
|
|
@@ie.wait
|
|
#
|
|
@@ie.text_field(:id, 'p_gas_day').set(futuredate(0))
|
|
# @@ie.select_list( :name , "p_wdw_open_hr").select((Time.now).strftime("%H"))
|
|
# @@ie.select_list( :name , "p_wdw_open_min").select("00")
|
|
@@ie.select_list( :name , "p_wdw_close_hr").select("23")
|
|
@@ie.select_list( :name , "p_wdw_close_min").select("00")
|
|
@@ie.text_field(:name, "p_message").set("Watir World")
|
|
#
|
|
@@ie.button(:value,'Select All').click
|
|
@@ie.wait
|
|
@@ie.button(:value,'Submit').click
|
|
@@ie.wait
|
|
#
|
|
assert(@@ie.contains_text('Success!'),'Renomination Window creation did not succeed: ' +geterrormess(@@ie))
|
|
#
|
|
end
|
|
#
|
|
#
|
|
#
|
|
def test_15_check_can_renom_for_current_day_with_wdw_open
|
|
#
|
|
#Log in as puw eden 1
|
|
#
|
|
login(PUW_CUST1, PUW_CUST1_PWD,'y')
|
|
@@ie.goto(ENTER_NOMS)
|
|
@@ie.wait
|
|
#
|
|
# Use the method to create a nomination 6 days in the future, contract has been created to allow 4 days in the future only.
|
|
#
|
|
setnomination('PUW_EDEN1', [[futuredate(0),'34246.60','0','0','0','136986.40','0','0','0']])
|
|
#
|
|
# TRUE if does find
|
|
#
|
|
assert(@@ie.contains_text('Success!'), 'Renomination was not created as expected: ' +geterrormess(@@ie))
|
|
end
|
|
end # Test_01_FAT005 |