From a02946e5ec93d642726f1358d56223f9021c8eef Mon Sep 17 00:00:00 2001 From: Mateusz Szostok Date: Tue, 18 Jun 2024 19:51:26 +0200 Subject: [PATCH] Add more screenshots --- .../botkube_page_helpers_test.go | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/test/cloud-slack-dev-e2e/botkube_page_helpers_test.go b/test/cloud-slack-dev-e2e/botkube_page_helpers_test.go index 0d92196a8..37a3858cb 100644 --- a/test/cloud-slack-dev-e2e/botkube_page_helpers_test.go +++ b/test/cloud-slack-dev-e2e/botkube_page_helpers_test.go @@ -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") @@ -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 {