Skip to content
Snippets Groups Projects
Commit 3c2ff165 authored by Maarten de Waard's avatar Maarten de Waard :angel:
Browse files

Merge branch '725-test-proper-nc-oo-integration-functionality' into 'master'

Test Onlyoffice Nextcloud integration

Closes #725

See merge request openappstack/openappstack!378
parents bd4169b4 1b3d62d0
No related branches found
No related tags found
No related merge requests found
......@@ -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"
......
......@@ -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
......
......@@ -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"
......@@ -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
......
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)))
......@@ -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
......
......@@ -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'}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment