From f5c76ff345242817af716921765777d48144b8c4 Mon Sep 17 00:00:00 2001 From: guqing Date: Mon, 27 Nov 2023 15:47:28 +0800 Subject: [PATCH] fix: e2e test case --- e2e/testsuite.yaml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/e2e/testsuite.yaml b/e2e/testsuite.yaml index 7913439d46d..467827840c0 100644 --- a/e2e/testsuite.yaml +++ b/e2e/testsuite.yaml @@ -3,7 +3,7 @@ api: | {{default "http://halo:8090" (env "SERVER")}}/apis param: postName: "{{randAlpha 6}}" - userName: "{{randAlpha 6}}" + userName: "{{.param.userName}}" notificationName: "{{randAlpha 6}}" auth: "Basic YWRtaW46MTIzNDU2" items: @@ -96,7 +96,7 @@ items: body: | { "spec": { - "recipient": "{{.param.userName}}", + "recipient": "admin", "reason": "fake-reason", "title": "test 评论了你的页面《关于我》", "rawContent": "Fake raw content", @@ -114,10 +114,21 @@ items: Authorization: "{{.param.auth}}" expect: statusCode: 201 +- name: getNotificationByName + request: + api: /notification.halo.run/v1alpha1/notifications/{{.param.notificationName}} + method: GET + header: + Authorization: "{{.param.auth}}" + expect: + statusCode: 200 + verify: + - data.spec.reason == "fake-reason" + - data.spec.title == "test 评论了你的页面《关于我》" - name: deleteUserNotification request: api: | - /api.notification.halo.run/userspaces/{{.param.userName}}/v1alpha1/notifications/{{.param.notificationName}} + /api.notification.halo.run/v1alpha1/userspaces/admin/notifications/{{.param.notificationName}} method: DELETE header: Authorization: "{{.param.auth}}"