@@ -1065,6 +1065,104 @@ def test_clear_all_presigned_urls(
10651065 assert r .json ()["success" ]
10661066
10671067
1068+ def test_all_crawls_tag_counts (crawler_auth_headers , default_org_id ):
1069+ r = requests .get (
1070+ f"{ API_PREFIX } /orgs/{ default_org_id } /all-crawls/tagCounts" ,
1071+ headers = crawler_auth_headers ,
1072+ )
1073+ assert r .status_code == 200
1074+ assert r .json () == {
1075+ "tags" : [
1076+ {"tag" : "wr-test-1" , "count" : 3 },
1077+ {"tag" : "wr-test-2" , "count" : 2 },
1078+ {"tag" : "all-crawls" , "count" : 1 },
1079+ {"tag" : "behaviors" , "count" : 1 },
1080+ {"tag" : "four" , "count" : 1 },
1081+ {"tag" : "qa" , "count" : 1 },
1082+ {"tag" : "three" , "count" : 1 },
1083+ {"tag" : "wr-test-1-updated-again" , "count" : 1 },
1084+ {"tag" : "wr-test-2-updated-again" , "count" : 1 },
1085+ ]
1086+ }
1087+
1088+
1089+ def test_all_crawls_tag_counts_including_failed (
1090+ crawler_auth_headers , default_org_id , canceled_crawl_id
1091+ ):
1092+ r = requests .get (
1093+ f"{ API_PREFIX } /orgs/{ default_org_id } /all-crawls/tagCounts?onlySuccessful=false" ,
1094+ headers = crawler_auth_headers ,
1095+ )
1096+ assert r .status_code == 200
1097+ assert r .json () == {
1098+ "tags" : [
1099+ {"tag" : "wr-test-1" , "count" : 3 },
1100+ {"tag" : "wr-test-2" , "count" : 2 },
1101+ {"tag" : "all-crawls" , "count" : 1 },
1102+ {"tag" : "behaviors" , "count" : 1 },
1103+ {"tag" : "canceled" , "count" : 1 },
1104+ {"tag" : "four" , "count" : 1 },
1105+ {"tag" : "qa" , "count" : 1 },
1106+ {"tag" : "three" , "count" : 1 },
1107+ {"tag" : "wr-test-1-updated-again" , "count" : 1 },
1108+ {"tag" : "wr-test-2-updated-again" , "count" : 1 },
1109+ ]
1110+ }
1111+
1112+
1113+ def test_crawls_tag_counts (crawler_auth_headers , default_org_id ):
1114+ r = requests .get (
1115+ f"{ API_PREFIX } /orgs/{ default_org_id } /crawls/tagCounts" ,
1116+ headers = crawler_auth_headers ,
1117+ )
1118+ assert r .status_code == 200
1119+ assert r .json () == {
1120+ "tags" : [
1121+ {"tag" : "wr-test-1" , "count" : 3 },
1122+ {"tag" : "wr-test-2" , "count" : 2 },
1123+ {"tag" : "all-crawls" , "count" : 1 },
1124+ {"tag" : "behaviors" , "count" : 1 },
1125+ {"tag" : "qa" , "count" : 1 },
1126+ ]
1127+ }
1128+
1129+
1130+ def test_crawls_tag_counts_including_failed (
1131+ crawler_auth_headers , default_org_id , canceled_crawl_id
1132+ ):
1133+ r = requests .get (
1134+ f"{ API_PREFIX } /orgs/{ default_org_id } /crawls/tagCounts?onlySuccessful=false" ,
1135+ headers = crawler_auth_headers ,
1136+ )
1137+ assert r .status_code == 200
1138+ assert r .json () == {
1139+ "tags" : [
1140+ {"tag" : "wr-test-1" , "count" : 3 },
1141+ {"tag" : "wr-test-2" , "count" : 2 },
1142+ {"tag" : "all-crawls" , "count" : 1 },
1143+ {"tag" : "behaviors" , "count" : 1 },
1144+ {"tag" : "canceled" , "count" : 1 },
1145+ {"tag" : "qa" , "count" : 1 },
1146+ ]
1147+ }
1148+
1149+
1150+ def test_uploads_tag_counts (crawler_auth_headers , default_org_id ):
1151+ r = requests .get (
1152+ f"{ API_PREFIX } /orgs/{ default_org_id } /uploads/tagCounts" ,
1153+ headers = crawler_auth_headers ,
1154+ )
1155+ assert r .status_code == 200
1156+ assert r .json () == {
1157+ "tags" : [
1158+ {"tag" : "four" , "count" : 1 },
1159+ {"tag" : "three" , "count" : 1 },
1160+ {"tag" : "wr-test-1-updated-again" , "count" : 1 },
1161+ {"tag" : "wr-test-2-updated-again" , "count" : 1 },
1162+ ]
1163+ }
1164+
1165+
10681166def test_delete_form_upload_and_crawls_from_all_crawls (
10691167 admin_auth_headers ,
10701168 crawler_auth_headers ,
0 commit comments