# NOTE: Generated By HttpRunner v3.1.4
# FROM: har/mubu.har


from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase


class TestCaseMubu(HttpRunner):
    config = Config("testcase description").verify(False).variables(
        **{"data_unique_id": "2b7540fa-9d38-4f6f-9bae-9096fb781618"})  # 定义全局环境变量

    teststeps = [
        Step(
            RunRequest("/login")
                .get("https://mubu.com/login")
                .with_headers(
                **{
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "upgrade-insecure-requests": "1",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
                    "sec-fetch-site": "same-origin",
                    "sec-fetch-mode": "navigate",
                    "sec-fetch-user": "?1",
                    "sec-fetch-dest": "document",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_cookies(
                **{
                    "_ga": "GA1.2.2128988841.1608641787",
                    "use-redesign": "1",
                    "data_unique_id": "$data_unique_id",
                    "reg_entrance": "https%3A%2F%2Fmubu.com%2F",
                    "_gid": "GA1.2.1940696041.1617714709",
                    "csrf_token": "6bc93b86-9e1f-4e14-b1ee-ce4ea52b9d20",
                    "language": "en-US",
                    "country": "US",
                    "Hm_lvt_4426cbb0486a79ea049b4ad52d81b504": "1617714709,1617766493",
                    "reg_prepareId": "178aa664792-178aa664644-462f-b7c4-162215fe122a",
                    "reg_focusId": "c0b56d50-108f-462f-b7c4-178aa664bf6",
                    "SESSION": "19e42993-1969-4559-a50e-3736d5367140",
                    "_gat": "1",
                    "SLARDAR_WEB_ID": "90101de0-36aa-4b60-9da3-86ec793d31c2",
                    "Hm_lpvt_4426cbb0486a79ea049b4ad52d81b504": "1617767662",
                }
            )
                .validate()
                .assert_equal("status_code", 200)
        ),
        Step(
            RunRequest("/login/password")
                .get("https://mubu.com/login/password")
                .with_headers(
                **{
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "upgrade-insecure-requests": "1",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
                    "sec-fetch-site": "same-origin",
                    "sec-fetch-mode": "navigate",
                    "sec-fetch-user": "?1",
                    "sec-fetch-dest": "document",
                    "referer": "https://mubu.com/login",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_cookies(
                **{
                    "_ga": "GA1.2.2128988841.1608641787",
                    "use-redesign": "1",
                    "data_unique_id": "$data_unique_id",
                    "reg_entrance": "https%3A%2F%2Fmubu.com%2F",
                    "_gid": "GA1.2.1940696041.1617714709",
                    "csrf_token": "6bc93b86-9e1f-4e14-b1ee-ce4ea52b9d20",
                    "language": "en-US",
                    "country": "US",
                    "Hm_lvt_4426cbb0486a79ea049b4ad52d81b504": "1617714709,1617766493",
                    "SESSION": "19e42993-1969-4559-a50e-3736d5367140",
                    "_gat": "1",
                    "SLARDAR_WEB_ID": "fec7009d-51ad-451e-874f-4854b6cf7a86",
                    "Hm_lpvt_4426cbb0486a79ea049b4ad52d81b504": "1617767669",
                    "reg_focusId": "f5cc6801-2a4f-4609-b606-178aa779d63",
                    "reg_prepareId": "178aa77aacd-178aa779c56-4609-b606-8cbf8ca984a3",
                }
            )
                .validate()
                .assert_equal("status_code", 200)
        ),
        Step(
            RunRequest("/api/login/submit")
                .post("https://mubu.com/api/login/submit")
                .with_headers(
                **{
                    "content-length": "52",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "accept": "application/json, text/javascript, */*; q=0.01",
                    "x-requested-with": "XMLHttpRequest",
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "content-type": "application/x-www-form-urlencoded; charset=UTF-8",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-origin",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/login/password",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_cookies(
                **{
                    "_ga": "GA1.2.2128988841.1608641787",
                    "use-redesign": "1",
                    "data_unique_id": "$data_unique_id",
                    "reg_entrance": "https%3A%2F%2Fmubu.com%2F",
                    "_gid": "GA1.2.1940696041.1617714709",
                    "csrf_token": "6bc93b86-9e1f-4e14-b1ee-ce4ea52b9d20",
                    "language": "en-US",
                    "country": "US",
                    "Hm_lvt_4426cbb0486a79ea049b4ad52d81b504": "1617714709,1617766493",
                    "SESSION": "19e42993-1969-4559-a50e-3736d5367140",
                    "_gat": "1",
                    "reg_focusId": "f5cc6801-2a4f-4609-b606-178aa779d63",
                    "reg_prepareId": "178aa77aacd-178aa779c56-4609-b606-8cbf8ca984a3",
                    "SLARDAR_WEB_ID": "926776e7-500d-4843-852d-83204a89e8a4",
                    "Hm_lpvt_4426cbb0486a79ea049b4ad52d81b504": "1617767674",
                }
            )
                .with_data(
                {"phone": "13153117137", "password": "yaoyingdong", "remember": "true"}
            )
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
                .assert_equal("body.msg", None)
                .assert_equal("body.data.next", "/app")  # 添加断言
        ),
        Step(
            RunRequest("/app")
                .get("https://mubu.com/app")
                .with_headers(
                **{
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "upgrade-insecure-requests": "1",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
                    "sec-fetch-site": "same-origin",
                    "sec-fetch-mode": "navigate",
                    "sec-fetch-user": "?1",
                    "sec-fetch-dest": "document",
                    "referer": "https://mubu.com/login/password",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_cookies(
                **{
                    "_ga": "GA1.2.2128988841.1608641787",
                    "use-redesign": "1",
                    "data_unique_id": "$data_unique_id",
                    "reg_entrance": "https%3A%2F%2Fmubu.com%2F",
                    "_gid": "GA1.2.1940696041.1617714709",
                    "csrf_token": "6bc93b86-9e1f-4e14-b1ee-ce4ea52b9d20",
                    "language": "en-US",
                    "country": "US",
                    "Hm_lvt_4426cbb0486a79ea049b4ad52d81b504": "1617714709,1617766493",
                    "SESSION": "19e42993-1969-4559-a50e-3736d5367140",
                    "_gat": "1",
                    "reg_focusId": "f5cc6801-2a4f-4609-b606-178aa779d63",
                    "reg_prepareId": "178aa77aacd-178aa779c56-4609-b606-8cbf8ca984a3",
                    "SLARDAR_WEB_ID": "926776e7-500d-4843-852d-83204a89e8a4",
                    "Hm_lpvt_4426cbb0486a79ea049b4ad52d81b504": "1617767674",
                    "Jwt-Token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "user_persistence": "2d932be9-2c9c-40e2-89f7-d1eba197df5b",
                }
            )
                .validate()
                .assert_equal("status_code", 200)
        ),
        Step(
            RunRequest("/v3/api/user/profile")
                .post("https://api2.mubu.com/v3/api/user/profile")
                .with_headers(
                **{
                    "content-length": "0",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "c6e682ec-dbee-4aa4-aadd-200ea035cf02",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_data("")
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/list/item_count")
                .post("https://api2.mubu.com/v3/api/list/item_count")
                .with_headers(
                **{
                    "content-length": "30",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "d6676e63-0a6c-4638-8610-9052f0f26103",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"folderId": 0, "source": "home"})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/list/get")
                .post("https://api2.mubu.com/v3/api/list/get")
                .with_headers(
                **{
                    "content-length": "58",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "bf64f072-8a5a-498f-84ba-dec5a8fbd26a",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json(
                {"folderId": 0, "sort": "time", "keywords": "", "source": "home"}
            )
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/list/star_relation/get")
                .get("https://api2.mubu.com/v3/api/list/star_relation/get")
                .with_headers(
                **{
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "12129fa8-1c23-41cd-8012-e40c083ce5cc",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/list/get_all_documents_page")
                .post("https://api2.mubu.com/v3/api/list/get_all_documents_page")
                .with_headers(
                **{
                    "content-length": "12",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "ffdef834-b13c-4d11-8c40-6f1c8b3d80c0",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"start": ""})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)

        ),
        Step(
            RunRequest("/v3/api/user/get_user_params")
                .post("https://api2.mubu.com/v3/api/user/get_user_params")
                .with_headers(
                **{
                    "content-length": "0",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "a5edeb4d-b2dd-48c7-aa05-be65fd10ef4b",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_data("")
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/list/item_count")
                .post("https://api2.mubu.com/v3/api/list/item_count")
                .with_headers(
                **{
                    "content-length": "30",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "d6676e63-0a6c-4638-8610-9052f0f26103",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"folderId": 0, "source": "home"})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/message/get_message_unread")
                .post("https://api2.mubu.com/v3/api/message/get_message_unread")
                .with_headers(
                **{
                    "content-length": "10",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "5c802f01-1718-4883-b413-3285844333b6",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"page": 1})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/list/create_folder")
                .post("https://api2.mubu.com/v3/api/list/create_folder")
                .with_headers(
                **{
                    "content-length": "39",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "64cf1242-9f9e-401e-94d4-af7ac09b414a",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"name": "hogwarts_demo", "folderId": "0"})
                .extract()  # 另外加的
                .with_jmespath('body.data.folder.id', 'folderId')  # 另外加的
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/list/item_count")
                .post("https://api2.mubu.com/v3/api/list/item_count")
                .with_headers(
                **{
                    "content-length": "41",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "2f2d7aac-4e06-4f80-8298-b2e149afda4b",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"folderId": "$folderId", "source": "home"})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/list/create_doc")
                .post("https://api2.mubu.com/v3/api/list/create_doc")
                .with_headers(
                **{
                    "content-length": "34",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "59ec6501-5d1c-48e2-8362-63c1b0b0913e",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"folderId": "$folderId", "type": 0})
                .extract()
                .with_jmespath('body.data.id', 'docId')
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/list/item_count")
                .post("https://api2.mubu.com/v3/api/list/item_count")
                .with_headers(
                **{
                    "content-length": "30",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "c9731522-7b83-4eff-bddd-730eb1829e73",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"folderId": 0, "source": "home"})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/user/current_level")
                .post("https://api2.mubu.com/v3/api/user/current_level")
                .with_headers(
                **{
                    "content-length": "28",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "6b30ad63-a61a-4046-be82-4aa19715d8a0",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"document_id": "$docId"})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/document/edit/get")
                .post("https://api2.mubu.com/v3/api/document/edit/get")
                .with_headers(
                **{
                    "content-length": "36",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "2d7289f3-9d7e-4930-bd73-0eefa888dea1",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"docId": "$docId", "password": ""})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/refer/doc/list")
                .post("https://api2.mubu.com/v3/api/refer/doc/list")
                .with_headers(
                **{
                    "content-length": "28",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "39b97d1b-092a-493e-b56a-18158f775ac9",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"targetDocId": "$docId"})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/colla/register")
                .get("https://api2.mubu.com/v3/api/colla/register")
                .with_headers(
                **{
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "x-request-id": "a9420dbd-f350-49fe-8fac-a58d33ffd057",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/refer/node/count")
                .post("https://api2.mubu.com/v3/api/refer/node/count")
                .with_headers(
                **{
                    "content-length": "28",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "0d46dcde-ac65-493e-a7e2-09257ce680b3",
                    "version": "3.0.0.21310",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"targetDocId": "$docId"})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/colla/members")
                .options("https://api2.mubu.com/v3/api/colla/members")
                .with_params(**{"memberId": "5990846188234224", "documentId": "$docId"})
                .with_headers(
                **{
                    "accept": "*/*",
                    "access-control-request-method": "GET",
                    "access-control-request-headers": "data-unique-id,jwt-token,request-id,x-request-id",
                    "origin": "https://mubu.com",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .validate()
                .assert_equal("status_code", 200)
        ),
        Step(
            RunRequest("/v3/api/colla/members")
                .get("https://api2.mubu.com/v3/api/colla/members")
                .with_params(**{"memberId": "5990846188234224", "documentId": "$docId"})
                .with_headers(
                **{
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "request-id": "members:5990846188234224:1617767695799",
                    "x-request-id": "c55c1265-5f11-4b5c-9430-719b9ac53d26",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/colla/message")
                .post("https://api2.mubu.com/v3/api/colla/message")
                .with_headers(
                **{
                    "content-length": "566",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "member-id": "5990846188234224",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "request-id": "MESSAGE:10294044:5990846188234224:3",
                    "x-request-id": "e3d98b6c-ce4f-4bab-8cfb-7e140c43bfad",
                    "version": "3.0.0",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json(
                {
                    "engineType": "MUBU",
                    "messageType": "BROADCAST",
                    "reqId": 3,
                    "requestId": "MESSAGE:10294044:5990846188234224:3",
                    "token": "$docId",
                    "data": {
                        "message": {
                            "type": "CHANGE",
                            "documentId": "$docId",
                            "version": 0,
                            "content": [
                                {"name": "nameChanged", "title": "t", "original": ""},
                                {"name": "nameChanged", "title": "ti", "original": "t"},
                                {
                                    "name": "nameChanged",
                                    "title": "tit",
                                    "original": "ti",
                                },
                                {
                                    "name": "nameChanged",
                                    "title": "titl",
                                    "original": "tit",
                                },
                                {
                                    "name": "nameChanged",
                                    "title": "title",
                                    "original": "titl",
                                },
                            ],
                        }
                    },
                    "context": {
                        "os": "macOS",
                        "osVersion": "11.1.0",
                        "appVersion": "default",
                        "platform": "web",
                    },
                }
            )
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/refer/search_refers")
                .post("https://api2.mubu.com/v3/api/refer/search_refers")
                .with_headers(
                **{
                    "content-length": "52",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "x-request-id": "1787f963-531a-4d07-a354-c46a2c784d0f",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json({"docId": "$docId", "keywords": "title", "option": 1})
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/colla/message")
                .post("https://api2.mubu.com/v3/api/colla/message")
                .with_headers(
                **{
                    "content-length": "651",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "member-id": "5990846188234224",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "request-id": "MESSAGE:10294044:5990846188234224:5",
                    "x-request-id": "43977b46-be17-42c8-ba9c-980eff9ce10e",
                    "version": "3.0.0",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json(
                {
                    "engineType": "MUBU",
                    "messageType": "BROADCAST",
                    "reqId": 5,
                    "requestId": "MESSAGE:10294044:5990846188234224:5",
                    "token": "$docId",
                    "data": {
                        "message": {
                            "type": "CHANGE",
                            "documentId": "$docId",
                            "version": 1,
                            "content": [
                                {
                                    "name": "create",
                                    "created": [
                                        {
                                            "index": 0,
                                            "parentId": None,
                                            "node": {
                                                "id": "rLzotwjR4y",
                                                "text": "",
                                                "modified": 1617767698072,
                                                "children": [],
                                            },
                                            "path": ["nodes", 0],
                                        }
                                    ],
                                },
                                {
                                    "name": "update",
                                    "updated": [
                                        {
                                            "updated": {
                                                "id": "rLzotwjR4y",
                                                "text": "<span>de</span>",
                                                "modified": 1617767698553,
                                            },
                                            "original": {
                                                "id": "rLzotwjR4y",
                                                "text": "",
                                                "modified": 1617767698072,
                                            },
                                            "path": ["nodes", 0],
                                        }
                                    ],
                                },
                            ],
                        }
                    },
                    "context": {
                        "os": "macOS",
                        "osVersion": "11.1.0",
                        "appVersion": "default",
                        "platform": "web",
                    },
                }
            )
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/colla/message")
                .post("https://api2.mubu.com/v3/api/colla/message")
                .with_headers(
                **{
                    "content-length": "515",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "member-id": "5990846188234224",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "request-id": "MESSAGE:10294044:5990846188234224:8",
                    "x-request-id": "4794d4e5-884f-444f-94a9-67b23a0d7b66",
                    "version": "3.0.0",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json(
                {
                    "engineType": "MUBU",
                    "messageType": "BROADCAST",
                    "reqId": 8,
                    "requestId": "MESSAGE:10294044:5990846188234224:8",
                    "token": "$docId",
                    "data": {
                        "message": {
                            "type": "CHANGE",
                            "documentId": "$docId",
                            "version": 2,
                            "content": [
                                {
                                    "name": "update",
                                    "updated": [
                                        {
                                            "updated": {
                                                "id": "rLzotwjR4y",
                                                "text": "<span>demo</span>",
                                                "modified": 1617767698864,
                                            },
                                            "original": {
                                                "id": "rLzotwjR4y",
                                                "text": "<span>de</span>",
                                                "modified": 1617767698553,
                                            },
                                            "path": ["nodes", 0],
                                        }
                                    ],
                                }
                            ],
                        }
                    },
                    "context": {
                        "os": "macOS",
                        "osVersion": "11.1.0",
                        "appVersion": "default",
                        "platform": "web",
                    },
                }
            )
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
        Step(
            RunRequest("/v3/api/colla/message")
                .post("https://api2.mubu.com/v3/api/colla/message")
                .with_headers(
                **{
                    "content-length": "517",
                    "sec-ch-ua": '"Google Chrome";v="89", "Chromium";v="89", ";Not A Brand";v="99"',
                    "sec-ch-ua-mobile": "?0",
                    "member-id": "5990846188234224",
                    "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36",
                    "data-unique-id": "$data_unique_id",
                    "content-type": "application/json;charset=UTF-8",
                    "accept": "application/json, text/plain, */*",
                    "jwt-token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzUxMiJ9.eyJhcHAiOiJtdWJ1Iiwic3ViIjoiMTAyOTQwNDQiLCJleHAiOjE2MjAzNTk2NzYsImlhdCI6MTYxNzc2NzY3Nn0.7E5eqv6XD3V3h36PrmgrnE-rucSL9f43aoratwAlnkmURVG64_swm2KrUNwdbHaNslbQb4sIB22DjVEW3pcYSg",
                    "request-id": "MESSAGE:10294044:5990846188234224:9",
                    "x-request-id": "3335f2ed-9194-4852-8da6-9e3e88a19c53",
                    "version": "3.0.0",
                    "origin": "https://mubu.com",
                    "sec-fetch-site": "same-site",
                    "sec-fetch-mode": "cors",
                    "sec-fetch-dest": "empty",
                    "referer": "https://mubu.com/",
                    "accept-encoding": "gzip, deflate, br",
                    "accept-language": "zh-CN,zh;q=0.9",
                }
            )
                .with_json(
                {
                    "engineType": "MUBU",
                    "messageType": "BROADCAST",
                    "reqId": 9,
                    "requestId": "MESSAGE:10294044:5990846188234224:9",
                    "token": "$docId",
                    "data": {
                        "message": {
                            "type": "CHANGE",
                            "documentId": "$docId",
                            "version": 3,
                            "content": [
                                {
                                    "name": "update",
                                    "updated": [
                                        {
                                            "updated": {
                                                "id": "rLzotwjR4y",
                                                "text": "<span>demo</span>",
                                                "modified": 1617767699617,
                                            },
                                            "original": {
                                                "id": "rLzotwjR4y",
                                                "text": "<span>demo</span>",
                                                "modified": 1617767698864,
                                            },
                                            "path": ["nodes", 0],
                                        }
                                    ],
                                }
                            ],
                        }
                    },
                    "context": {
                        "os": "macOS",
                        "osVersion": "11.1.0",
                        "appVersion": "default",
                        "platform": "web",
                    },
                }
            )
                .validate()
                .assert_equal("status_code", 200)
                .assert_equal("body.code", 0)
        ),
    ]


if __name__ == "__main__":
    TestCaseMubu().test_start()
