Skip to content

Account

TestAccount

Bases: UccTester

Source code in tests/ui/test_configuration_page_account_tab.py
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
class TestAccount(UccTester):
    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_default_rows_in_table(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies the default number of rows in the table"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        self.assert_util(account.table.get_row_count, 0)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_sort_functionality(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_multiple_account
    ):
        """Verifies sorting functionality for name column"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.sort_column("Name")
        sort_order = account.table.get_sort_order()
        column_values = list(account.table.get_column_values("Name"))
        column_values = list(str(item) for item in column_values)
        sorted_values = sorted(column_values, key=str.lower)
        self.assert_util(sort_order["header"].lower(), "name")
        self.assert_util(column_values, sorted_values)
        self.assert_util(sort_order["ascending"], True)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_count(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_multiple_account
    ):
        """Verifies count on table"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        self.assert_util(
            account.table.get_count_title,
            f"{len(account.backend_conf.get_all_stanzas())} Items",
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_filter_functionality_negative(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the filter functionality (Negative)"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.set_filter("hello")
        self.assert_util(account.table.get_row_count, 0)
        self.assert_util(
            account.table.get_count_title,
            f"{account.table.get_row_count()} Item",
        )
        account.table.clean_filter()

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_filter_functionality_positive(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the filter functionality (Positive)"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.set_filter("TestAccount")
        self.assert_util(account.table.get_row_count, 1)
        self.assert_util(
            account.table.get_count_title,
            f"{account.table.get_row_count()} Item",
        )
        account.table.clean_filter()

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_pagination(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_multiple_account
    ):
        """Verifies pagination list"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        name_column_page1 = account.table.get_column_values("name")
        account.table.switch_to_next()
        name_column_page2 = account.table.get_column_values("name")
        self.assert_util(name_column_page1, name_column_page2, "!=")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_add_valid_title(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies the title of the 'Add Entity'"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(
            account.entity.title.container.get_attribute("textContent").strip(),
            "Add Account",
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_edit_valid_title(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the title of the 'Edit Entity'"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.edit_row(_ACCOUNT_CONFIG["name"])
        self.assert_util(
            account.entity.title.container.get_attribute("textContent").strip(),
            "Update Account",
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_clone_valid_title(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the title of the 'Clone Entity'"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.clone_row(_ACCOUNT_CONFIG["name"])
        self.assert_util(
            account.entity.title.container.get_attribute("textContent").strip(),
            "Clone Account",
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_delete_valid_title(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the title of the 'Delete Entity'"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.delete_row(_ACCOUNT_CONFIG["name"], prompt_msg=True)
        self.assert_util(
            account.entity.title.container.get_attribute("textContent").strip(),
            "Delete Confirmation",
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_add_close_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies close functionality at time of add"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(account.entity.close, True)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_add_cancel_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies cancel functionality at time of add"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(account.entity.cancel, True)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_delete_close_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies close functionality at time of delete"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        self.assert_util(
            account.table.delete_row,
            True,
            left_args={"name": _ACCOUNT_CONFIG["name"], "close": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_delete_cancel_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies cancel functionality at time of delete"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

        self.assert_util(
            account.table.delete_row,
            True,
            left_args={"name": _ACCOUNT_CONFIG["name"], "cancel": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_edit_close_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies close functionality at time of edit"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.edit_row(_ACCOUNT_CONFIG["name"])
        self.assert_util(account.entity.close, True)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_edit_cancel_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies cancel functionality at time of edit"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.edit_row(_ACCOUNT_CONFIG["name"])
        self.assert_util(account.entity.cancel, True)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_clone_close_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies close functionality at time of clone"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.clone_row(_ACCOUNT_CONFIG["name"])
        self.assert_util(account.entity.close, True)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_clone_cancel_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies cancel functionality at time of clone"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.clone_row(_ACCOUNT_CONFIG["name"])
        self.assert_util(account.entity.cancel, True)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_delete_valid_prompt_message(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the prompt message of the 'Delete Entity'"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        prompt_message = account.table.delete_row(
            _ACCOUNT_CONFIG["name"], prompt_msg=True
        )
        self.assert_util(
            prompt_message,
            'Are you sure you want to delete "{}" ? Ensure that no input is '
            'configured with "{}" as this will stop data collection for '
            "that input.".format(_ACCOUNT_CONFIG["name"], _ACCOUNT_CONFIG["name"]),
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_required_field_username(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies required field username"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.environment.select("Value2")
        account.entity.multiple_select.select("Option Two")
        account.entity.password.set_value("TestEditPassword")
        account.entity.security_token.set_value("TestEditToken")
        account.entity.account_radio.select("No")
        self.assert_util(
            account.entity.save,
            "Field Username is required",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_required_field_password(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies required field password"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.environment.select("Value2")
        account.entity.multiple_select.select("Option Two")
        account.entity.username.set_value("TestEditUser")
        account.entity.security_token.set_value("TestEditToken")
        account.entity.account_radio.select("No")
        self.assert_util(
            account.entity.save,
            "Field Password is required",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_encrypted_field_password(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies if the password field is masked or not in the Textbox"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        textbox_type = account.entity.password.get_type()
        self.assert_util(textbox_type, "password")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_required_field_name(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies required field name"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.environment.select("Value2")
        account.entity.multiple_select.select("Option Two")
        account.entity.username.set_value("TestEditUser")
        account.entity.password.set_value("TestEditPassword")
        account.entity.security_token.set_value("TestEditToken")
        account.entity.account_radio.select("No")
        self.assert_util(
            account.entity.save,
            "Field Name is required",
            left_args={"expect_error": True},
        )
        account.entity.name.set_value("abc")
        self.assert_util(account.entity.is_error_closed, True)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_basic_fields_label_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies basic account field label"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(account.entity.name.get_input_label, "Name")
        self.assert_util(
            account.entity.environment.get_input_label, "Example Environment"
        )
        self.assert_util(
            account.entity.example_checkbox.get_input_label, "Example Checkbox"
        )
        self.assert_util(account.entity.account_radio.get_input_label, "Example Radio")
        self.assert_util(
            account.entity.multiple_select.get_input_label, "Example Multiple Select"
        )
        self.assert_util(account.entity.auth_key.get_input_label, "Auth Type")
        self.assert_util(account.entity.username.get_input_label, "Username")
        self.assert_util(account.entity.password.get_input_label, "Password")
        self.assert_util(
            account.entity.security_token.get_input_label, "Security Token"
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_oauth_fields_label_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies oauth account field label"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.auth_key.select("OAuth 2.0 Authentication")
        self.assert_util(account.entity.name.get_input_label, "Name")
        self.assert_util(
            account.entity.environment.get_input_label, "Example Environment"
        )
        self.assert_util(
            account.entity.example_checkbox.get_input_label, "Example Checkbox"
        )
        self.assert_util(account.entity.account_radio.get_input_label, "Example Radio")
        self.assert_util(
            account.entity.multiple_select.get_input_label, "Example Multiple Select"
        )
        self.assert_util(account.entity.auth_key.get_input_label, "Auth Type")
        self.assert_util(account.entity.client_id.get_input_label, "Client Id")
        self.assert_util(account.entity.client_secret.get_input_label, "Client Secret")
        self.assert_util(account.entity.redirect_url.get_input_label, "Redirect url")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.account
    def test_account_help_text_entity(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies help text for the field name"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(
            account.entity.name.get_help_text, "Enter a unique name for this account."
        )
        self.assert_util(
            account.entity.example_checkbox.get_help_text,
            "This is an example checkbox for the account entity",
        )
        self.assert_util(
            account.entity.account_radio.get_help_text,
            "This is an example radio button for the account entity",
        )
        self.assert_util(
            account.entity.multiple_select.get_help_text,
            "This is an example multipleSelect for account entity",
        )
        self.assert_util(
            account.entity.username.get_help_text,
            "Enter the username for this account.",
        )
        self.assert_util(
            account.entity.password.get_help_text,
            "Enter the password for this account.",
        )
        self.assert_util(
            account.entity.security_token.get_help_text, "Enter the security token."
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_required_field_example_multiple_select(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies required field example multiple select"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.environment.select("Value2")
        account.entity.username.set_value("TestEditUser")
        account.entity.password.set_value("TestEditPassword")
        account.entity.security_token.set_value("TestEditToken")
        account.entity.account_radio.select("No")
        self.assert_util(
            account.entity.save,
            "Field Example Multiple Select is required",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_required_field_client_id(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies required field client id"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.environment.select("Value2")
        account.entity.account_radio.select("No")
        account.entity.multiple_select.select("Option Two")
        account.entity.auth_key.select("OAuth 2.0 Authentication")
        self.assert_util(
            account.entity.save,
            "Field Client Id is required",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_required_field_client_secret(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies required field client secret"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.auth_key.select("OAuth 2.0 Authentication")
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.multiple_select.select("Option One")
        account.entity.account_radio.select("No")
        account.entity.client_id.set_value("TestClientId")
        self.assert_util(
            account.entity.save,
            "Field Client Secret is required",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_encrypted_field_client_secret(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies if the password field is masked or not in the Textbox"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.auth_key.select("OAuth 2.0 Authentication")
        textbox_type = account.entity.client_secret.get_type()
        self.assert_util(textbox_type, "password")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_valid_account_name(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies whether adding special characters, number in starting of name field displays validation error"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
        account.entity.password.set_value(_ACCOUNT_CONFIG["password"])
        account.entity.name.set_value("123TestAccount")
        self.assert_util(
            account.entity.save,
            "Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.",
            left_args={"expect_error": True},
        )
        account.entity.name.set_value("TestAccount&")
        self.assert_util(
            account.entity.save,
            "Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.",
            left_args={"expect_error": True},
        )
        account.entity.name.set_value("a" * 51)
        self.assert_util(
            account.entity.save,
            "Length of ID should be between 1 and 50",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_valid_length_name(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies the name field should not be more than 50 characters"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
        account.entity.password.set_value(_ACCOUNT_CONFIG["password"])
        account.entity.name.set_value("t" * 51)
        self.assert_util(
            account.entity.save,
            "Length of ID should be between 1 and 50",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_default_value_example_environment(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies default value of example environment"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
        self.assert_util(account.entity.environment.get_value, "Value1")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_list_example_environment(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies example environment list dropdown"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(
            account.entity.environment.list_of_values, ["Value1", "Value2", "Other"]
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_default_value_auth_type(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies default value of auth type"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(account.entity.auth_key.get_value, "basic")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_list_auth_type(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies auth type list dropdown"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(
            account.entity.auth_key.list_of_values(),
            ["Basic Authentication", "OAuth 2.0 Authentication"],
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_checked_example_checkbox(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies Check/Uncheck in example checkbox"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.example_checkbox.check()
        self.assert_util(account.entity.example_checkbox.is_checked, True)
        account.entity.example_checkbox.uncheck()
        self.assert_util(account.entity.example_checkbox.is_checked, False)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_select_value_example_environment(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies example environment select value"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.environment.select("Value2")
        self.assert_util(account.entity.environment.get_value, "Value2")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_list_example_multiple_select(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies example multiple select list dropdown"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(
            account.entity.multiple_select.list_of_values(),
            ["Option One", "Option Two"],
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_select_value_example_multiple_select(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies example multiple select value"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.multiple_select.select("Option One")
        account.entity.multiple_select.select("Option Two")
        self.assert_util(
            account.entity.multiple_select.get_values, ["Option One", "Option Two"]
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_search_value_example_multiple_select(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies example multiple select search functionality"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(
            account.entity.multiple_select.search_get_list,
            ["Option One"],
            left_args={"value": "Option One"},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_default_value_example_radio(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies default value of example radio"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        self.assert_util(account.entity.account_radio.get_value, "Yes")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_add_account_duplicate_name(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies by saving an entity with duplicate name at time of add it displays and error"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.multiple_select.select("Option One")
        account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
        account.entity.password.set_value(_ACCOUNT_CONFIG["password"])
        account.entity.account_radio.select("Yes")
        self.assert_util(
            account.entity.save,
            "Name {} is already in use".format(_ACCOUNT_CONFIG["name"]),
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    @pytest.mark.sanity_test
    def test_account_delete_row_frontend_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the frontend delete functionlity"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.delete_row(_ACCOUNT_CONFIG["name"])
        account.table.wait_for_rows_to_appear(0)
        self.assert_util(_ACCOUNT_CONFIG["name"], account.table.get_table, "not in")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_edit_uneditable_field_name(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the frontend uneditable fields at time of edit of the account"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.edit_row(_ACCOUNT_CONFIG["name"])
        self.assert_util(account.entity.name.is_editable, False)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_credentials_encrypted_value(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the default number of rows in the table"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.wait_for_rows_to_appear(1)
        assert account.backend_conf.get_stanza(_ACCOUNT_CONFIG["name"]) == {
            "account_checkbox": "1",
            "account_multiple_select": _ACCOUNT_CONFIG["account_multiple_select"],
            "account_radio": "1",
            "auth_type": _ACCOUNT_CONFIG["auth_type"],
            "username": _ACCOUNT_CONFIG["username"],
            "custom_endpoint": _ACCOUNT_CONFIG["custom_endpoint"],
            "disabled": False,
            "password": "******",
            "token": "******",
            "url": "https://test.example.com",
        }

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    @pytest.mark.sanity_test
    def test_account_add_frontend_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies the frontend after adding account"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
        account.entity.multiple_select.select("Option One")
        account.entity.password.set_value(_ACCOUNT_CONFIG["password"])
        account.entity.security_token.set_value("TestToken")
        self.assert_util(account.entity.save, True)
        account.table.wait_for_rows_to_appear(1)
        self.assert_util(
            account.table.get_table()[_ACCOUNT_CONFIG["name"]],
            {
                "name": _ACCOUNT_CONFIG["name"],
                "auth type": "basic",
                "actions": "Edit | Clone | Delete",
            },
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    @pytest.mark.sanity_test
    def test_account_edit_frontend_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the frontend edit functionality"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.edit_row(_ACCOUNT_CONFIG["name"])
        account.entity.environment.select("Value2")
        account.entity.multiple_select.select("Option Two")
        account.entity.username.set_value("TestEditUser")
        account.entity.password.set_value("TestEditPassword")
        account.entity.security_token.set_value("TestEditToken")
        account.entity.account_radio.select("No")
        self.assert_util(account.entity.save, True)
        account.table.wait_for_rows_to_appear(1)
        self.assert_util(
            account.table.get_table()[_ACCOUNT_CONFIG["name"]],
            {
                "name": "TestAccount",
                "auth type": "basic",
                "actions": "Edit | Clone | Delete",
            },
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_clone_account_duplicate_name(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies by saving an entity with duplicate name at time of clone it displays and error"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.clone_row(_ACCOUNT_CONFIG["name"])
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        self.assert_util(
            account.entity.save,
            "Name {} is already in use".format(_ACCOUNT_CONFIG["name"]),
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    @pytest.mark.sanity_test
    def test_account_clone_frontend_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the frontend clone functionality"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.wait_for_rows_to_appear(1)
        account.table.clone_row(_ACCOUNT_CONFIG["name"])
        account.entity.name.set_value("TestAccount2")
        account.entity.username.set_value("TestUserClone")
        account.entity.password.set_value("TestPasswordClone")
        account.entity.security_token.set_value("TestTokenClone")
        account.entity.account_radio.select("Yes")
        self.assert_util(account.entity.save, True)
        self.assert_util(
            account.table.get_table()["TestAccount2"],
            {
                "name": "TestAccount2",
                "auth type": "basic",
                "actions": "Edit | Clone | Delete",
            },
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_clone_default_values(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the frontend default fields at time of clone"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.clone_row(_ACCOUNT_CONFIG["name"])
        self.assert_util(account.entity.name.get_value, "")
        self.assert_util(account.entity.environment.get_value, "Value1")
        self.assert_util(
            account.entity.example_checkbox.is_checked(),
            _ACCOUNT_CONFIG["account_checkbox"],
        )
        self.assert_util(account.entity.multiple_select.get_values, ["Option One"])
        self.assert_util(
            account.entity.auth_key.get_value, _ACCOUNT_CONFIG["auth_type"]
        )
        self.assert_util(account.entity.username.get_value, _ACCOUNT_CONFIG["username"])
        self.assert_util(account.entity.password.get_value, "")
        self.assert_util(account.entity.security_token.get_value, "")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    @pytest.mark.sanity_test
    def test_account_add_backend_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies the account in backend after adding account from frontend"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
        account.entity.multiple_select.select("Option One")
        account.entity.password.set_value(_ACCOUNT_CONFIG["password"])
        account.entity.security_token.set_value(_ACCOUNT_CONFIG["token"])
        self.assert_util(account.entity.save, True)
        account.table.wait_for_rows_to_appear(1)
        assert account.backend_conf.get_stanza(
            _ACCOUNT_CONFIG["name"], decrypt=True
        ) == {
            "account_multiple_select": _ACCOUNT_CONFIG["account_multiple_select"],
            "account_radio": "1",
            "auth_type": _ACCOUNT_CONFIG["auth_type"],
            "username": _ACCOUNT_CONFIG["username"],
            "custom_endpoint": _ACCOUNT_CONFIG["custom_endpoint"],
            "disabled": False,
            "password": _ACCOUNT_CONFIG["password"],
            "token": _ACCOUNT_CONFIG["token"],
        }

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    @pytest.mark.sanity_test
    def test_account_edit_backend_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the account in backend after editing account from frontend"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.edit_row(_ACCOUNT_CONFIG["name"])
        account.entity.multiple_select.select("Option Two")
        account.entity.username.set_value("TestEditUser")
        account.entity.password.set_value("TestEditPassword")
        account.entity.security_token.set_value("TestEditToken")
        account.entity.account_radio.select("No")
        account.entity.save()
        account.table.wait_for_rows_to_appear(1)
        assert account.backend_conf.get_stanza(
            _ACCOUNT_CONFIG["name"], decrypt=True
        ) == {
            "account_checkbox": "1",
            "account_multiple_select": "one,two",
            "account_radio": "0",
            "auth_type": "basic",
            "username": "TestEditUser",
            "custom_endpoint": "login.example.com",
            "disabled": False,
            "password": "TestEditPassword",
            "token": "TestEditToken",
            "url": "https://test.example.com",
        }

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    @pytest.mark.sanity_test
    def test_account_clone_backend_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the account in backend after cloning account from frontend"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.wait_for_rows_to_appear(1)
        account.table.clone_row(_ACCOUNT_CONFIG["name"])
        account.entity.name.set_value("TestAccountClone")
        account.entity.multiple_select.select("Option Two")
        account.entity.username.set_value("TestCloneUser")
        account.entity.password.set_value("TestEditPassword")
        account.entity.security_token.set_value("TestEditToken")
        account.entity.account_radio.select("No")
        account.entity.save()
        account.table.wait_for_rows_to_appear(2)
        assert account.backend_conf.get_stanza("TestAccountClone", decrypt=True) == {
            "account_checkbox": "1",
            "account_multiple_select": "one,two",
            "account_radio": "0",
            "auth_type": "basic",
            "username": "TestCloneUser",
            "custom_endpoint": "login.example.com",
            "disabled": False,
            "password": "TestEditPassword",
            "token": "TestEditToken",
            "url": "https://test.example.com",
        }

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    @pytest.mark.sanity_test
    def test_account_delete_row_backend_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies the account in backend after deleting the account from frontend"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.delete_row(_ACCOUNT_CONFIG["name"])
        account.table.wait_for_rows_to_appear(0)
        self.assert_util(
            _ACCOUNT_CONFIG["name"],
            account.backend_conf.get_all_stanzas().keys(),
            "not in",
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_helplink(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper):
        """Verifies whether the table help link redirects to the correct URL"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        go_to_link = "https://docs.splunk.com/Documentation"
        account.entity.open()
        with account.entity.help_link.open_link():
            self.assert_util(account.entity.help_link.get_current_url, go_to_link)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.account
    def test_account_delete_account_in_use(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies by deleting the input used account"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        self.assert_util(
            account.table.delete_row,
            r'Are you sure you want to delete "TestAccount" ? Ensure that no '
            r'input is configured with "TestAccount" as this will stop '
            r"data collection for that input.",
            left_args={"name": _ACCOUNT_CONFIG["name"], "prompt_msg": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.account
    @pytest.mark.forwarder
    def test_account_displayed_columns(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies headers of account table"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        expected_headers = ["Name", "Auth Type", "Actions"]
        self.assert_util(list(account.table.get_headers()), expected_headers)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.account
    @pytest.mark.forwarder
    def test_account_action_values(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verifies action items for accout page"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        expected_actions = ["Edit", "Clone", "Delete"]
        self.assert_util(
            list(account.table.get_list_of_actions(_ACCOUNT_CONFIG["name"])),
            expected_actions,
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.account
    @pytest.mark.forwarder
    def test_account_edit_default_values(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
    ):
        """Verification of default values in fields at time of edit"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.table.edit_row(_ACCOUNT_CONFIG["name"])
        self.assert_util(account.entity.name.get_value, _ACCOUNT_CONFIG["name"])
        self.assert_util(account.entity.environment.get_value, "Value1")
        self.assert_util(
            account.entity.example_checkbox.is_checked(),
            _ACCOUNT_CONFIG["account_checkbox"],
        )
        # self.assert_util(account.entity.account_radio.get_value, "Yes")
        self.assert_util(account.entity.multiple_select.get_values, ["Option One"])
        self.assert_util(
            account.entity.auth_key.get_value, _ACCOUNT_CONFIG["auth_type"]
        )
        self.assert_util(account.entity.username.get_value, _ACCOUNT_CONFIG["username"])
        self.assert_util(account.entity.password.get_value, "")
        self.assert_util(account.entity.security_token.get_value, "")

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.account
    @pytest.mark.forwarder
    def test_account_title_and_description(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies title and discription"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        self.assert_util(account.title.wait_to_display, "Configuration")
        self.assert_util(
            account.description.wait_to_display,
            "Set up your add-on",
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.account
    @pytest.mark.forwarder
    def test_account_valid_input_account_name(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies validation of field account_name"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value("1234")
        account.entity.URL.set_value(_ACCOUNT_CONFIG.get("url"))
        if account.entity.auth_type.get_value() == "oauth":
            account.entity.auth_type.select(_ACCOUNT_CONFIG.get("auth_type"))
        account.entity.username.set_value(_ACCOUNT_CONFIG.get("username"))
        account.entity.password.set_value(_ACCOUNT_CONFIG.get("password"))
        self.assert_util(
            account.entity.save,
            "Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.account
    @pytest.mark.forwarder
    def test_account_select_value_auth_type(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Select the all the values from single select and verifies the selected value"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        auth_value_dict = {
            "basic": "Basic Authentication",
            "oauth": "OAuth 2.0 Authentication",
        }
        for auth_type_value, auth_type_name in auth_value_dict.items():
            if account.entity.auth_type.get_value() != auth_type_value:
                account.entity.auth_type.select(auth_type_name)
            self.assert_util(account.entity.auth_type.get_value, auth_type_value)

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.account
    @pytest.mark.forwarder
    def test_account_add_reserved_value_account_name(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Select the all the values from single select and verifies the selected value"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value("default")
        account.entity.URL.set_value(_ACCOUNT_CONFIG.get("url"))
        if account.entity.auth_type.get_value() == "oauth":
            account.entity.auth_type.select(_ACCOUNT_CONFIG.get("auth_type"))
        account.entity.username.set_value(_ACCOUNT_CONFIG.get("username"))
        account.entity.password.set_value(_ACCOUNT_CONFIG.get("password"))
        self.assert_util(
            account.entity.save(expect_error=True),
            r'"default", ".", "..", string started with "_" and string including any one of ["*", "\", "[", "]", "(", ")", "?", ":"] are reserved value which cannot be used for field Name',  # noqa: E501
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.account
    @pytest.mark.forwarder
    def test_account_url_validation(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG.get("name"))
        invalid_url = "invalid_url"
        account.entity.URL.set_value(invalid_url)
        self.assert_util(
            account.entity.save(expect_error=True),
            "Invalid URL provided. URL should start with 'https' as only secure URLs are supported. Provide URL in this format",  # noqa: E501
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.input
    def test_example_validation_of_oauth_fields_too_short(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies required field client id"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.environment.select("Value2")
        account.entity.account_radio.select("No")
        account.entity.multiple_select.select("Option Two")
        account.entity.username.set_value("TestClientId")
        account.entity.password.set_value("ClientSecretTest")
        account.entity.security_token.set_value("SecurityTokenTest")
        account.entity.basic_oauth_text.set_value("Invalid")

        self.assert_util(
            account.entity.save,
            "Length should be between 10 and 4096",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.input
    def test_example_validation_of_oauth_fields_wrong_characters(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies required field client id"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.environment.select("Value2")
        account.entity.account_radio.select("No")
        account.entity.multiple_select.select("Option Two")
        account.entity.username.set_value("TestClientId")
        account.entity.password.set_value("ClientSecretTest")
        account.entity.security_token.set_value("SecurityTokenTest")
        account.entity.basic_oauth_text.set_value(
            "Invalid due to special characters: !@#$%^&*()"
        )

        self.assert_util(
            account.entity.save,
            "Do not use special characters",
            left_args={"expect_error": True},
        )

    @pytest.mark.execute_enterprise_cloud_true
    @pytest.mark.forwarder
    @pytest.mark.input
    def test_example_validation_of_oauth_valid(
        self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
    ):
        """Verifies required field client id"""
        account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
        account.entity.open()
        account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
        account.entity.environment.select("Value2")
        account.entity.account_radio.select("No")
        account.entity.multiple_select.select("Option Two")
        account.entity.username.set_value("TestClientId")
        account.entity.password.set_value("ClientSecretTest")
        account.entity.security_token.set_value("SecurityTokenTest")
        account.entity.basic_oauth_text.set_value("Valid_text_for_oauth")

        self.assert_util(account.entity.save, True)

        account.table.wait_for_rows_to_appear(1)

        self.assert_util(
            account.table.get_table()[_ACCOUNT_CONFIG["name"]],
            {
                "name": _ACCOUNT_CONFIG["name"],
                "auth type": "basic",
                "actions": "Edit | Clone | Delete",
            },
        )

test_account_action_values(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies action items for accout page

Source code in tests/ui/test_configuration_page_account_tab.py
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.account
@pytest.mark.forwarder
def test_account_action_values(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies action items for accout page"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    expected_actions = ["Edit", "Clone", "Delete"]
    self.assert_util(
        list(account.table.get_list_of_actions(_ACCOUNT_CONFIG["name"])),
        expected_actions,
    )

test_account_add_backend_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies the account in backend after adding account from frontend

Source code in tests/ui/test_configuration_page_account_tab.py
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
@pytest.mark.sanity_test
def test_account_add_backend_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies the account in backend after adding account from frontend"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
    account.entity.multiple_select.select("Option One")
    account.entity.password.set_value(_ACCOUNT_CONFIG["password"])
    account.entity.security_token.set_value(_ACCOUNT_CONFIG["token"])
    self.assert_util(account.entity.save, True)
    account.table.wait_for_rows_to_appear(1)
    assert account.backend_conf.get_stanza(
        _ACCOUNT_CONFIG["name"], decrypt=True
    ) == {
        "account_multiple_select": _ACCOUNT_CONFIG["account_multiple_select"],
        "account_radio": "1",
        "auth_type": _ACCOUNT_CONFIG["auth_type"],
        "username": _ACCOUNT_CONFIG["username"],
        "custom_endpoint": _ACCOUNT_CONFIG["custom_endpoint"],
        "disabled": False,
        "password": _ACCOUNT_CONFIG["password"],
        "token": _ACCOUNT_CONFIG["token"],
    }

test_account_add_cancel_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies cancel functionality at time of add

Source code in tests/ui/test_configuration_page_account_tab.py
212
213
214
215
216
217
218
219
220
221
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_add_cancel_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies cancel functionality at time of add"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(account.entity.cancel, True)

test_account_add_close_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies close functionality at time of add

Source code in tests/ui/test_configuration_page_account_tab.py
201
202
203
204
205
206
207
208
209
210
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_add_close_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies close functionality at time of add"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(account.entity.close, True)

test_account_add_frontend_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies the frontend after adding account

Source code in tests/ui/test_configuration_page_account_tab.py
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
@pytest.mark.sanity_test
def test_account_add_frontend_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies the frontend after adding account"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
    account.entity.multiple_select.select("Option One")
    account.entity.password.set_value(_ACCOUNT_CONFIG["password"])
    account.entity.security_token.set_value("TestToken")
    self.assert_util(account.entity.save, True)
    account.table.wait_for_rows_to_appear(1)
    self.assert_util(
        account.table.get_table()[_ACCOUNT_CONFIG["name"]],
        {
            "name": _ACCOUNT_CONFIG["name"],
            "auth type": "basic",
            "actions": "Edit | Clone | Delete",
        },
    )

test_account_add_reserved_value_account_name(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Select the all the values from single select and verifies the selected value

Source code in tests/ui/test_configuration_page_account_tab.py
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.account
@pytest.mark.forwarder
def test_account_add_reserved_value_account_name(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Select the all the values from single select and verifies the selected value"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value("default")
    account.entity.URL.set_value(_ACCOUNT_CONFIG.get("url"))
    if account.entity.auth_type.get_value() == "oauth":
        account.entity.auth_type.select(_ACCOUNT_CONFIG.get("auth_type"))
    account.entity.username.set_value(_ACCOUNT_CONFIG.get("username"))
    account.entity.password.set_value(_ACCOUNT_CONFIG.get("password"))
    self.assert_util(
        account.entity.save(expect_error=True),
        r'"default", ".", "..", string started with "_" and string including any one of ["*", "\", "[", "]", "(", ")", "?", ":"] are reserved value which cannot be used for field Name',  # noqa: E501
    )

test_account_add_valid_title(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies the title of the ‘Add Entity’

Source code in tests/ui/test_configuration_page_account_tab.py
145
146
147
148
149
150
151
152
153
154
155
156
157
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_add_valid_title(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies the title of the 'Add Entity'"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(
        account.entity.title.container.get_attribute("textContent").strip(),
        "Add Account",
    )

test_account_basic_fields_label_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies basic account field label

Source code in tests/ui/test_configuration_page_account_tab.py
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_basic_fields_label_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies basic account field label"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(account.entity.name.get_input_label, "Name")
    self.assert_util(
        account.entity.environment.get_input_label, "Example Environment"
    )
    self.assert_util(
        account.entity.example_checkbox.get_input_label, "Example Checkbox"
    )
    self.assert_util(account.entity.account_radio.get_input_label, "Example Radio")
    self.assert_util(
        account.entity.multiple_select.get_input_label, "Example Multiple Select"
    )
    self.assert_util(account.entity.auth_key.get_input_label, "Auth Type")
    self.assert_util(account.entity.username.get_input_label, "Username")
    self.assert_util(account.entity.password.get_input_label, "Password")
    self.assert_util(
        account.entity.security_token.get_input_label, "Security Token"
    )

test_account_checked_example_checkbox(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies Check/Uncheck in example checkbox

Source code in tests/ui/test_configuration_page_account_tab.py
652
653
654
655
656
657
658
659
660
661
662
663
664
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_checked_example_checkbox(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies Check/Uncheck in example checkbox"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.example_checkbox.check()
    self.assert_util(account.entity.example_checkbox.is_checked, True)
    account.entity.example_checkbox.uncheck()
    self.assert_util(account.entity.example_checkbox.is_checked, False)

test_account_clone_backend_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the account in backend after cloning account from frontend

Source code in tests/ui/test_configuration_page_account_tab.py
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
@pytest.mark.sanity_test
def test_account_clone_backend_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the account in backend after cloning account from frontend"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.wait_for_rows_to_appear(1)
    account.table.clone_row(_ACCOUNT_CONFIG["name"])
    account.entity.name.set_value("TestAccountClone")
    account.entity.multiple_select.select("Option Two")
    account.entity.username.set_value("TestCloneUser")
    account.entity.password.set_value("TestEditPassword")
    account.entity.security_token.set_value("TestEditToken")
    account.entity.account_radio.select("No")
    account.entity.save()
    account.table.wait_for_rows_to_appear(2)
    assert account.backend_conf.get_stanza("TestAccountClone", decrypt=True) == {
        "account_checkbox": "1",
        "account_multiple_select": "one,two",
        "account_radio": "0",
        "auth_type": "basic",
        "username": "TestCloneUser",
        "custom_endpoint": "login.example.com",
        "disabled": False,
        "password": "TestEditPassword",
        "token": "TestEditToken",
        "url": "https://test.example.com",
    }

test_account_clone_cancel_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies cancel functionality at time of clone

Source code in tests/ui/test_configuration_page_account_tab.py
285
286
287
288
289
290
291
292
293
294
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_clone_cancel_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies cancel functionality at time of clone"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.clone_row(_ACCOUNT_CONFIG["name"])
    self.assert_util(account.entity.cancel, True)

test_account_clone_close_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies close functionality at time of clone

Source code in tests/ui/test_configuration_page_account_tab.py
274
275
276
277
278
279
280
281
282
283
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_clone_close_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies close functionality at time of clone"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.clone_row(_ACCOUNT_CONFIG["name"])
    self.assert_util(account.entity.close, True)

test_account_clone_default_values(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the frontend default fields at time of clone

Source code in tests/ui/test_configuration_page_account_tab.py
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_clone_default_values(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the frontend default fields at time of clone"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.clone_row(_ACCOUNT_CONFIG["name"])
    self.assert_util(account.entity.name.get_value, "")
    self.assert_util(account.entity.environment.get_value, "Value1")
    self.assert_util(
        account.entity.example_checkbox.is_checked(),
        _ACCOUNT_CONFIG["account_checkbox"],
    )
    self.assert_util(account.entity.multiple_select.get_values, ["Option One"])
    self.assert_util(
        account.entity.auth_key.get_value, _ACCOUNT_CONFIG["auth_type"]
    )
    self.assert_util(account.entity.username.get_value, _ACCOUNT_CONFIG["username"])
    self.assert_util(account.entity.password.get_value, "")
    self.assert_util(account.entity.security_token.get_value, "")

test_account_clone_frontend_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the frontend clone functionality

Source code in tests/ui/test_configuration_page_account_tab.py
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
@pytest.mark.sanity_test
def test_account_clone_frontend_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the frontend clone functionality"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.wait_for_rows_to_appear(1)
    account.table.clone_row(_ACCOUNT_CONFIG["name"])
    account.entity.name.set_value("TestAccount2")
    account.entity.username.set_value("TestUserClone")
    account.entity.password.set_value("TestPasswordClone")
    account.entity.security_token.set_value("TestTokenClone")
    account.entity.account_radio.select("Yes")
    self.assert_util(account.entity.save, True)
    self.assert_util(
        account.table.get_table()["TestAccount2"],
        {
            "name": "TestAccount2",
            "auth type": "basic",
            "actions": "Edit | Clone | Delete",
        },
    )

test_account_clone_valid_title(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the title of the ‘Clone Entity’

Source code in tests/ui/test_configuration_page_account_tab.py
173
174
175
176
177
178
179
180
181
182
183
184
185
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_clone_valid_title(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the title of the 'Clone Entity'"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.clone_row(_ACCOUNT_CONFIG["name"])
    self.assert_util(
        account.entity.title.container.get_attribute("textContent").strip(),
        "Clone Account",
    )

test_account_count(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_multiple_account)

Verifies count on table

Source code in tests/ui/test_configuration_page_account_tab.py
87
88
89
90
91
92
93
94
95
96
97
98
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_count(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_multiple_account
):
    """Verifies count on table"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    self.assert_util(
        account.table.get_count_title,
        f"{len(account.backend_conf.get_all_stanzas())} Items",
    )

test_account_credentials_encrypted_value(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the default number of rows in the table

Source code in tests/ui/test_configuration_page_account_tab.py
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_credentials_encrypted_value(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the default number of rows in the table"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.wait_for_rows_to_appear(1)
    assert account.backend_conf.get_stanza(_ACCOUNT_CONFIG["name"]) == {
        "account_checkbox": "1",
        "account_multiple_select": _ACCOUNT_CONFIG["account_multiple_select"],
        "account_radio": "1",
        "auth_type": _ACCOUNT_CONFIG["auth_type"],
        "username": _ACCOUNT_CONFIG["username"],
        "custom_endpoint": _ACCOUNT_CONFIG["custom_endpoint"],
        "disabled": False,
        "password": "******",
        "token": "******",
        "url": "https://test.example.com",
    }

test_account_default_rows_in_table(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies the default number of rows in the table

Source code in tests/ui/test_configuration_page_account_tab.py
60
61
62
63
64
65
66
67
68
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_default_rows_in_table(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies the default number of rows in the table"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    self.assert_util(account.table.get_row_count, 0)

test_account_default_value_auth_type(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies default value of auth type

Source code in tests/ui/test_configuration_page_account_tab.py
627
628
629
630
631
632
633
634
635
636
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_default_value_auth_type(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies default value of auth type"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(account.entity.auth_key.get_value, "basic")

test_account_default_value_example_environment(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies default value of example environment

Source code in tests/ui/test_configuration_page_account_tab.py
601
602
603
604
605
606
607
608
609
610
611
612
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_default_value_example_environment(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies default value of example environment"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
    self.assert_util(account.entity.environment.get_value, "Value1")

test_account_default_value_example_radio(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies default value of example radio

Source code in tests/ui/test_configuration_page_account_tab.py
722
723
724
725
726
727
728
729
730
731
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_default_value_example_radio(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies default value of example radio"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(account.entity.account_radio.get_value, "Yes")

test_account_delete_account_in_use(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies by deleting the input used account

Source code in tests/ui/test_configuration_page_account_tab.py
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_delete_account_in_use(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies by deleting the input used account"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    self.assert_util(
        account.table.delete_row,
        r'Are you sure you want to delete "TestAccount" ? Ensure that no '
        r'input is configured with "TestAccount" as this will stop '
        r"data collection for that input.",
        left_args={"name": _ACCOUNT_CONFIG["name"], "prompt_msg": True},
    )

test_account_delete_cancel_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies cancel functionality at time of delete

Source code in tests/ui/test_configuration_page_account_tab.py
237
238
239
240
241
242
243
244
245
246
247
248
249
250
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_delete_cancel_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies cancel functionality at time of delete"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

    self.assert_util(
        account.table.delete_row,
        True,
        left_args={"name": _ACCOUNT_CONFIG["name"], "cancel": True},
    )

test_account_delete_close_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies close functionality at time of delete

Source code in tests/ui/test_configuration_page_account_tab.py
223
224
225
226
227
228
229
230
231
232
233
234
235
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_delete_close_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies close functionality at time of delete"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    self.assert_util(
        account.table.delete_row,
        True,
        left_args={"name": _ACCOUNT_CONFIG["name"], "close": True},
    )

test_account_delete_row_backend_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the account in backend after deleting the account from frontend

Source code in tests/ui/test_configuration_page_account_tab.py
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
@pytest.mark.sanity_test
def test_account_delete_row_backend_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the account in backend after deleting the account from frontend"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.delete_row(_ACCOUNT_CONFIG["name"])
    account.table.wait_for_rows_to_appear(0)
    self.assert_util(
        _ACCOUNT_CONFIG["name"],
        account.backend_conf.get_all_stanzas().keys(),
        "not in",
    )

test_account_delete_row_frontend_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the frontend delete functionlity

Source code in tests/ui/test_configuration_page_account_tab.py
753
754
755
756
757
758
759
760
761
762
763
764
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
@pytest.mark.sanity_test
def test_account_delete_row_frontend_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the frontend delete functionlity"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.delete_row(_ACCOUNT_CONFIG["name"])
    account.table.wait_for_rows_to_appear(0)
    self.assert_util(_ACCOUNT_CONFIG["name"], account.table.get_table, "not in")

test_account_delete_valid_prompt_message(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the prompt message of the ‘Delete Entity’

Source code in tests/ui/test_configuration_page_account_tab.py
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_delete_valid_prompt_message(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the prompt message of the 'Delete Entity'"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    prompt_message = account.table.delete_row(
        _ACCOUNT_CONFIG["name"], prompt_msg=True
    )
    self.assert_util(
        prompt_message,
        'Are you sure you want to delete "{}" ? Ensure that no input is '
        'configured with "{}" as this will stop data collection for '
        "that input.".format(_ACCOUNT_CONFIG["name"], _ACCOUNT_CONFIG["name"]),
    )

test_account_delete_valid_title(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the title of the ‘Delete Entity’

Source code in tests/ui/test_configuration_page_account_tab.py
187
188
189
190
191
192
193
194
195
196
197
198
199
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_delete_valid_title(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the title of the 'Delete Entity'"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.delete_row(_ACCOUNT_CONFIG["name"], prompt_msg=True)
    self.assert_util(
        account.entity.title.container.get_attribute("textContent").strip(),
        "Delete Confirmation",
    )

test_account_displayed_columns(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies headers of account table

Source code in tests/ui/test_configuration_page_account_tab.py
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.account
@pytest.mark.forwarder
def test_account_displayed_columns(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies headers of account table"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    expected_headers = ["Name", "Auth Type", "Actions"]
    self.assert_util(list(account.table.get_headers()), expected_headers)

test_account_edit_backend_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the account in backend after editing account from frontend

Source code in tests/ui/test_configuration_page_account_tab.py
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
@pytest.mark.sanity_test
def test_account_edit_backend_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the account in backend after editing account from frontend"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.edit_row(_ACCOUNT_CONFIG["name"])
    account.entity.multiple_select.select("Option Two")
    account.entity.username.set_value("TestEditUser")
    account.entity.password.set_value("TestEditPassword")
    account.entity.security_token.set_value("TestEditToken")
    account.entity.account_radio.select("No")
    account.entity.save()
    account.table.wait_for_rows_to_appear(1)
    assert account.backend_conf.get_stanza(
        _ACCOUNT_CONFIG["name"], decrypt=True
    ) == {
        "account_checkbox": "1",
        "account_multiple_select": "one,two",
        "account_radio": "0",
        "auth_type": "basic",
        "username": "TestEditUser",
        "custom_endpoint": "login.example.com",
        "disabled": False,
        "password": "TestEditPassword",
        "token": "TestEditToken",
        "url": "https://test.example.com",
    }

test_account_edit_cancel_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies cancel functionality at time of edit

Source code in tests/ui/test_configuration_page_account_tab.py
263
264
265
266
267
268
269
270
271
272
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_edit_cancel_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies cancel functionality at time of edit"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.edit_row(_ACCOUNT_CONFIG["name"])
    self.assert_util(account.entity.cancel, True)

test_account_edit_close_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies close functionality at time of edit

Source code in tests/ui/test_configuration_page_account_tab.py
252
253
254
255
256
257
258
259
260
261
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_edit_close_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies close functionality at time of edit"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.edit_row(_ACCOUNT_CONFIG["name"])
    self.assert_util(account.entity.close, True)

test_account_edit_default_values(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verification of default values in fields at time of edit

Source code in tests/ui/test_configuration_page_account_tab.py
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.account
@pytest.mark.forwarder
def test_account_edit_default_values(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verification of default values in fields at time of edit"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.edit_row(_ACCOUNT_CONFIG["name"])
    self.assert_util(account.entity.name.get_value, _ACCOUNT_CONFIG["name"])
    self.assert_util(account.entity.environment.get_value, "Value1")
    self.assert_util(
        account.entity.example_checkbox.is_checked(),
        _ACCOUNT_CONFIG["account_checkbox"],
    )
    # self.assert_util(account.entity.account_radio.get_value, "Yes")
    self.assert_util(account.entity.multiple_select.get_values, ["Option One"])
    self.assert_util(
        account.entity.auth_key.get_value, _ACCOUNT_CONFIG["auth_type"]
    )
    self.assert_util(account.entity.username.get_value, _ACCOUNT_CONFIG["username"])
    self.assert_util(account.entity.password.get_value, "")
    self.assert_util(account.entity.security_token.get_value, "")

test_account_edit_frontend_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the frontend edit functionality

Source code in tests/ui/test_configuration_page_account_tab.py
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
@pytest.mark.sanity_test
def test_account_edit_frontend_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the frontend edit functionality"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.edit_row(_ACCOUNT_CONFIG["name"])
    account.entity.environment.select("Value2")
    account.entity.multiple_select.select("Option Two")
    account.entity.username.set_value("TestEditUser")
    account.entity.password.set_value("TestEditPassword")
    account.entity.security_token.set_value("TestEditToken")
    account.entity.account_radio.select("No")
    self.assert_util(account.entity.save, True)
    account.table.wait_for_rows_to_appear(1)
    self.assert_util(
        account.table.get_table()[_ACCOUNT_CONFIG["name"]],
        {
            "name": "TestAccount",
            "auth type": "basic",
            "actions": "Edit | Clone | Delete",
        },
    )

test_account_edit_uneditable_field_name(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the frontend uneditable fields at time of edit of the account

Source code in tests/ui/test_configuration_page_account_tab.py
766
767
768
769
770
771
772
773
774
775
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_edit_uneditable_field_name(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the frontend uneditable fields at time of edit of the account"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.edit_row(_ACCOUNT_CONFIG["name"])
    self.assert_util(account.entity.name.is_editable, False)

test_account_edit_valid_title(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the title of the ‘Edit Entity’

Source code in tests/ui/test_configuration_page_account_tab.py
159
160
161
162
163
164
165
166
167
168
169
170
171
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_edit_valid_title(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the title of the 'Edit Entity'"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.edit_row(_ACCOUNT_CONFIG["name"])
    self.assert_util(
        account.entity.title.container.get_attribute("textContent").strip(),
        "Update Account",
    )

test_account_encrypted_field_client_secret(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies if the password field is masked or not in the Textbox

Source code in tests/ui/test_configuration_page_account_tab.py
540
541
542
543
544
545
546
547
548
549
550
551
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_encrypted_field_client_secret(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies if the password field is masked or not in the Textbox"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.auth_key.select("OAuth 2.0 Authentication")
    textbox_type = account.entity.client_secret.get_type()
    self.assert_util(textbox_type, "password")

test_account_encrypted_field_password(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies if the password field is masked or not in the Textbox

Source code in tests/ui/test_configuration_page_account_tab.py
356
357
358
359
360
361
362
363
364
365
366
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_encrypted_field_password(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies if the password field is masked or not in the Textbox"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    textbox_type = account.entity.password.get_type()
    self.assert_util(textbox_type, "password")

test_account_filter_functionality_negative(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the filter functionality (Negative)

Source code in tests/ui/test_configuration_page_account_tab.py
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_filter_functionality_negative(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the filter functionality (Negative)"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.set_filter("hello")
    self.assert_util(account.table.get_row_count, 0)
    self.assert_util(
        account.table.get_count_title,
        f"{account.table.get_row_count()} Item",
    )
    account.table.clean_filter()

test_account_filter_functionality_positive(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies the filter functionality (Positive)

Source code in tests/ui/test_configuration_page_account_tab.py
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_filter_functionality_positive(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies the filter functionality (Positive)"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.set_filter("TestAccount")
    self.assert_util(account.table.get_row_count, 1)
    self.assert_util(
        account.table.get_count_title,
        f"{account.table.get_row_count()} Item",
    )
    account.table.clean_filter()

test_account_help_text_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies help text for the field name

Source code in tests/ui/test_configuration_page_account_tab.py
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.account
def test_account_help_text_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies help text for the field name"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(
        account.entity.name.get_help_text, "Enter a unique name for this account."
    )
    self.assert_util(
        account.entity.example_checkbox.get_help_text,
        "This is an example checkbox for the account entity",
    )
    self.assert_util(
        account.entity.account_radio.get_help_text,
        "This is an example radio button for the account entity",
    )
    self.assert_util(
        account.entity.multiple_select.get_help_text,
        "This is an example multipleSelect for account entity",
    )
    self.assert_util(
        account.entity.username.get_help_text,
        "Enter the username for this account.",
    )
    self.assert_util(
        account.entity.password.get_help_text,
        "Enter the password for this account.",
    )
    self.assert_util(
        account.entity.security_token.get_help_text, "Enter the security token."
    )

Verifies whether the table help link redirects to the correct URL

Source code in tests/ui/test_configuration_page_account_tab.py
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_helplink(self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper):
    """Verifies whether the table help link redirects to the correct URL"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    go_to_link = "https://docs.splunk.com/Documentation"
    account.entity.open()
    with account.entity.help_link.open_link():
        self.assert_util(account.entity.help_link.get_current_url, go_to_link)

test_account_list_auth_type(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies auth type list dropdown

Source code in tests/ui/test_configuration_page_account_tab.py
638
639
640
641
642
643
644
645
646
647
648
649
650
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_list_auth_type(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies auth type list dropdown"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(
        account.entity.auth_key.list_of_values(),
        ["Basic Authentication", "OAuth 2.0 Authentication"],
    )

test_account_list_example_environment(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies example environment list dropdown

Source code in tests/ui/test_configuration_page_account_tab.py
614
615
616
617
618
619
620
621
622
623
624
625
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_list_example_environment(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies example environment list dropdown"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(
        account.entity.environment.list_of_values, ["Value1", "Value2", "Other"]
    )

test_account_list_example_multiple_select(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies example multiple select list dropdown

Source code in tests/ui/test_configuration_page_account_tab.py
678
679
680
681
682
683
684
685
686
687
688
689
690
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_list_example_multiple_select(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies example multiple select list dropdown"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(
        account.entity.multiple_select.list_of_values(),
        ["Option One", "Option Two"],
    )

test_account_oauth_fields_label_entity(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies oauth account field label

Source code in tests/ui/test_configuration_page_account_tab.py
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_oauth_fields_label_entity(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies oauth account field label"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.auth_key.select("OAuth 2.0 Authentication")
    self.assert_util(account.entity.name.get_input_label, "Name")
    self.assert_util(
        account.entity.environment.get_input_label, "Example Environment"
    )
    self.assert_util(
        account.entity.example_checkbox.get_input_label, "Example Checkbox"
    )
    self.assert_util(account.entity.account_radio.get_input_label, "Example Radio")
    self.assert_util(
        account.entity.multiple_select.get_input_label, "Example Multiple Select"
    )
    self.assert_util(account.entity.auth_key.get_input_label, "Auth Type")
    self.assert_util(account.entity.client_id.get_input_label, "Client Id")
    self.assert_util(account.entity.client_secret.get_input_label, "Client Secret")
    self.assert_util(account.entity.redirect_url.get_input_label, "Redirect url")

test_account_pagination(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_multiple_account)

Verifies pagination list

Source code in tests/ui/test_configuration_page_account_tab.py
132
133
134
135
136
137
138
139
140
141
142
143
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_pagination(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_multiple_account
):
    """Verifies pagination list"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    name_column_page1 = account.table.get_column_values("name")
    account.table.switch_to_next()
    name_column_page2 = account.table.get_column_values("name")
    self.assert_util(name_column_page1, name_column_page2, "!=")

test_account_required_field_client_id(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies required field client id

Source code in tests/ui/test_configuration_page_account_tab.py
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_required_field_client_id(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies required field client id"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.environment.select("Value2")
    account.entity.account_radio.select("No")
    account.entity.multiple_select.select("Option Two")
    account.entity.auth_key.select("OAuth 2.0 Authentication")
    self.assert_util(
        account.entity.save,
        "Field Client Id is required",
        left_args={"expect_error": True},
    )

test_account_required_field_client_secret(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies required field client secret

Source code in tests/ui/test_configuration_page_account_tab.py
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_required_field_client_secret(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies required field client secret"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.auth_key.select("OAuth 2.0 Authentication")
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.multiple_select.select("Option One")
    account.entity.account_radio.select("No")
    account.entity.client_id.set_value("TestClientId")
    self.assert_util(
        account.entity.save,
        "Field Client Secret is required",
        left_args={"expect_error": True},
    )

test_account_required_field_example_multiple_select(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies required field example multiple select

Source code in tests/ui/test_configuration_page_account_tab.py
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_required_field_example_multiple_select(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies required field example multiple select"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.environment.select("Value2")
    account.entity.username.set_value("TestEditUser")
    account.entity.password.set_value("TestEditPassword")
    account.entity.security_token.set_value("TestEditToken")
    account.entity.account_radio.select("No")
    self.assert_util(
        account.entity.save,
        "Field Example Multiple Select is required",
        left_args={"expect_error": True},
    )

test_account_required_field_name(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies required field name

Source code in tests/ui/test_configuration_page_account_tab.py
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_required_field_name(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies required field name"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.environment.select("Value2")
    account.entity.multiple_select.select("Option Two")
    account.entity.username.set_value("TestEditUser")
    account.entity.password.set_value("TestEditPassword")
    account.entity.security_token.set_value("TestEditToken")
    account.entity.account_radio.select("No")
    self.assert_util(
        account.entity.save,
        "Field Name is required",
        left_args={"expect_error": True},
    )
    account.entity.name.set_value("abc")
    self.assert_util(account.entity.is_error_closed, True)

test_account_required_field_password(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies required field password

Source code in tests/ui/test_configuration_page_account_tab.py
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_required_field_password(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies required field password"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.environment.select("Value2")
    account.entity.multiple_select.select("Option Two")
    account.entity.username.set_value("TestEditUser")
    account.entity.security_token.set_value("TestEditToken")
    account.entity.account_radio.select("No")
    self.assert_util(
        account.entity.save,
        "Field Password is required",
        left_args={"expect_error": True},
    )

test_account_required_field_username(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies required field username

Source code in tests/ui/test_configuration_page_account_tab.py
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_required_field_username(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies required field username"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.environment.select("Value2")
    account.entity.multiple_select.select("Option Two")
    account.entity.password.set_value("TestEditPassword")
    account.entity.security_token.set_value("TestEditToken")
    account.entity.account_radio.select("No")
    self.assert_util(
        account.entity.save,
        "Field Username is required",
        left_args={"expect_error": True},
    )

test_account_search_value_example_multiple_select(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies example multiple select search functionality

Source code in tests/ui/test_configuration_page_account_tab.py
707
708
709
710
711
712
713
714
715
716
717
718
719
720
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_search_value_example_multiple_select(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies example multiple select search functionality"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    self.assert_util(
        account.entity.multiple_select.search_get_list,
        ["Option One"],
        left_args={"value": "Option One"},
    )

test_account_select_value_auth_type(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Select the all the values from single select and verifies the selected value

Source code in tests/ui/test_configuration_page_account_tab.py
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.account
@pytest.mark.forwarder
def test_account_select_value_auth_type(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Select the all the values from single select and verifies the selected value"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    auth_value_dict = {
        "basic": "Basic Authentication",
        "oauth": "OAuth 2.0 Authentication",
    }
    for auth_type_value, auth_type_name in auth_value_dict.items():
        if account.entity.auth_type.get_value() != auth_type_value:
            account.entity.auth_type.select(auth_type_name)
        self.assert_util(account.entity.auth_type.get_value, auth_type_value)

test_account_select_value_example_environment(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies example environment select value

Source code in tests/ui/test_configuration_page_account_tab.py
666
667
668
669
670
671
672
673
674
675
676
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_select_value_example_environment(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies example environment select value"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.environment.select("Value2")
    self.assert_util(account.entity.environment.get_value, "Value2")

test_account_select_value_example_multiple_select(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies example multiple select value

Source code in tests/ui/test_configuration_page_account_tab.py
692
693
694
695
696
697
698
699
700
701
702
703
704
705
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_select_value_example_multiple_select(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies example multiple select value"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.multiple_select.select("Option One")
    account.entity.multiple_select.select("Option Two")
    self.assert_util(
        account.entity.multiple_select.get_values, ["Option One", "Option Two"]
    )

test_account_sort_functionality(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_multiple_account)

Verifies sorting functionality for name column

Source code in tests/ui/test_configuration_page_account_tab.py
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_sort_functionality(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_multiple_account
):
    """Verifies sorting functionality for name column"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.sort_column("Name")
    sort_order = account.table.get_sort_order()
    column_values = list(account.table.get_column_values("Name"))
    column_values = list(str(item) for item in column_values)
    sorted_values = sorted(column_values, key=str.lower)
    self.assert_util(sort_order["header"].lower(), "name")
    self.assert_util(column_values, sorted_values)
    self.assert_util(sort_order["ascending"], True)

test_account_title_and_description(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies title and discription

Source code in tests/ui/test_configuration_page_account_tab.py
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.account
@pytest.mark.forwarder
def test_account_title_and_description(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies title and discription"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    self.assert_util(account.title.wait_to_display, "Configuration")
    self.assert_util(
        account.description.wait_to_display,
        "Set up your add-on",
    )

test_account_url_validation(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Source code in tests/ui/test_configuration_page_account_tab.py
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.account
@pytest.mark.forwarder
def test_account_url_validation(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG.get("name"))
    invalid_url = "invalid_url"
    account.entity.URL.set_value(invalid_url)
    self.assert_util(
        account.entity.save(expect_error=True),
        "Invalid URL provided. URL should start with 'https' as only secure URLs are supported. Provide URL in this format",  # noqa: E501
    )

test_account_valid_account_name(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies whether adding special characters, number in starting of name field displays validation error

Source code in tests/ui/test_configuration_page_account_tab.py
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_valid_account_name(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies whether adding special characters, number in starting of name field displays validation error"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
    account.entity.password.set_value(_ACCOUNT_CONFIG["password"])
    account.entity.name.set_value("123TestAccount")
    self.assert_util(
        account.entity.save,
        "Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.",
        left_args={"expect_error": True},
    )
    account.entity.name.set_value("TestAccount&")
    self.assert_util(
        account.entity.save,
        "Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.",
        left_args={"expect_error": True},
    )
    account.entity.name.set_value("a" * 51)
    self.assert_util(
        account.entity.save,
        "Length of ID should be between 1 and 50",
        left_args={"expect_error": True},
    )

test_account_valid_input_account_name(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies validation of field account_name

Source code in tests/ui/test_configuration_page_account_tab.py
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.account
@pytest.mark.forwarder
def test_account_valid_input_account_name(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies validation of field account_name"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value("1234")
    account.entity.URL.set_value(_ACCOUNT_CONFIG.get("url"))
    if account.entity.auth_type.get_value() == "oauth":
        account.entity.auth_type.select(_ACCOUNT_CONFIG.get("auth_type"))
    account.entity.username.set_value(_ACCOUNT_CONFIG.get("username"))
    account.entity.password.set_value(_ACCOUNT_CONFIG.get("password"))
    self.assert_util(
        account.entity.save,
        "Name must begin with a letter and consist exclusively of alphanumeric characters and underscores.",
        left_args={"expect_error": True},
    )

test_account_valid_length_name(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies the name field should not be more than 50 characters

Source code in tests/ui/test_configuration_page_account_tab.py
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_account_valid_length_name(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies the name field should not be more than 50 characters"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
    account.entity.password.set_value(_ACCOUNT_CONFIG["password"])
    account.entity.name.set_value("t" * 51)
    self.assert_util(
        account.entity.save,
        "Length of ID should be between 1 and 50",
        left_args={"expect_error": True},
    )

test_add_account_duplicate_name(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies by saving an entity with duplicate name at time of add it displays and error

Source code in tests/ui/test_configuration_page_account_tab.py
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_add_account_duplicate_name(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies by saving an entity with duplicate name at time of add it displays and error"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.multiple_select.select("Option One")
    account.entity.username.set_value(_ACCOUNT_CONFIG["username"])
    account.entity.password.set_value(_ACCOUNT_CONFIG["password"])
    account.entity.account_radio.select("Yes")
    self.assert_util(
        account.entity.save,
        "Name {} is already in use".format(_ACCOUNT_CONFIG["name"]),
        left_args={"expect_error": True},
    )

test_clone_account_duplicate_name(ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account)

Verifies by saving an entity with duplicate name at time of clone it displays and error

Source code in tests/ui/test_configuration_page_account_tab.py
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.account
def test_clone_account_duplicate_name(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper, _add_account
):
    """Verifies by saving an entity with duplicate name at time of clone it displays and error"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.table.clone_row(_ACCOUNT_CONFIG["name"])
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    self.assert_util(
        account.entity.save,
        "Name {} is already in use".format(_ACCOUNT_CONFIG["name"]),
        left_args={"expect_error": True},
    )

test_example_validation_of_oauth_fields_too_short(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies required field client id

Source code in tests/ui/test_configuration_page_account_tab.py
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_validation_of_oauth_fields_too_short(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies required field client id"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.environment.select("Value2")
    account.entity.account_radio.select("No")
    account.entity.multiple_select.select("Option Two")
    account.entity.username.set_value("TestClientId")
    account.entity.password.set_value("ClientSecretTest")
    account.entity.security_token.set_value("SecurityTokenTest")
    account.entity.basic_oauth_text.set_value("Invalid")

    self.assert_util(
        account.entity.save,
        "Length should be between 10 and 4096",
        left_args={"expect_error": True},
    )

test_example_validation_of_oauth_fields_wrong_characters(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies required field client id

Source code in tests/ui/test_configuration_page_account_tab.py
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_validation_of_oauth_fields_wrong_characters(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies required field client id"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.environment.select("Value2")
    account.entity.account_radio.select("No")
    account.entity.multiple_select.select("Option Two")
    account.entity.username.set_value("TestClientId")
    account.entity.password.set_value("ClientSecretTest")
    account.entity.security_token.set_value("SecurityTokenTest")
    account.entity.basic_oauth_text.set_value(
        "Invalid due to special characters: !@#$%^&*()"
    )

    self.assert_util(
        account.entity.save,
        "Do not use special characters",
        left_args={"expect_error": True},
    )

test_example_validation_of_oauth_valid(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)

Verifies required field client id

Source code in tests/ui/test_configuration_page_account_tab.py
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
@pytest.mark.execute_enterprise_cloud_true
@pytest.mark.forwarder
@pytest.mark.input
def test_example_validation_of_oauth_valid(
    self, ucc_smartx_selenium_helper, ucc_smartx_rest_helper
):
    """Verifies required field client id"""
    account = AccountPage(ucc_smartx_selenium_helper, ucc_smartx_rest_helper)
    account.entity.open()
    account.entity.name.set_value(_ACCOUNT_CONFIG["name"])
    account.entity.environment.select("Value2")
    account.entity.account_radio.select("No")
    account.entity.multiple_select.select("Option Two")
    account.entity.username.set_value("TestClientId")
    account.entity.password.set_value("ClientSecretTest")
    account.entity.security_token.set_value("SecurityTokenTest")
    account.entity.basic_oauth_text.set_value("Valid_text_for_oauth")

    self.assert_util(account.entity.save, True)

    account.table.wait_for_rows_to_appear(1)

    self.assert_util(
        account.table.get_table()[_ACCOUNT_CONFIG["name"]],
        {
            "name": _ACCOUNT_CONFIG["name"],
            "auth type": "basic",
            "actions": "Edit | Clone | Delete",
        },
    )