Skip to content

Commit

Permalink
Add more screenshots
Browse files Browse the repository at this point in the history
  • Loading branch information
mszostok committed Jun 18, 2024
1 parent 7ab399d commit a02946e
Showing 1 changed file with 22 additions and 12 deletions.
34 changes: 22 additions & 12 deletions test/cloud-slack-dev-e2e/botkube_page_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,17 +176,17 @@ func (p *BotkubeCloudPage) FinishWizard(t *testing.T) {

p.page.MustElementR("button", "/^Next$/i").
MustWaitEnabled().
// we need to wait, otherwise, we click the same 'Next' button twice, before the query is executed, and we are really
// moved to the next step. If we have the navigation updated for each step, it will be resolved.
MustClick().MustWaitStable()
// We need to wait, otherwise, we click the same 'Next' button twice before the query is executed, and we are not really
// moved to the next step. Updating the navigation would resolve that issue.
MustClick().MustWaitStable()

p.page.Screenshot("after-first-next")

t.Log("Using pre-selected plugins. Navigating to wizard summary")
p.page.MustElementR("button", "/^Next$/i").
MustWaitEnabled().
// we need to wait, otherwise, we click the same 'Next' button twice, before the query is executed, and we are really
// moved to the next step. If we have the navigation updated for each step, it will be resolved.
// We need to wait, otherwise, we click the same 'Next' button twice before the query is executed, and we are not really
// moved to the next step. Updating the navigation would resolve that issue.
MustClick().MustWaitStable()
p.page.Screenshot("after-second-next")

Expand All @@ -198,33 +198,43 @@ func (p *BotkubeCloudPage) FinishWizard(t *testing.T) {

// wait till gql mutation passes, and navigates to install details, otherwise, we could navigate to instance details with state 'draft'
p.page.MustWaitNavigation()
p.page.Screenshot()
p.page.Screenshot("after-deploy-changes-navigation")
}

func (p *BotkubeCloudPage) UpdateKubectlNamespace(t *testing.T) {
t.Log("Updating 'kubectl' namespace property")
p.page.MustElementR(`div[role="tab"]`, "Plugins").MustFocus().MustClick().MustWaitStable()

p.page.MustWaitStable()
p.page.MustElement(`button[id^="botkube/kubectl_"]`).MustClick()
p.page.MustElement(`div[data-node-key="ui-form"]`).MustClick()

p.openKubectlUpdateForm()

p.page.MustElementR("input#root_defaultNamespace", "default").MustSelectAllText().MustInput("kube-system")
p.page.Screenshot("after-changing-namespace-property")
p.page.MustElementR("button", "/^Update$/i").MustClick()
p.page.Screenshot("after-clicking-plugin-update")

t.Log("Submitting changes")
p.page.MustElementR("button", "/^Deploy changes$/i").MustClick().MustWaitStable()
p.page.Screenshot("after-deploying-plugin-changes")
}

func (p *BotkubeCloudPage) VerifyUpdatedKubectlNamespace(t *testing.T) {
t.Log("Verifying that the 'namespace' value was updated and persisted properly")

p.openKubectlUpdateForm()
p.page.MustElementR("input#root_defaultNamespace", "kube-system")
}

func (p *BotkubeCloudPage) openKubectlUpdateForm() {
p.page.Screenshot("before-selecting-plugins-tab")
p.page.MustElementR(`div[role="tab"]`, "Plugins").MustFocus().MustClick().MustWaitStable()

p.page.MustWaitStable()
p.page.Screenshot("after-selecting-plugins-tab")

p.page.MustElement(`button[id^="botkube/kubectl_"]`).MustClick()
p.page.Screenshot("after-opening-kubectl-cfg")

p.page.MustElement(`div[data-node-key="ui-form"]`).MustClick()
p.page.Screenshot("after-selecting-kubectl-cfg-form")
p.page.MustElementR("input#root_defaultNamespace", "kube-system")
}

func appendOrgIDQueryParam(t *testing.T, inURL, orgID string) string {
Expand Down

0 comments on commit a02946e

Please sign in to comment.