Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Cloud Slack Dev E2E tests after Botkube release #1288

Merged
merged 2 commits into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading