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

test wordpress release

parent 4cc33f1c
No related branches found
No related tags found
No related merge requests found
......@@ -174,6 +174,28 @@ behave-nextcloud:
- openappstack/**/*
extends: .ssh_setup
behave-wordpress:
stage: integration-test
script:
# Wait for Rocket.Chat pod to be Ready
- ssh root@$FQDN '/bin/bash -c "kubectl wait -n oas-apps pod -l release=wordpress --for condition=Ready --timeout=20m"'
# Run behave tests against Rocket.Chat
- python3 -m openappstack $HOSTNAME test --behave-headless --behave-tags wordpress || python3 -m openappstack $HOSTNAME test --behave-headless --behave-rerun-failing --behave-tags wordpress
artifacts:
paths:
- test/behave/screenshots/
expire_in: 1 month
when: on_failure
retry: 2
only:
changes:
- .gitlab-ci.yml
- ansible/**/*
- flux/**/*
- test/**/*
- openappstack/**/*
extends: .ssh_setup
behave-rocketchat:
stage: integration-test
script:
......
......@@ -28,6 +28,8 @@ database:
## Enable PostgreSQL persistence using Persistent Volume Claims.
enabled: true
existingClaim: "wordpress-mariadb"
replication:
enabled: false
# It's advisable to set resource limits to prevent your K8s cluster from
# crashing
......
......@@ -216,6 +216,10 @@ class Cluster:
secret_directory, 'rocketchat_admin_password'), 'r') as stream:
rocketchat_admin_password = yaml.safe_load(stream)
with open(os.path.join(
secret_directory, 'wordpress_admin_password'), 'r') as stream:
wordpress_admin_password = yaml.safe_load(stream)
with open(os.path.join(
secret_directory, 'grafana_admin_password'), 'r') as stream:
grafana_admin_password = yaml.safe_load(stream)
......@@ -242,6 +246,12 @@ class Cluster:
behave_config['behave.userdata']['rocketchat.password'] = \
rocketchat_admin_password
behave_config['behave.userdata']['wordpress.url'] = \
'https://www.{}/openappstack-login'.format(self.domain)
behave_config['behave.userdata']['wordpress.username'] = 'admin'
behave_config['behave.userdata']['wordpress.password'] = \
wordpress_admin_password
behave_config['behave.userdata']['grafana.url'] = \
'https://grafana.{}'.format(self.domain)
behave_config['behave.userdata']['grafana.username'] = 'admin'
......
......@@ -13,3 +13,6 @@ def before_tag(context, tag):
if tag == 'rocketchat':
context.rocketchat = get_values(userdata, 'rocketchat')
if tag == 'wordpress':
context.wordpress = get_values(userdata, 'wordpress')
......@@ -6,3 +6,9 @@ from oas_behave.common_steps import *
def step_impl(context):
"""Open rocketchat URL."""
context.behave_driver.get(context.rocketchat['url'])
@when(u'I open the wordpress URL')
@given(u'I open the wordpress URL')
def step_impl(context):
"""Open rocketchat URL."""
context.behave_driver.get(context.wordpress['url'])
@wordpress
Feature: Test WordPress admin login
As an OAS admin
I want to be able to login to WordPressas the user admin
Scenario: Open WordPress
When 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
Scenario: Login to WordPress
Given the element "#user_login" is visible
When I enter the "wordpress" "username" in the inputfield "#user_login"
And I enter the "wordpress" "password" in the inputfield "#user_pass"
And I click on the button "#wp-submit"
Then I wait on element "#wpwrap" for 25000ms to be visible
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