mor_12_api_when_cli_exist_in_cc_group
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/test/load_delta_sql/sql/mor_eleven_extend
waitForElementPresent //body
open /billing/currencies/currencies
clickAndWait //a[contains(@href, '/billing/currencies/currencies_change_update_status/2')]
assertTextPresent Currency update disabled
open /billing/currencies/edit/2
type id=exchange_rate 2
clickAndWait css=input[type="image"]
assertTextPresent Currency details updated
clickAndWait id=icon_cross_curr_upd_enable_2
assertText id=icon_chech_curr_upd_disable_2
open /billing/cardgroups/edit/1
type id=tax1_value 10.0
type name=price_with_vat 100
type id=cardgroup_setup_fee 10.0
type id=cardgroup_daily_charge 10
select id=cardgroup_tell_balance_in_currency label=USD
clickAndWait name=commit
waitForTextPresent Card group was successfully updated
open /billing/functions/settings
click id=allow_api
click id=allow_get_api
type id=api_secret_key 123456
click id=xml_api_extension
click id=api_login_redirect_to_main
click id=api_allow_registration
clickAndWait name=commit
waitForTextPresent Settings saved
open /billing/cardgroups/new
type id=cardgroup_name cardgroup 3
type id=price_with_vat 25
select id=cardgroup_tell_balance_in_currency label=EUR
type id=cardgroup_number_length 5
type id=cardgroup_pin_length 3
type id=tax1_value 10
type id=tax2_name tax2
check id=tax2_enabled
type id=tax2_value 10.0
type id=tax3_name tax3
check id=tax3_enabled
type id=tax3_value 10.0
type id=tax4_name tax4
check id=tax4_enabled
type id=tax4_value 10.0
clickAndWait name=commit
waitForTextPresent Card group was successfully created
open /billing/cards/edit/1
type id=card_callerid 4444
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/test/test_api?cardgroup_id=3&callerid=4444&amount=100
waitForTextPresent 54f8c28dadcdf5340df808c9ca2facf074053da0
open /billing/cards/new?cg=3
type id=start_number 10002
type id=end_number 10010
clickAndWait name=commit
waitForTextPresent Cards created: 9
open /billing/cards/edit/27
type id=card_callerid 5555
select id=card[user_id] label=Test Accountant
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/cards/card_pay/27?cg=3
clickAndWait name=commit
assertTextPresent Total Price: 0.0000 USD
clickAndWait name=commit
assertTextPresent The card was sold
open /billing/cards/card_pay/1?cg=1
clickAndWait name=commit
assertTextPresent Total Price: 11.0924 USD
clickAndWait name=commit
assertTextPresent The card was sold
open /billing/test/test_api?cardgroup_id=1&callerid=5555&amount=300
waitForTextPresent ae47fba62de4bc6a1bbf43977fc45b308dc40844
open /billing/callc/logout
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=4444&amount=100&test=1&hash=54f8c28dadcdf5340df808c9ca2facf074053da0
verifyText css=status ok
verifyText css=id 31
verifyText css=cardgroup_id 3
assertText css=balance 41.0382
assertText css=balance_with_vat 60.0840
assertText css=callerid 4444
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=5555&amount=300&test=1&hash=ae47fba62de4bc6a1bbf43977fc45b308dc40844
verifyText css=status ok
verifyText css=id 32
verifyText css=cardgroup_id 1
verifyText css=balance 272.7273
assertText css=balance_with_vat 300.0000
verifyText css=callerid 5555
open /billing/api/cc_by_cli?u=accountant&p=accountant1&cardgroup_id=3&callerid=4444&amount=100&test=1&hash=54f8c28dadcdf5340df808c9ca2facf074053da0
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=accountant&p=accountant1&cardgroup_id=1&callerid=5555&amount=300&test=1&hash=ae47fba62de4bc6a1bbf43977fc45b308dc40844
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=reseller&p=reseller1&cardgroup_id=3&callerid=4444&amount=100&test=1&hash=54f8c28dadcdf5340df808c9ca2facf074053da0
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=101&p=1011&cardgroup_id=3&callerid=4444&amount=100&test=1&hash=54f8c28dadcdf5340df808c9ca2facf074053da0
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=user_reseller&p=user_reseller1&cardgroup_id=3&callerid=4444&amount=100&test=1&hash=54f8c28dadcdf5340df808c9ca2facf074053da0
waitForTextPresent Dont be so smart
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/payments/list
verifyTextPresent 1111111000 (7856)
verifyText id=amount_11 10.0840
verifyText id=amout_with_tax_11 11.0924
assertText id=amount_12 82.0764
assertText id=amout_with_tax_12 120.1681
verifyText id=amount_13 272.7273
verifyText id=amout_with_tax_13 300.0000
open /billing/cards/list?cg=3&clean=1
verifyNotText id=callerid_27 5555
verifyText id=callerid_31 4444
assertText id=balance_31 41.0382
storeText id=pin_30 pin1
verifyText css=img[alt="Check"]
open /billing/cards/list?cg=1&clean=1
verifyText //td[@id='number_1'] 1111111000
verifyText //td[@id='pin_1'] 7856
verifyNotText id=callerid_1 4444
verifyText //td[@id='balance_1'] 0.0000
verifyElementPresent xpath=(//img[@alt='Cross'])[2]
verifyText id=callerid_32 5555
verifyText id=balance_32 272.7273
verifyElementPresent css=img[alt="Check"]
open /billing/users/list
verifyText id=balance_0 0.0000
verifyText id=balance_4 0.0000
verifyText id=balance_3 0.0000
verifyText id=balance_2 0.0000
open /billing/test/test_api?cardgroup_id=1&callerid=4444&amount=100&pin=7856
waitForTextPresent 118f394ea0b031da71270d528fdfd7464e24d799
open /billing/test/test_api?cardgroup_id=3&callerid=5555&amount=300&pin=1111
waitForTextPresent b2397515565c0438279dcbfd28c742f63d3ed303
open /billing/test/test_api?cardgroup_id=3&callerid=5555&amount=300&pin=${pin1}
storeText css=body hash1
open /billing/callc/logout
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=4444&amount=100&pin=7856&test=1&hash=118f394ea0b031da71270d528fdfd7464e24d799
waitForTextPresent ok
verifyText css=id 1
verifyText css=cardgroup_id 1
assertText css=balance 41.0382
assertText css=balance_with_vat 45.1420
verifyText css=callerid 4444
verifyText css=pin 7856
verifyText css=number 1111111000
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=5555&amount=300&pin=1111&test=1&hash=b2397515565c0438279dcbfd28c742f63d3ed303
waitForTextPresent PIN number not found
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=5555&amount=300&pin=${pin1}&test=1&hash=${hash1}
waitForTextPresent Incorrect hash
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=5555&amount=300&pin=${pin1}&test=1&hash=${hash1}
verifyText css=status ok
verifyText css=id 30
verifyText css=cardgroup_id 3
assertText css=balance 272.7273
assertText css=balance_with_vat 399.3000
verifyText css=callerid 5555
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/test/load_delta_sql/sql/set_all_cards_not_sold
open /billing/cards/card_pay/1?cg=1
clickAndWait name=commit
clickAndWait name=commit
waitForTextPresent The card was sold
open /billing/cards/card_pay/1?cg=1
type id=amount 100
clickAndWait name=commit
clickAndWait name=commit
waitForTextPresent Payment added
open /billing/cards/edit/1
type id=card_callerid 2222
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/cards/card_pay/30?cg=3
clickAndWait name=commit
clickAndWait name=commit
waitForTextPresent The card was sold
open /billing/cards/card_pay/30?cg=3
type id=amount 100
clickAndWait name=commit
clickAndWait name=commit
waitForTextPresent Payment added
open /billing/cards/edit/30
type id=card_callerid 3333
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/callc/logout
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=4444&amount=100&pin=7856&test=1&hash=118f394ea0b031da71270d528fdfd7464e24d799
assertTextPresent Cannot sell already sold card
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=5555&amount=300&pin=${pin1}&test=1&hash=${hash1}
assertTextPresent Cannot sell already sold card
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/cards/edit/27
type id=card_callerid 4444
clickAndWait name=commit
assertTextPresent Card was successfully updated
open /billing/cards/edit/9
type id=card_callerid 5555
clickAndWait name=commit
assertTextPresent Card was successfully updated
open /billing/callc/logout
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=4444&amount=100&pin=7856&test=1&hash=118f394ea0b031da71270d528fdfd7464e24d799
assertTextPresent PIN number balance is zero
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/test/load_delta_sql/sql/set_all_cards_not_sold
open /billing/callc/logout
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=4444&amount=100&pin=7856&test=1&hash=118f394ea0b031da71270d528fdfd7464e24d799
assertTextPresent PIN number balance is zero
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=5555&amount=300&pin=${pin1}&test=1&hash=${hash1}
assertText css=status ok
assertText css=id 30
assertText css=balance 351.1127
assertText css=balance_with_vat 514.0640
assertText css=callerid 5555
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=5555&amount=300&pin=${pin1}&test=1&hash=${hash1}
assertText css=error PIN number not found
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/payments/list
assertText id=amount_16 41.0382
assertText id=amout_with_tax_16 45.1420
assertText id=amount_17 100.0000
assertText id=amout_with_tax_17 110.0000
assertText id=amount_18 272.7273
assertText id=amout_with_tax_18 399.3000
assertText id=amount_19 100.0000
assertText id=amout_with_tax_19 146.4100
assertText id=amount_20 10.0840
assertText id=amout_with_tax_20 11.0924
open /billing/cards/list?cg=3&clean=1
verifyText id=callerid_30 5555
assertText id=balance_30 351.1127
verifyElementPresent css=img[alt="Check"]
open /billing/cards/list?cg=1&clean=1
verifyText id=callerid_1 2222
assertText id=balance_1 131.9473
open /billing/users/list
verifyText id=balance_0 0.0000
verifyText id=balance_4 0.0000
verifyText id=balance_3 0.0000
verifyText id=balance_2 0.0000
open /billing/cards/edit/12
type id=card_callerid 7777
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/cards/card_pay/24?cg=3
clickAndWait name=commit
clickAndWait name=commit
waitForTextPresent The card was sold
open /billing/cards/card_pay/24?cg=3
type id=amount 40
clickAndWait name=commit
clickAndWait name=commit
waitForTextPresent Payment added
open /billing/cards/edit/24
type id=card_callerid 8888
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/cards/list?cg=3&clean=1
storeText id=pin_24 pin3
open /billing/cards/edit/29
type id=card_callerid 6666
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/test/test_api?cardgroup_id=3&callerid=6666&amount=150&pin=6930
waitForTextPresent 5c1d677d0072f7cbc394335e1436ec9aef613673
open /billing/test/test_api?cardgroup_id=1&callerid=7777&amount=50&pin=${pin3}
storeText css=body hash2
open /billing/callc/logout
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=3&callerid=6666&amount=150&pin=6930&test=1&hash=5c1d677d0072f7cbc394335e1436ec9aef613673
assertTextPresent PIN number balance is zero
open /billing/api/cc_by_cli?u=admin&p=admin1&cardgroup_id=1&callerid=7777&amount=50&pin=${pin3}&test=1&hash=${hash2}
verifyText css=status ok
verifyText css=id 24
verifyText css=cardgroup_id 3
assertText css=balance 37.4046
assertText css=balance_with_vat 54.7640
verifyText css=callerid 7777
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/payments/list
assertText id=amount_24 10.0840
assertText id=amout_with_tax_24 11.0924
assertText id=amount_23 40.0000
assertText id=amout_with_tax_23 58.5640
open /billing/cards/list?cg=3&clean=1
assertText id=callerid_29 6666
assertText id=balance_29 0.0000
assertText id=callerid_30 5555
assertText id=balance_30 351.1127
assertText id=callerid_24 7777
assertText id=balance_24 37.4046
assertText id=callerid_27 4444
assertText id=balance_27 0.0000
verifyText css=#sold_29 > img[alt="Cross"]
open /billing/cards/list?cg=1&clean=1
verifyNotText id=callerid_12 8888
verifyNotText id=balance_12 37.4046
verifyText id=balance_12 0.0000
verifyText css=#sold_12 > img[alt="Cross"]
open /billing/test/load_delta_sql/acc_groups
waitForElementPresent //body
open /billing/permissions/edit/12?group_type=reseller
click id=calling_cards_2
clickAndWait name=commit
waitForTextPresent Group was updated
open /billing/users/edit/3
clickAndWait css=#confirm_without_message > input[name="commit"]
waitForTextPresent User's settings succesfully changed: Test Reseller
open /billing/permissions/edit/11?group_type=accountant
click id=callingcard_pin_2
click id=callingcard_manage_2
click id=see_financial_data_2
click id=cli_ivr_2
click id=device_edit_opt_1_2
click id=device_edit_opt_2_2
click id=device_edit_opt_3_2
click id=device_edit_opt_4_2
click id=device_pin_2
click id=device_password_2
click id=voicemail_password_2
click id=device_create_2
click id=device_manage_2
click id=manage_dids_opt_1_2
click id=invoices_manage_2
click id=monitorings_manage_2
click id=payments_manage_2
click id=services_manage_2
click id=manage_subscriptions_opt_1_2
click id=tariff_manage_2
click id=user_create_opt_1_2
click id=user_create_opt_2_2
click id=user_create_opt_3_2
click id=user_create_2
click id=user_create_opt_4_2
click id=user_create_opt_5_2
click id=user_create_opt_6_2
click id=user_create_opt_7_2
click id=vouchers_manage_2
click id=user_manage_2
clickAndWait name=commit
waitForTextPresent Group was updated
open /billing/users/edit/4
clickAndWait css=#confirm_without_message > input[name="commit"]
waitForTextPresent User's settings succesfully changed: Test
open /billing/test/test_api?cardgroup_id=1&callerid=8888&amount=50&pin=${pin3}
storeText css=body hash6
open /billing/cards/act?cg=3
type id=start_number 10007
type id=end_number 10007
click id=delete_and_hide
clickAndWait name=commit
assertTextPresent Card group: cardgroup 3
clickAndWait name=commit
assertTextPresent 0 Cards were successfully deleted
assertTextPresent 1 Cards were hidden
open /billing/cards/edit/4
type id=card_callerid 4444
clickAndWait name=commit
assertTextPresent Card was successfully updated
assertElementPresent css=img[alt="Cross"]
open /billing/callc/logout
open /billing/api/cc_by_cli?u=accountant&p=accountant1&cardgroup_id=3&callerid=4444&amount=100&test=1&hash=54f8c28dadcdf5340df808c9ca2facf074053da0
verifyText css=status ok
assertText css=id 33
assertText css=cardgroup_id 3
assertText css=balance 41.0382
assertText css=balance_with_vat 60.0840
assertText css=callerid 4444
open /billing/api/cc_by_cli?u=accountant&p=accountant1&cardgroup_id=1&callerid=5555&amount=300&test=1&hash=ae47fba62de4bc6a1bbf43977fc45b308dc40844
verifyText css=status ok
assertText css=id 34
assertText css=cardgroup_id 1
assertText css=balance 591.9206
assertText css=balance_with_vat 651.1127
assertText css=callerid 5555
open /billing/api/cc_by_cli?u=reseller&p=reseller1&cardgroup_id=3&callerid=4444&amount=100&test=1&hash=54f8c28dadcdf5340df808c9ca2facf074053da0
waitForTextPresent You do not have permission to access card
open /billing/api/cc_by_cli?u=101&p=1011&cardgroup_id=3&callerid=4444&amount=100&test=1&hash=54f8c28dadcdf5340df808c9ca2facf074053da0
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=user_reseller&p=user_reseller1&cardgroup_id=3&callerid=4444&amount=100&test=1&hash=54f8c28dadcdf5340df808c9ca2facf074053da0
waitForTextPresent Dont be so smart
open /billing/api/cc_by_cli?u=accountant&p=accountant1&cardgroup_id=1&callerid=8888&amount=50&pin=${pin3}&test=1&hash=${hash6}
assertText css=error > error Cannot sell already sold card
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/cards/list?cg=1&clean=1
assertText id=callerid_34 5555
assertText id=balance_34 591.9206
verifyElementPresent css=img[alt="Check"]
open /billing/cards/list?cg=3&clean=1
assertText id=callerid_33 4444
assertText id=balance_33 41.0382
assertElementPresent css=#sold_33 > img[alt="Check"]
open /billing/callc/logout
type login_username accountant
type login_psw accountant1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/payments/list
assertText id=amount_17 100.0000
assertText id=amout_with_tax_17 110.0000
assertText id=amount_18 272.7273
assertText id=amout_with_tax_18 399.3000
assertText id=amount_19 100.0000
assertText id=amout_with_tax_19 146.4100
assertText id=amount_21 682.0572
assertText id=amout_with_tax_21 998.6000
assertText id=currency_18 USD
assertText id=currency_19 USD
assertText id=currency_21 EUR
open /billing/callc/logout
type login_username reseller
type login_psw reseller1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/cardgroups/new
type id=cardgroup_name cardgroup
type id=cardgroup_setup_fee 10.0
type name=price_with_vat 20.0000
select id=cardgroup_tell_balance_in_currency label=EUR
type id=tax1_value 50
clickAndWait name=commit
waitForTextPresent Card group was successfully created
open /billing/cards/new?cg=4
type id=start_number 1111111114
type id=end_number 1111111124
clickAndWait name=commit
waitForTextPresent Cards created: 11
clickAndWait css=input[type="submit"]
storeText id=pin_36 pinre1
open /billing/cards/edit/36
type id=card_callerid asdfghj
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/cards/edit/37
type id=card_callerid sdfghjk
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/cardgroups/new
type id=cardgroup_name cardgroup 2 re
type name=price_with_vat 67.0000
type id=cardgroup_setup_fee 60.0
select id=cardgroup_tell_balance_in_currency label=EUR
clickAndWait name=commit
waitForTextPresent Card group was successfully created
open /billing/cards/new?cg=5
type id=start_number 1111111125
type id=end_number 1111111129
clickAndWait name=commit
waitForTextPresent Cards created: 5
open /billing/cards/edit/47
type id=card_callerid 09090909
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/cards/edit/49
type id=card_callerid 08080808
clickAndWait name=commit
waitForTextPresent Card was successfully updated
open /billing/callc/logout
type login_username admin
type login_psw admin1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/test/test_api?cardgroup_id=4&callerid=09090909&amount=55
waitForTextPresent 6def0e9d462c376f47f31ab231447263da3c9843
open /billing/test/test_api?cardgroup_id=4&callerid=08080808&amount=50&pin=${pinre1}
storeText css=body hashre1
open /billing/callc/logout
open /billing/api/cc_by_cli?u=reseller&p=reseller1&cardgroup_id=4&callerid=09090909&amount=55&test=1&hash=6def0e9d462c376f47f31ab231447263da3c9843
verifyText css=status ok
assertText css=id 51
assertText css=cardgroup_id 4
assertText css=balance 63.0000
assertText css=balance_with_vat 94.5000
assertText css=callerid 09090909
open /billing/api/cc_by_cli?u=reseller&p=reseller1&cardgroup_id=4&callerid=08080808&amount=50&pin=${pinre1}&test=1&hash=${hashre1}
verifyText css=status ok
verifyText css=id 36
verifyText css=cardgroup_id 4
verifyText css=balance 80.3333
verifyNotText css=callerid asdfghj
verifyText css=callerid 08080808
open /billing/callc/logout
type login_username reseller
type login_psw reseller1
clickAndWait commit
verifyTextPresent Succesfully logged in
open /billing/cards/list?cg=4&clean=1
verifyText id=callerid_37 sdfghjk
verifyText id=balance_37 13.3333
verifyText id=callerid_51 09090909
assertText id=balance_51 63.0000
verifyText id=callerid_36 08080808
verifyText id=balance_36 80.3333
open /billing/cards/list?cg=5&clean=1
verifyText id=callerid_49
verifyNotText id=balance_49 80.3333
verifyText id=balance_49 0.0000
open /billing/payments/list
assertText id=amount_27 126.0000
assertText id=amout_with_tax_27 189.0000
assertText id=amount_28 134.0000
assertText id=amout_with_tax_28 134.0000
assertText id=amount_29 26.6667
assertText id=amout_with_tax_29 40.0000