From 3aae2c5d1dacd42e4a7bbe2b0e2d1a6cbeec838d Mon Sep 17 00:00:00 2001 From: "sweep-ai[bot]" <128439645+sweep-ai[bot]@users.noreply.github.com> Date: Thu, 1 Feb 2024 01:32:04 +0000 Subject: [PATCH] feat: Updated test/e2e/e2e.go --- test/e2e/e2e.go | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/test/e2e/e2e.go b/test/e2e/e2e.go index a3d3b1bcf5..dfb1ea1107 100644 --- a/test/e2e/e2e.go +++ b/test/e2e/e2e.go @@ -28,8 +28,16 @@ import ( // This function is called on each Ginkgo node in parallel mode. func RunE2ETests(t *testing.T) { - // Example usage of new functions - token, _ := gettoken.GetUserToken("openIM123456") + // Set headers for operationID and token + operationID := "e2e-test-operation-id" + token, err := gettoken.GetUserToken("openIM123456") + if err != nil { + t.Fatalf("Failed to get user token: %v", err) + } + headers := map[string]string{ + "token": token, + "operationID": operationID, + } // Example of getting user info _ = user.GetUsersInfo(token, []string{"user1", "user2"}) @@ -49,3 +57,15 @@ func RunE2ETests(t *testing.T) { // Example of getting users _ = user.GetUsers(token, 1, 100) } + // Example of getting users' online status + _ = user.GetUsersOnlineStatus(token, []string{"user1", "user2"}) + + // Example of forcing a logout + _ = user.ForceLogout(token, "4950983283", 2) + + // Example of checking user account + _ = user.CheckUserAccount(token, []string{"openIM123456", "anotherUserID"}) + + // Example of getting users + _ = user.GetUsers(token, 1, 100) +}