diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c1730b2b7ca748a10f6bc5370e6f34e0732f1f95..21784a30bee429c719bbdd3b662d130da723c740 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,13 +47,7 @@ # using merge request pipelines (see https://gitlab.com/gitlab-org/gitlab/-/issues/326098) .eventrouter_rules: rules: - - changes: - - flux/**/$APP*.yaml - - ansible/roles/apps/templates/settings/$APP.yaml - - ansible/roles/apps/tasks/$APP.yaml - - if: '$TRIGGER_JOBS =~ /enable-eventrouter/' - - if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*enable-eventrouter/' - - if: '$CI_COMMIT_BRANCH == "master"' + - when: always .grafana_rules: rules: @@ -61,29 +55,29 @@ - flux/**/$APP*.yaml - ansible/roles/apps/templates/settings/$APP.yaml - ansible/roles/apps/tasks/$APP.yaml + - test/behave/features/$APP.feature - if: '$TRIGGER_JOBS =~ /enable-grafana/' - if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*enable-grafana/' - if: '$CI_COMMIT_BRANCH == "master"' +.loki_stack_rules: + rules: + - when: always + .nextcloud_rules: rules: - changes: - flux/**/$APP*.yaml - ansible/roles/apps/templates/settings/$APP.yaml - ansible/roles/apps/tasks/$APP.yaml + - test/behave/features/$APP.feature - if: '$TRIGGER_JOBS =~ /enable-nextcloud/' - if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*enable-nextcloud/' - if: '$CI_COMMIT_BRANCH == "master"' .prometheus_rules: rules: - - changes: - - flux/**/$APP*.yaml - - ansible/roles/apps/templates/settings/$APP.yaml - - ansible/roles/apps/tasks/$APP.yaml - - if: '$TRIGGER_JOBS =~ /enable-prometheus/' - - if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*enable-prometheus/' - - if: '$CI_COMMIT_BRANCH == "master"' + - when: always .rocketchat_rules: rules: @@ -91,6 +85,7 @@ - flux/**/$APP*.yaml - ansible/roles/apps/templates/settings/$APP.yaml - ansible/roles/apps/tasks/$APP.yaml + - test/behave/features/$APP.feature - if: '$TRIGGER_JOBS =~ /enable-rocketchat/' - if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*enable-rocketchat/' - if: '$CI_COMMIT_BRANCH == "master"' @@ -111,6 +106,7 @@ - flux/**/$APP*.yaml - ansible/roles/apps/templates/settings/$APP.yaml - ansible/roles/apps/tasks/$APP.yaml + - test/behave/features/$APP.feature - if: '$TRIGGER_JOBS =~ /enable-wordpress/' - if: '$CI_COMMIT_MESSAGE =~ /TRIGGER_JOBS=.*enable-wordpress/' - if: '$CI_COMMIT_BRANCH == "master"' @@ -250,6 +246,13 @@ enable-grafana: - .enable_app_template - .grafana_rules +enable-loki-stack: + variables: + APP: "loki-stack" + extends: + - .enable_app_template + - .loki_stack_rules + enable-nextcloud: variables: APP: "nextcloud" @@ -377,6 +380,13 @@ grafana-helm-release: - .helm-release - .grafana_rules +loki-stack-helm-release: + variables: + APP: "loki-stack" + extends: + - .helm-release + - .loki_stack_rules + nextcloud-helm-release: variables: APP: "nextcloud" @@ -453,6 +463,15 @@ grafana-ready: - .apps-ready - .grafana_rules +loki-stack-ready: + variables: + APP: "loki-stack" + needs: + - job: loki-stack-helm-release + extends: + - .apps-ready + - .loki_stack_rules + nextcloud-ready: variables: APP: "nextcloud" diff --git a/test/behave/features/grafana.feature b/test/behave/features/grafana.feature index e62a28fc33bd383a22e4747ed15538a6797bdeb1..e4d961b60ea089cc0f18ac77db0a98eebd0afa50 100644 --- a/test/behave/features/grafana.feature +++ b/test/behave/features/grafana.feature @@ -5,7 +5,8 @@ Feature: Test grafana admin login And I want to be able to look at the logs Scenario: Open grafana - When I open the grafana URL + Given I have closed all but the first window + And I open the grafana URL Then I wait on element "//input[@name='user']" for 25000ms to be visible And I expect that the title is "Grafana" And I expect that element "//input[@name='password']" is visible diff --git a/test/behave/features/nextcloud.feature b/test/behave/features/nextcloud.feature index e1d77c0f259a18a87d7552143c8475caf582a03d..eeb638db1624a598ef9dcb46e83ea9f4267d79e2 100644 --- a/test/behave/features/nextcloud.feature +++ b/test/behave/features/nextcloud.feature @@ -5,7 +5,8 @@ Feature: Test nextcloud admin login And I want to be able to open a document in OnlyOffice Scenario: Test OnlyOffice welcome screen - When I open the onlyoffice URL + Given I have closed all but the first window + And I open the onlyoffice URL Then I wait on element "#status-ok-icon" for 1000ms to exist Scenario: Open nextcloud @@ -32,7 +33,7 @@ Scenario: Create a new document in OnlyOffice When I click on the element "[aria-label='Files']" # Unfortunaty there's no check if the element that's already visible # is also clickable. - And I pause for 5000ms + And I wait on element "[class='button new']" to be clickable And I click on the button "[class='button new']" And I click on the element "[data-action='onlyofficeDocx']" And I add a random string to the inputfield ".filenameform input[type=text]" @@ -40,4 +41,14 @@ Scenario: Create a new document in OnlyOffice And I focus the last opened tab Then I expect a new tab has been opened And I expect that element "div.toast-error" does not exist - And I wait on element "iframe[name='frameEditor']" for 20000ms to be visible + +Scenario: Assert the bold button is not activated + When I wait for the iframe named "frameEditor" and switch to it + Then I wait on element "div.asc-loadmask" for 20000ms to be visible + And I wait on element "div.asc-loadmask" for 20000ms to not exist + And I wait on element "[id='id-toolbar-btn-bold']" for 20000ms to be visible + And I expect that element "[id='id-toolbar-btn-bold']" does not have the class "active" + +Scenario: Active the bold button + When I click on the element "[id='id-toolbar-btn-bold']" + Then I expect that element "[id='id-toolbar-btn-bold']" has the class "active" diff --git a/test/behave/features/rocketchat.feature b/test/behave/features/rocketchat.feature index 68ddfacfee6ee37c68a9f1e50ec7b998a41f1247..0351712775c052b814567dbd180a01b364e0d19b 100644 --- a/test/behave/features/rocketchat.feature +++ b/test/behave/features/rocketchat.feature @@ -4,7 +4,8 @@ Feature: Test rocketchat admin login I want to be able to login to rocketchat as the user admin Scenario: Open rocketchat - When I open the rocketchat URL + Given I have closed all but the first window + And I open the rocketchat URL Then I wait on element "//input[@name='emailOrUsername']" for 25000ms to be visible And I expect that element "#pass" is visible diff --git a/test/behave/features/steps/steps.py b/test/behave/features/steps/steps.py index f65e96ff80ac3874df92cd7bca59cbafafa1e1b6..6d82a58205b38ac1870dffd8047c2c9df4abac1b 100644 --- a/test/behave/features/steps/steps.py +++ b/test/behave/features/steps/steps.py @@ -1,5 +1,7 @@ from oas_behave.common_steps import * - +from selenium.webdriver.common.by import By +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.support.ui import WebDriverWait @when(u'I open the rocketchat URL') @given(u'I open the rocketchat URL') @@ -21,3 +23,16 @@ def step_impl(context): print(eventrouter_url) context.behave_driver.get(eventrouter_url) +@when(u'I wait on element "{element}" to be clickable') +@given(u'I wait on element "{element}" to be clickable') +def step_impl(context, element): + """Wait for element ro be clickable.""" + wait = WebDriverWait(context.behave_driver, 30) + wait.until(EC.element_to_be_clickable((By.CLASS_NAME, "button.new"))) + +@when(u'I wait for the iframe named "{name}" and switch to it') +@given(u'I wait for the iframe named "{name}" and switch to it') +def step_impl(context, name): + """Wait for the iframe with given name and switch to it.""" + wait = WebDriverWait(context.behave_driver, 30) + wait.until(EC.frame_to_be_available_and_switch_to_it((By.NAME, name))) diff --git a/test/behave/features/wordpress.feature b/test/behave/features/wordpress.feature index fcb1648adba5f3c7a253dd2d51f2ad5b8aaf5161..076173a750b3c0df177e435a42c0d8de7ea69c5e 100644 --- a/test/behave/features/wordpress.feature +++ b/test/behave/features/wordpress.feature @@ -4,7 +4,8 @@ Feature: Test WordPress admin login I want to be able to login to WordPress as the user admin Scenario: Open WordPress - When I open the wordpress URL + Given I have closed all but the first window + And I open the wordpress URL Then I wait on element "#user_login" for 25000ms to be visible And I expect that element "#user_pass" is visible diff --git a/test/pytest/test_app_deployments.py b/test/pytest/test_app_deployments.py index 384e3adb5702c6ed93bd76b1625c63b0a7a87b63..a6e99c5a9b38559a1fad601e9f1efdc8de13f873 100644 --- a/test/pytest/test_app_deployments.py +++ b/test/pytest/test_app_deployments.py @@ -26,27 +26,30 @@ EXPECTED_RELEASES = { } EXPECTED_APP_LABELS = { - 'nextcloud': { - 'namespace': 'oas-apps', - 'label_selector': 'app.kubernetes.io/instance=nc'}, - 'wordpress': { - 'namespace': 'oas-apps', - 'label_selector': 'release=wordpress'}, - 'rocketchat': { - 'namespace': 'oas-apps', - 'label_selector': 'app.kubernetes.io/instance=rocketchat'}, - 'grafana': { - 'namespace': 'oas', - 'label_selector': 'app=grafana'}, 'eventrouter': { 'namespace': 'oas', 'label_selector': 'app=eventrouter'}, + 'loki-stack': { + 'namespace': 'oas', + 'label_selector': 'app=loki'}, + 'grafana': { + 'namespace': 'oas', + 'label_selector': 'app=grafana'}, + 'nextcloud': { + 'namespace': 'oas-apps', + 'label_selector': 'app.kubernetes.io/instance=nc'}, 'prometheus': { 'namespace': 'oas', 'label_selector': 'app=prometheus'}, + 'rocketchat': { + 'namespace': 'oas-apps', + 'label_selector': 'app.kubernetes.io/instance=rocketchat'}, 'single-sign-on': { 'namespace': 'oas', - 'label_selector': 'app.kubernetes.io/name in (hydra,hydra-maester,single-sign-on-userbackend,single-sign-on-consent,single-sign-on-userpanel,single-sign-on-login)'} + 'label_selector': 'app.kubernetes.io/name in (hydra,hydra-maester,single-sign-on-userbackend,single-sign-on-consent,single-sign-on-userpanel,single-sign-on-login)'}, + 'wordpress': { + 'namespace': 'oas-apps', + 'label_selector': 'release=wordpress'} }