Skip to content

Commit

Permalink
Fix Cloud Slack Dev E2E tests after Botkube release (#1288)
Browse files Browse the repository at this point in the history
  • Loading branch information
pkosiec authored Oct 10, 2023
1 parent 86c22c8 commit 5e6aed6
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions test/cloud-slack-dev-e2e/cloud_slack_dev_e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"github.com/kubeshop/botkube/test/cloud_graphql"
gqlModel "github.com/kubeshop/botkube/test/cloud_graphql/model"
"github.com/kubeshop/botkube/test/commplatform"
"github.com/kubeshop/botkube/test/diff"
"github.com/kubeshop/botkube/test/helmx"
)

Expand Down Expand Up @@ -481,12 +482,20 @@ func TestCloudSlackE2E(t *testing.T) {

t.Log("Waiting for watch begin message...")
expectedWatchBeginMsg := fmt.Sprintf("My watch begins for cluster '%s'! :crossed_swords:", deployment.Name)
err = tester.WaitForLastMessageEqual(tester.BotUserID(), channel.ID(), expectedWatchBeginMsg)
recentMessages := 2 // take into the account the optional "upgrade checker message"
err = tester.WaitForMessagePosted(tester.BotUserID(), channel.ID(), recentMessages, func(msg string) (bool, int, string) {
if !strings.EqualFold(expectedWatchBeginMsg, msg) {
count := diff.CountMatchBlock(expectedWatchBeginMsg, msg)
msgDiff := diff.Diff(expectedWatchBeginMsg, msg)
return false, count, msgDiff
}
return true, 0, ""
})
require.NoError(t, err)
tester.PostMessageToBot(t, channel.ID(), "list sources")

t.Log("Waiting for empty source list...")
expectedSourceListMsg := fmt.Sprintf("%s\n```\nSOURCE ENABLED\n```", cmdHeader("list sources"))
expectedSourceListMsg := fmt.Sprintf("%s\n```\nSOURCE ENABLED RESTARTS STATUS LAST_RESTART\n```", cmdHeader("list sources"))
err = tester.WaitForLastMessageEqual(tester.BotUserID(), channel.ID(), expectedSourceListMsg)
require.NoError(t, err)
tester.PostMessageToBot(t, channel.ID(), "list actions")
Expand Down

0 comments on commit 5e6aed6

Please sign in to comment.