Fix skipped tests for application creation

Fix WebUI tests for application creation
and tests for checking catalog features.

Commit should be merged after
https://review.openstack.org/#/c/94614/ because archiving packages
was moved from tests to jobs.
Change-Id: Iab86775bbda3ddfc1800d8024fd1eb782e02eafe
This commit is contained in:
Anastasia Kuznetsova 2014-05-21 17:22:31 +04:00
parent 32a0c4f218
commit f506784b48
20 changed files with 210 additions and 949 deletions

View File

@ -1,31 +0,0 @@
Namespaces:
=: io.murano.apps.AppForUploadTest
std: io.murano
res: io.murano.resources
Name: AppForUploadTest
Extends: std:Application
Properties:
name:
Contract: $.string().notNull()
instance:
Contract: $.class(res:Instance).notNull()
username:
Contract: $.string().notNull()
password:
Contract: $.string().notNull()
database:
Contract: $.string().notNull()
Workflow:
deploy:
Body:
- $.instance.deploy()
- $resources: new('io.murano.system.Resources')

View File

@ -1,85 +0,0 @@
Version: 2
Application:
?:
type: io.murano.apps.AppForUploadTest
name: $.serviceConfiguration.name
database: $.serviceConfiguration.database
username: $.serviceConfiguration.username
password: $.serviceConfiguration.password
instance:
?:
type: io.murano.resources.Instance
name: generateHostname($.serviceConfiguration.unitNamingPattern, 1)
flavor: $.instanceConfiguration.flavor
image: $.instanceConfiguration.osImage
Forms:
- serviceConfiguration:
fields:
- name: name
type: string
label: Service Name
description: >-
To identify your service in logs please specify a service name
- name: database
type: string
label: Database
description: >-
Please, provide database name that is going to be created
- name: username
type: string
label: Username
description: >-
Please, provide username that is going to be used to connect to the database
- name: password
type: password
label: Password
descriptionTitle: Password
description: >-
Please, provide password that is going to be used to connect to the database
- name: dcInstances
type: integer
hidden: true
initial: 1
- name: unitNamingPattern
type: string
required: false
hidden: true
widgetMedia:
js: ['muranodashboard/js/support_placeholder.js']
css: {all: ['muranodashboard/css/support_placeholder.css']}
- instanceConfiguration:
fields:
- name: title
type: string
required: false
hidden: true
descriptionTitle: Instance Configuration
description: Specify some instance parameters on which service would be created.
- name: flavor
type: flavor
label: Instance flavor
description: >-
Select registered in Openstack flavor. Consider that service performance
depends on this parameter.
required: false
- name: osImage
type: image
imageType: linux
label: Instance image
description: >-
Select valid image for a service. Image should already be prepared and
registered in glance.
- name: keyPair
type: keypair
label: Key Pair
description: >-
Select the Key Pair to control access to instances. You can login to
instances using this KeyPair after the deployment of service.
required: false
- name: availabilityZone
type: azone
label: Availability zone
description: Select availability zone where service would be installed.
required: false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,10 +0,0 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.AppForUploadTest
Name: AppForUploadTest
Description: |
This is test package.
Author: 'Mirantis, Inc'
Tags: [test_tag]
Classes:
io.murano.apps.AppForUploadTest: AppForUploadTest.yaml

View File

@ -1,47 +0,0 @@
Namespaces:
=: io.murano.apps.PostgreSql
std: io.murano
res: io.murano.resources
Name: PostgreSql
Extends: std:Application
Properties:
name:
Contract: $.string().notNull()
instance:
Contract: $.class(res:Instance).notNull()
username:
Contract: $.string().notNull()
password:
Contract: $.string().notNull()
database:
Contract: $.string().notNull()
Workflow:
deploy:
Body:
- $.instance.deploy()
- $resources: new('io.murano.system.Resources')
# Deploy PostgreSql
- $template: $resources.yaml('DeployPostgreSql.template')
- $.instance.agent.call($template, $resources)
# Configure Database on PostgreSQL
- $template: $resources.yaml('ConfigurePostgreSqlDatabase.template').bind(dict(
database => $.database,
username => $.username,
password => $.password
))
- $.instance.agent.call($template, $resources)
getIp:
Body:
- $resources: new('io.murano.system.Resources')
- $template: $resources.yaml('GetIP.template')
- $.instance.agent.call($template, $resources)

View File

@ -1,22 +0,0 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Add database and user to PostgreSql
Parameters:
database: $database
username: $username
password: $password
Body: |
return configure('{0} {1} {2}'.format(args.database, args.username, args.password)).stdout
Scripts:
configure:
Type: Application
Version: 1.0.0
EntryPoint: configurePostgreSqlDatabase.sh
Files:
- <common.sh>
Options:
captureStdout: true
captureStderr: false

View File

@ -1,21 +0,0 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Deploy PostgreSql
Parameters:
appName: $appName
Body: |
return deploy(args.appName).stdout
Scripts:
deploy:
Type: Application
Version: 1.0.0
EntryPoint: deployPostgreSql.sh
Files:
- <installer.sh>
- <common.sh>
Options:
captureStdout: true
captureStderr: false

View File

@ -1,19 +0,0 @@
FormatVersion: 2.0.0
Version: 1.0.0
Name: Deploy Tomcat
Parameters:
appName: $appName
Body: |
return getIp(args.appName).stdout
Scripts:
getIp:
Type: Application
Version: 1.0.0
EntryPoint: Linux/getIp.sh
Files: []
Options:
captureStdout: true
captureStderr: false

View File

@ -1,204 +0,0 @@
#!/bin/bash
#
DEBUGLVL=3
LOGFILE=/tmp/muranodeployment.log
PIPAPPS="pip python-pip pip-python"
PIPCMD=""
if [ "$DEBUGLVL" -eq 4 ]; then
set -x
fi
function log {
if [ "$DEBUGLVL" -gt 0 ]; then
chars=$(echo "@$" | wc -c)
case $DEBUGLVL in
1 )
echo -e "LOG:>$@"
;;
2)
echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" | tee --append $LOGFILE
;;
3)
echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" >> $LOGFILE
;;
4)
echo -e "$(date +"%m-%d-%Y %H:%M") LOG:>$@" | tee --append $LOGFILE
;;
esac
fi
}
function lowercase(){
echo "$1" | sed "y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/"
}
function find_pip()
{
for cmd in $PIPAPPS
do
_cmd=$(which $cmd 2>/dev/null)
if [ $? -eq 0 ];then
break
fi
done
if [ -z $_cmd ];then
echo "Can't find \"pip\" in system, please install it first, exiting!"
exit 1
else
PIPCMD=$_cmd
fi
}
OPTIND=1 # Reset if getopts used previously
function collect_args(){
_n=$1
shift
ARGS=''
while true
do
if [[ "$_n" == -* ]] || [ -z "$_n" ]; then
OPTIND=$((OPTIND - 1))
break
fi
#echo "_n=$_n ; $OPTIND"
if [ -z "$ARGS" ]; then
ARGS=$OPTARG
else
ARGS="$ARGS $_n"
fi
eval _n=\$$OPTIND
OPTIND=$((OPTIND + 1))
#sleep 1
done
echo $ARGS
unset _n
unset ARGS
}
function get_os(){
KERNEL=$(uname -r)
MACH=$(uname -m)
OS=$(uname)
if [ "${OS}" = "Linux" ] ; then
if [ -f /etc/redhat-release ] ; then
DistroBasedOn='RedHat'
Packager='yum'
DIST=$(cat /etc/redhat-release |sed s/\ release.*//)
PSUEDONAME=$(cat /etc/redhat-release | sed s/.*\(// | sed s/\)//)
REV=$(cat /etc/redhat-release | sed s/.*release\ // | sed s/\ .*//)
elif [ -f /etc/SuSE-release ] ; then
DistroBasedOn='SuSe'
Packager='zypper'
PSUEDONAME=$(cat /etc/SuSE-release | tr "\n" ' '| sed s/VERSION.*//)
REV=$(cat /etc/SuSE-release | tr "\n" ' ' | sed s/.*=\ //)
elif [ -f /etc/mandrake-release ] ; then
DistroBasedOn='Mandrake'
Packager='urpmi urpme'
PSUEDONAME=$(cat /etc/mandrake-release | sed s/.*\(// | sed s/\)//)
REV=$(cat /etc/mandrake-release | sed s/.*release\ // | sed s/\ .*//)
elif [ -f /etc/debian_version ] ; then
DistroBasedOn='Debian'
Packager='apt-get'
DIST=$(cat /etc/lsb-release | grep '^DISTRIB_ID' | awk -F= '{ print $2 }')
PSUEDONAME=$(cat /etc/lsb-release | grep '^DISTRIB_CODENAME' | awk -F= '{ print $2 }')
REV=$(cat /etc/lsb-release | grep '^DISTRIB_RELEASE' | awk -F= '{ print $2 }')
fi
if [ -f /etc/UnitedLinux-release ] ; then
DIST="${DIST}[$(cat /etc/UnitedLinux-release | tr "\n" ' ' | sed s/VERSION.*//)]"
fi
OS=$(lowercase $OS)
DistroBasedOn=$(lowercase $DistroBasedOn)
readonly OS
readonly DIST
readonly DistroBasedOn
readonly PSUEDONAME
readonly REV
readonly KERNEL
readonly MACH
#readonly Packager
else
OS=unknown
readonly OS
log "OS:$OS"
exit 1
fi
}
function add_fw_rule(){
_rule_string=$@
_tmp_fw_port=$(echo $_rule_string | grep -o -e "dport [0-9]*\s")
_tmp_fw_proto=$(echo $_rule_string | grep -o -e "-p \w*\s")
_fw_port=$(echo $_tmp_fw_port | awk '{print $2}')
_fw_proto=$(echo $_tmp_fw_proto |awk '{print $2}')
_fw_reload=""
#find iptables and add rule
case $DIST in
"Fedora")
_fw_cmd=$(which firewall-cmd)
_fw_port=$(echo $_rule_string | grep -o -e "dport [0-9]*\s" | awk '{print $2}')
_fw_proto=$(echo $_rule_string | grep -o -e "-p \w*\s" | awk '{print $2}')
_fw_rule="--permanent --add-port=$_fw_port/$_fw_proto"
_fw_enable_rules="$_fw_cmd --reload"
;;
*)
_fw_cmd=$(which iptables)
_fw_rule=$_rule_string
_fw_enable_rules="service $(basename $_fw_cmd) save"
;;
esac
iptcmdsave=$(which iptables-save)
if [[ "$_fw_cmd" != '' ]] && [[ "$iptcmdsave" != '' ]]; then
eval "$iptcmdsave | grep -e \"$_tmp_fw_port\" | grep -e \"$_tmp_fw_proto\"" > /dev/null 2>&1
if [ $? -ne 0 ]; then
eval $_fw_cmd $_fw_rule
if [ $? -ne 0 ]; then
log "Can't set firewall rules, exiting..."
exit 1
else
if [ -n "$_fw_enable_rules" ]; then
log "Running \"$_fw_enable_rules\""
$_fw_enable_rules > /dev/null
fi
log "$_fw_cmd rule with $_fw_rule set."
fi
else
log "$_fw_cmd rule exists."
fi
else
log "There are no fw found..."
fi
}
function enable_init(){
_initctrl=""
_init_suffix=""
_service=$1
case $DistroBasedOn in
"debian")
_initctrl="update-rc.d"
_init_suffix="defaults"
;;
*)
_initctrl="chkconfig"
_init_suffix="on"
;;
esac
$_initctrl $_service $_init_suffix
if [ $? -ne 0 ]; then
log "$_initctrl $_service $_init_suffix - fails!"
exit 1
fi
}
function restart_service(){
_service=$1
service $_service restart > /dev/null 2>&1
if [ $? -ne 0 ]; then
log "Can't start $_service service!"
exit 1
fi
}
function package_renamer(){
_pkg=$1
case $DistroBasedOn in
"debian")
_pkg=$(echo $_pkg | sed 's/-devel$/-dev/')
;;
*)
_pkg=$(echo $_pkg | sed 's/-dev$/-devel/')
;;
esac
echo $_pkg
}

View File

@ -1,28 +0,0 @@
#!/bin/bash
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
echo -e "$inc_file_path not found!"
exit 1
fi
}
include "common.sh"
get_os
[[ $? -ne 0 ]] && exit 1
if [[ "$DistroBasedOn" != "redhat" ]]; then
DEBUGLVL=4
log "ERROR: We are sorry, only \"redhat\" based distribution of Linux supported for this service type, exiting!"
exit 1
fi
su -c "psql -d postgres -c \"CREATE DATABASE $1\"" -s /bin/sh postgres
su -c "psql -d postgres -c \"CREATE USER $2 WITH PASSWORD '$3'\"" -s /bin/sh postgres
su -c "psql -d postgres -c \"GRANT ALL PRIVILEGES ON DATABASE $1 to $2;\"" -s /bin/sh postgres
echo "host $1 $2 all md5" >> /var/lib/pgsql/data/pg_hba.conf
systemctl restart postgresql.service

View File

@ -1,31 +0,0 @@
#!/bin/bash
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
echo -e "$inc_file_path not found!"
exit 1
fi
}
include "common.sh"
get_os
[[ $? -ne 0 ]] && exit 1
if [[ "$DistroBasedOn" != "redhat" ]]; then
DEBUGLVL=4
log "ERROR: We are sorry, only \"redhat\" based distribution of Linux supported for this service type, exiting!"
exit 1
fi
bash installer.sh -p sys -i "postgresql-server postgresql-contrib"
postgresql-setup initdb
sed -e "s/^#listen_addresses =.*$/listen_addresses = \'*\'/" -i /var/lib/pgsql/data/postgresql.conf
add_fw_rule '-I INPUT 1 -p tcp -m tcp --dport 5432 -j ACCEPT -m comment --comment "by murano, PostgreSQL"'
systemctl enable postgresql.service
systemctl start postgresql.service

View File

@ -1,2 +0,0 @@
#!/bin/sh
curl -s http://169.254.169.254/latest/meta-data/local-ipv4

View File

@ -1,142 +0,0 @@
#!/bin/bash
#
INSTALLER_OPTS=""
UNINSTALLER_OPTS=""
PMGR=""
PMGR_LIST_OPTS=""
function include(){
curr_dir=$(cd $(dirname "$0") && pwd)
inc_file_path=$curr_dir/$1
if [ -f "$inc_file_path" ]; then
. $inc_file_path
else
exit 1
fi
}
function set_install_options(){
case $1 in
apt-get )
INSTALLER_OPTS="-y -q install"
UNINSTALLER_OPTS="-y -q remove"
PMGR="dpkg"
PMGR_LIST_OPTS="-s"
;;
yum )
INSTALLER_OPTS="--assumeyes install"
UNINSTALLER_OPTS="--assumeyes erase"
PMGR="rpm"
PMGR_LIST_OPTS="-q"
;;
urpm* )
INSTALLER_OPTS="-y"
UNINSTALLER_OPTS=""
PMGR="rpm"
PMGR_LIST_OPTS="-q"
;;
zypper )
INSTALLER_OPTS="install"
UNINSTALLER_OPTS="remove --quiet"
PMGR="rpm"
PMGR_LIST_OPTS="-q"
;;
pip )
INSTALLER_OPTS="install"
UNINSTALLER_OPTS="uninstall --yes"
find_pip
PACKAGER=$PIPCMD
PMGR=$PIPCMD
PMGR_LIST_OPTS="freeze | grep"
;;
* )
exit 1
;;
esac
PACKAGER=$(which $1)
if [ $? -ne 0 ]; then
log "Can't find \"$1\", exiting!"
exit 1
fi
}
function package_install(){
PKG=$1
eval "$PMGR $PMGR_LIST_OPTS $PKG" > /dev/null 2>&1
if [ $? -eq 0 ]; then
log "\"$PKG\" already installed"
else
log "Installing \"$PKG\" ..."
$PACKAGER $INSTALLER_OPTS $PKG > /dev/null 2>&1
if [ $? -ne 0 ]; then
log "\"$PKG\" installation fails, exiting!"
exit 1
else
log "\t\t...success"
fi
fi
}
function package_uninstall(){
PKG=$1
eval "$PMGR $PMGR_LIST_OPTS $PKG" > /dev/null 2>&1
if [ $? -eq 1 ]; then
log "\"$PKG\" not installed"
else
log "Unnstalling \"$PKG\" ..."
$PACKAGER $UNINSTALLER_OPTS $PKG > /dev/null 2>&1
if [ $? -ne 0 ]; then
log "\"$PKG\" uninstallation fails, exiting!"
exit 1
else
log "\t\t...success"
fi
fi
}
function run_install(){
for PKG in $@
do
package_install $PKG
done
}
function run_uninstall(){
for PKG in $@
do
package_uninstall $PKG
done
}
# Main workflow
include "common.sh"
if [ $# -eq 0 ]; then
script=$(basename $0)
echo -e "Usage:\n\t* install packages -- ./$script -p package_manager -i package0 [packageN]\n\t* remove packages -- ./$script -p package_manager -r package0 [packageN]"
exit 1
fi
Packager=''
get_os
if [ $? -ne 0 ]; then
log "Unsupported *nix version ($DistroBasedOn - $DIST/$PSUEDONAME/$REV/$MACH)"
exit 1
fi
while getopts ":p:i:r:" opt ; do
case "$opt" in
p)
if [[ "$OPTARG" != sys ]]; then
Packager=$OPTARG
fi
set_install_options $Packager
;;
i)
n=$OPTARG
run_install $(collect_args $n $@)
break;
;;
r)
n=$OPTARG
run_uninstall $(collect_args $n $@)
break;
;;
\?)
log "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
shift $((OPTIND-1))

View File

@ -1,85 +0,0 @@
Version: 2
Application:
?:
type: io.murano.apps.PostgreSql
name: $.serviceConfiguration.name
database: $.serviceConfiguration.database
username: $.serviceConfiguration.username
password: $.serviceConfiguration.password
instance:
?:
type: io.murano.resources.Instance
name: generateHostname($.serviceConfiguration.unitNamingPattern, 1)
flavor: $.instanceConfiguration.flavor
image: $.instanceConfiguration.osImage
Forms:
- serviceConfiguration:
fields:
- name: name
type: string
label: Service Name
description: >-
To identify your service in logs please specify a service name
- name: database
type: string
label: Database
description: >-
Please, provide database name that is going to be created
- name: username
type: string
label: Username
description: >-
Please, provide username that is going to be used to connect to the database
- name: password
type: password
label: Password
descriptionTitle: Password
description: >-
Please, provide password that is going to be used to connect to the database
- name: dcInstances
type: integer
hidden: true
initial: 1
- name: unitNamingPattern
type: string
required: false
hidden: true
widgetMedia:
js: ['muranodashboard/js/support_placeholder.js']
css: {all: ['muranodashboard/css/support_placeholder.css']}
- instanceConfiguration:
fields:
- name: title
type: string
required: false
hidden: true
descriptionTitle: Instance Configuration
description: Specify some instance parameters on which service would be created.
- name: flavor
type: flavor
label: Instance flavor
description: >-
Select registered in Openstack flavor. Consider that service performance
depends on this parameter.
required: false
- name: osImage
type: image
imageType: linux
label: Instance image
description: >-
Select valid image for a service. Image should already be prepared and
registered in glance.
- name: keyPair
type: keypair
label: Key Pair
description: >-
Select the Key Pair to control access to instances. You can login to
instances using this KeyPair after the deployment of service.
required: false
- name: availabilityZone
type: azone
label: Availability zone
description: Select availability zone where service would be installed.
required: false

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

View File

@ -1,13 +0,0 @@
Format: 1.0
Type: Application
FullName: io.murano.apps.PostgreSql
Name: PostgreSQL
Description: |
PostgreSQL is a powerful, open source object-relational database system.
It has more than 15 years of active development and a proven architecture
that has earned it a strong reputation for reliability, data integrity,
and correctness.
Author: 'Mirantis, Inc'
Tags: [Database, Postgre, SQL, RDBMS]
Classes:
io.murano.apps.PostgreSql: PostgreSql.yaml

View File

@ -10,11 +10,9 @@ import requests
from selenium import webdriver from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException from selenium.common.exceptions import NoSuchElementException
import selenium.webdriver.common.by as by import selenium.webdriver.common.by as by
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support.ui import WebDriverWait
import testtools import testtools
import time import time
import zipfile
from keystoneclient.v2_0 import client as ksclient from keystoneclient.v2_0 import client as ksclient
from muranoclient.client import Client as mclient from muranoclient.client import Client as mclient
@ -86,24 +84,11 @@ class UITestCase(BaseDeps):
cls.location = os.path.realpath( cls.location = os.path.realpath(
os.path.join(os.getcwd(), os.path.dirname(__file__))) os.path.join(os.getcwd(), os.path.dirname(__file__)))
def archive_app(app_name):
__folderpath__ = os.path.join(cls.location, "{0}".format(app_name))
__rootlen__ = len(__folderpath__) + 1
with zipfile.ZipFile(os.path.join(
cls.location,
"{0}.zip".format(app_name)), "w") as zf:
for dirname, _, files in os.walk(__folderpath__):
for filename in files:
fn = os.path.join(dirname, filename)
zf.write(fn, fn[__rootlen__:])
archive_app('PostgreSQL') def upload_package(package_name, body, app):
archive_app('AppForUploadTest')
def upload_package(package_name, body):
files = {'%s' % package_name: open( files = {'%s' % package_name: open(
os.path.join(cls.location, 'PostgreSQL.zip'), 'rb')} os.path.join(cls.location, app), 'rb')}
post_body = {'JsonString': json.dumps(body)} post_body = {'JsonString': json.dumps(body)}
request_url = '{endpoint}{url}'.format( request_url = '{endpoint}{url}'.format(
@ -117,7 +102,24 @@ class UITestCase(BaseDeps):
cls.postgre_id = upload_package( cls.postgre_id = upload_package(
'PostgreSQL', 'PostgreSQL',
{"categories": ["Web"], "tags": ["tag"]}) {"categories": ["Databases"], "tags": ["tag"]},
'murano-app-incubator/io.murano.apps.PostgreSql.zip')
cls.apache_id = upload_package(
'Apache',
{"categories": ["Application Servers"], "tags": ["tag"]},
'murano-app-incubator/io.murano.apps.apache.Apache.zip')
cls.tomcat_id = upload_package(
'Tomcat',
{"categories": ["Application Servers"], "tags": ["tag"]},
'murano-app-incubator/io.murano.apps.apache.Tomcat.zip')
cls.telnet_id = upload_package(
'Telnet',
{"categories": ["Web"], "tags": ["tag"]},
'murano-app-incubator/io.murano.apps.linux.Telnet.zip')
cls.ad_id = upload_package(
'Active Directory',
{"categories": ["Microsoft Services"], "tags": ["tag"]},
'murano-app-incubator/io.murano.windows.ActiveDirectory.zip')
def setUp(self): def setUp(self):
super(UITestCase, self).setUp() super(UITestCase, self).setUp()
@ -140,13 +142,17 @@ class UITestCase(BaseDeps):
def tearDownClass(cls): def tearDownClass(cls):
super(UITestCase, cls).tearDownClass() super(UITestCase, cls).tearDownClass()
os.remove(os.path.join(cls.location, 'PostgreSQL.zip')) def delete_package(package_id):
os.remove(os.path.join(cls.location, 'AppForUploadTest.zip')) request_url = '{endpoint}{url}'.format(
endpoint=cfg.common.murano_url,
url='/v1/catalog/packages/{0}'.format(package_id))
requests.delete(request_url, headers=cls.headers)
request_url = '{endpoint}{url}'.format( delete_package(cls.postgre_id)
endpoint=cfg.common.murano_url, delete_package(cls.apache_id)
url='/v1/catalog/packages/{0}'.format(cls.postgre_id)) delete_package(cls.tomcat_id)
requests.delete(request_url, headers=cls.headers) delete_package(cls.telnet_id)
delete_package(cls.ad_id)
def take_screenshot(self, test_name): def take_screenshot(self, test_name):
screenshot_dir = './screenshots' screenshot_dir = './screenshots'
@ -238,11 +244,11 @@ class UITestCase(BaseDeps):
self.driver.find_element_by_id( self.driver.find_element_by_id(
"murano__row_{0}__action_show".format(element_id)).click() "murano__row_{0}__action_show".format(element_id)).click()
def create_demo_service(self, service_name): def create_demo_service(self, app_name):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('apps', 'Demo')).click() self.elements.get('apps', 'Demo')).click()
self.fill_field(by.By.ID, 'id_0-name', service_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'ButtonSubmit')).click() self.elements.get('button', 'ButtonSubmit')).click()
@ -250,33 +256,29 @@ class UITestCase(BaseDeps):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'ButtonSubmit')).click() self.elements.get('button', 'ButtonSubmit')).click()
def create_linux_telnet(self, service_name): def create_linux_telnet(self, app_name, app_id):
self.driver.find_element_by_xpath( self.select_and_click_action_for_app('quick-add', app_id)
self.elements.get('apps', 'Telnet')).click()
self.fill_field(by.By.ID, 'id_0-name', service_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'ButtonSubmit')).click() self.elements.get('button', 'ButtonSubmit')).click()
self.select_from_list('1-osImage', self.linux_image) self.select_from_list('1-osImage', self.linux_image)
self.select_from_list('1-keyPair', self.keypair)
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click() self.elements.get('button', 'InputSubmit')).click()
def create_linux_apache(self, service_name): def create_linux_apache(self, app_name, app_id):
self.driver.find_element_by_xpath( self.select_and_click_action_for_app('quick-add', app_id)
self.elements.get('apps', 'Apache')).click()
self.fill_field(by.By.ID, 'id_0-name', service_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'ButtonSubmit')).click() self.elements.get('button', 'ButtonSubmit')).click()
self.select_from_list('1-osImage', self.linux_image) self.select_from_list('1-osImage', self.linux_image)
self.select_from_list('1-keyPair', self.keypair)
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click() self.elements.get('button', 'InputSubmit')).click()
def create_ad_service(self, service_name): def create_ad_service(self, app_name):
self.fill_field(by.By.ID, 'id_0-name', service_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-recoveryPassword', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-recoveryPassword', 'P@ssw0rd')
@ -288,11 +290,11 @@ class UITestCase(BaseDeps):
next_button = self.elements.get('button', 'InputSubmit') next_button = self.elements.get('button', 'InputSubmit')
self.driver.find_element_by_xpath(next_button).click() self.driver.find_element_by_xpath(next_button).click()
def create_iis_service(self, service_name): def create_iis_service(self, app_name):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('apps', 'IIS')).click() self.elements.get('apps', 'IIS')).click()
self.fill_field(by.By.ID, 'id_0-name', service_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd')
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
@ -302,11 +304,11 @@ class UITestCase(BaseDeps):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click() self.elements.get('button', 'InputSubmit')).click()
def create_asp_service(self, service_name): def create_asp_service(self, app_name):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('apps', 'ASP')).click() self.elements.get('apps', 'ASP')).click()
self.fill_field(by.By.ID, 'id_0-name', service_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-repository', self.asp_git_repository) self.fill_field(by.By.ID, 'id_0-repository', self.asp_git_repository)
@ -318,11 +320,11 @@ class UITestCase(BaseDeps):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click() self.elements.get('button', 'InputSubmit')).click()
def create_iisfarm_service(self, service_name): def create_iisfarm_service(self, app_name):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('apps', 'IISFarm')).click() self.elements.get('apps', 'IISFarm')).click()
self.fill_field(by.By.ID, 'id_0-name', service_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd')
@ -333,11 +335,11 @@ class UITestCase(BaseDeps):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click() self.elements.get('button', 'InputSubmit')).click()
def create_aspfarm_service(self, service_name): def create_aspfarm_service(self, app_name):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('apps', 'ASPFarm')).click() self.elements.get('apps', 'ASPFarm')).click()
self.fill_field(by.By.ID, 'id_0-name', service_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-repository', self.asp_git_repository) self.fill_field(by.By.ID, 'id_0-repository', self.asp_git_repository)
@ -349,11 +351,11 @@ class UITestCase(BaseDeps):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click() self.elements.get('button', 'InputSubmit')).click()
def create_mssql_service(self, service_name): def create_mssql_service(self, app_name):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('apps', 'MSSQL')).click() self.elements.get('apps', 'MSSQL')).click()
self.fill_field(by.By.ID, 'id_0-name', service_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-saPassword', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-saPassword', 'P@ssw0rd')
@ -366,11 +368,11 @@ class UITestCase(BaseDeps):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click() self.elements.get('button', 'InputSubmit')).click()
def create_sql_cluster_service(self, service_name, domain_name): def create_sql_cluster_service(self, app_name, domain_name):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('apps', 'SQL_cluster')).click() self.elements.get('apps', 'SQL_cluster')).click()
self.fill_field(by.By.ID, 'id_0-name', service_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword', 'P@ssw0rd')
self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd') self.fill_field(by.By.ID, 'id_0-adminPassword-clone', 'P@ssw0rd')
@ -407,15 +409,11 @@ class UITestCase(BaseDeps):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'ButtonSubmit')).click() self.elements.get('button', 'ButtonSubmit')).click()
def create_tomcat_service(self, service_name, database): def create_tomcat_service(self, app_name, database):
self.driver.find_element_by_xpath( self.fill_field(by.By.ID, 'id_0-name', app_name)
self.elements.get('apps', 'Tomcat')).click() self.select_from_list('0-database', database)
self.fill_field(by.By.ID, 'id_0-name', service_name)
self.fill_field(by.By.ID, 'id_0-repository', self.tomcat_repository) self.fill_field(by.By.ID, 'id_0-repository', self.tomcat_repository)
self.select_from_list('id_0-psqlDatabase', database)
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'ButtonSubmit')).click() self.elements.get('button', 'ButtonSubmit')).click()
@ -423,10 +421,10 @@ class UITestCase(BaseDeps):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click() self.elements.get('button', 'InputSubmit')).click()
self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click()
def create_postgreSQL_service(self, app_name): def create_postgreSQL_service(self, app_name):
self.driver.find_element_by_xpath(
self.elements.get('apps', 'postgreSQL')).click()
self.fill_field(by.By.ID, 'id_0-name', app_name) self.fill_field(by.By.ID, 'id_0-name', app_name)
self.fill_field(by.By.ID, 'id_0-database', 'psql-base') self.fill_field(by.By.ID, 'id_0-database', 'psql-base')
self.fill_field(by.By.ID, 'id_0-username', 'admin') self.fill_field(by.By.ID, 'id_0-username', 'admin')
@ -446,13 +444,6 @@ class UITestCase(BaseDeps):
".//*[@data-display='{0}']".format(el_name)).get_attribute("id") ".//*[@data-display='{0}']".format(el_name)).get_attribute("id")
return path.split('__')[-1] return path.split('__')[-1]
def click_to_add_to_env(self, app_name):
self.navigate_to('Manage')
self.go_to_submenu('Package Definitions')
app_id = self.get_element_id(app_name)
self.navigate_to('Application_Catalog')
self.go_to_submenu('Applications')
def delete_component(self, component_name): def delete_component(self, component_name):
component_id = self.get_element_id(component_name) component_id = self.get_element_id(component_name)
self.driver.find_element_by_id( self.driver.find_element_by_id(
@ -471,7 +462,7 @@ class UITestCase(BaseDeps):
self.elements.get('button', 'ButtonSubmit')).click() self.elements.get('button', 'ButtonSubmit')).click()
time.sleep(3) time.sleep(3)
appeared_text = self.driver.find_element_by_xpath( appeared_text = self.driver.find_element_by_xpath(
"(.//div[@class = 'control-group form-field clearfix error'][%d])" ".//div[@class = 'control-group form-field clearfix error'][%d]"
% num).text % num).text
index = appeared_text.find(error_message) index = appeared_text.find(error_message)

View File

@ -7,6 +7,4 @@ Next=//*[@id="create_service_form"]/strong/strong/div/button
Murano=//*[@id="main_content"]/div[2]/div/dl/dt[3]/div Murano=//*[@id="main_content"]/div[2]/div/dl/dt[3]/div
Application_Catalog=//*[@id="main_content"]/div[2]/div/dl/dd[3]/div[1]/h4/div Application_Catalog=//*[@id="main_content"]/div[2]/div/dl/dd[3]/div[1]/h4/div
Manage=//*[@id="main_content"]/div[2]/div/dl/dd[3]/div[2]/h4/div Manage=//*[@id="main_content"]/div[2]/div/dl/dd[3]/div[2]/h4/div
[apps] AddToEnv=.//*[@href='/horizon/murano/create_environment?next=/horizon/murano/catalog/index']
AD=.//*[@id='main_content']/div[3]/div[1]/div[1]/div/div[2]/a[1]
IIS=.//*[@id='main_content']/div[3]/div[1]/div[3]/div/div[2]/a[1]

View File

@ -7,4 +7,4 @@ tenant = WebTestProject
keystone_url = http://127.0.0.1:5000/v2.0/ keystone_url = http://127.0.0.1:5000/v2.0/
keypair_name = default_keypair keypair_name = default_keypair
asp_git_repository = git_repo_for_asp_app asp_git_repository = git_repo_for_asp_app
tomcat_repository = git_repo_for_tomcat_servlets tomcat_repository = git_repo_for_tomcat

View File

@ -118,7 +118,7 @@ class UISanityTests(UITestCase):
self.assertIn('{"type": "windows.2012", "title": "TestImage"}', self.assertIn('{"type": "windows.2012", "title": "TestImage"}',
self.driver.page_source) self.driver.page_source)
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_006_create_and_delete_demo_service(self): def test_006_create_and_delete_demo_service(self):
""" """
Test check ability to create and delete demo service Test check ability to create and delete demo service
@ -146,85 +146,76 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'DemoService')) 'DemoService'))
@testtools.skip("New UI in progress")
def test_007_create_and_delete_linux_telnet(self): def test_007_create_and_delete_linux_telnet(self):
""" """
Test check ability to create and delete linux telnet service Test check ability to create and delete Linux Telnet service
Scenario: Scenario:
1. Navigate to Environments page 1. Navigate to 'Application Catalog'
2. Create environment 2. Click on 'Quick Deploy' for Telnet application
3. Create linux telnet service in this environment by filling 3. Create Linux Telnet app by filling the creation form
the creation form 4. Delete Linux Telnet app from environment
4. Delete linux telnet service from environment
""" """
self.go_to_submenu('Environments') self.navigate_to('Manage')
self.create_environment('test') self.go_to_submenu('Package Definitions')
self.env_to_components_list('test') telnet_id = self.get_element_id('Telnet')
self.driver.find_element_by_link_text('Add Application').click() self.navigate_to('Application_Catalog')
self.create_linux_telnet('linuxtelnet') self.go_to_submenu('Applications')
self.create_linux_telnet('linuxtelnet', telnet_id)
self.go_to_submenu('Environments')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT, self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'linuxtelnet')) 'linuxtelnet'))
self.delete_component('linuxtelnet') self.delete_component('linuxtelnet')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'linuxtelnet')) 'linuxtelnet'))
@testtools.skip("New UI in progress")
def test_008_create_and_delete_linux_apache(self): def test_008_create_and_delete_linux_apache(self):
""" """
Test check ability to create and delete linux apache service Test check ability to create and delete Linux Apache service
Scenario: Scenario:
1. Navigate to Environments page 1. Navigate to 'Application Catalog'
2. Create environment 2. Click on 'Quick Deploy' for Apache application
3. Create linux apache service in this environment by filling 3. Create Linux Apache app by filling the creation form
the creation form 4. Delete Linux Apache app from environment
4. Delete linux apache service from environment
""" """
self.go_to_submenu('Environments') self.navigate_to('Manage')
self.create_environment('test') self.go_to_submenu('Package Definitions')
self.env_to_components_list('test') apache_id = self.get_element_id('Apache HTTP Server')
self.driver.find_element_by_link_text('Add Component').click() self.navigate_to('Application_Catalog')
self.create_linux_apache('linuxapache') self.go_to_submenu('Applications')
self.create_linux_apache('linuxapache', apache_id)
self.go_to_submenu('Environments')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT, self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'linuxapache')) 'linuxapache'))
self.delete_component('linuxapache') self.delete_component('linuxapache')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'linuxapache')) 'linuxapache'))
@testtools.skip("New UI in progress")
def test_009_create_and_delete_ad_service(self): def test_009_create_and_delete_ad_service(self):
""" """
Test check ability to create and delete active directory service Test check ability to create and delete Active Directory service
Scenario: Scenario:
1. Navigate to Environments page 1. Navigate to 'Application Catalog'
2. Create environment 2. Click on 'Quick Deploy' for Active Directory application
3. Create active directory service in this environment by filling 3. Create Active Directory app by filling the creation form
the creation form 4. Delete Active Directory app from environment
4. Delete active directory service from environment
""" """
self.go_to_submenu('Environments') self.navigate_to('Manage')
self.create_environment('test') self.go_to_submenu('Package Definitions')
self.env_to_components_list('test') ad_id = self.get_element_id('Active Directory')
self.driver.find_element_by_link_text('Add Component').click() self.navigate_to('Application_Catalog')
self.driver.find_element_by_xpath( self.go_to_submenu('Applications')
self.elements.get('apps', 'AD')).click()
self.select_and_click_action_for_app('quick-add', ad_id)
self.create_ad_service('muranotest.domain') self.create_ad_service('muranotest.domain')
self.go_to_submenu('Environments')
self.env_to_components_list('test')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT, self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'muranotest.domain')) 'muranotest.domain'))
@ -232,7 +223,7 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'muranotest.domain')) 'muranotest.domain'))
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_010_create_and_delete_iis_service(self): def test_010_create_and_delete_iis_service(self):
""" """
Test check ability to create and delete IIS service Test check ability to create and delete IIS service
@ -259,7 +250,7 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'IISService')) 'IISService'))
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_011_create_and_delete_asp_service(self): def test_011_create_and_delete_asp_service(self):
""" """
Test check ability to create and delete ASP.Net service Test check ability to create and delete ASP.Net service
@ -287,7 +278,7 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'ASPService')) 'ASPService'))
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_012_create_and_delete_iisfarm_service(self): def test_012_create_and_delete_iisfarm_service(self):
""" """
Test check ability to create and delete IIS Farm service Test check ability to create and delete IIS Farm service
@ -315,7 +306,7 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'IISFarmService')) 'IISFarmService'))
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_013_create_and_delete_aspfarm_service(self): def test_013_create_and_delete_aspfarm_service(self):
""" """
Test check ability to create and delete ASP.Net Farm service Test check ability to create and delete ASP.Net Farm service
@ -343,7 +334,7 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'ASPFarmService')) 'ASPFarmService'))
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_014_create_and_delete_mssql_service(self): def test_014_create_and_delete_mssql_service(self):
""" """
Test check ability to create and delete MSSQL service Test check ability to create and delete MSSQL service
@ -371,7 +362,7 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'MSSQLService')) 'MSSQLService'))
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_015_create_and_delete_sql_cluster_service(self): def test_015_create_and_delete_sql_cluster_service(self):
""" """
Test check ability to create and delete MSSQL cluster service Test check ability to create and delete MSSQL cluster service
@ -401,53 +392,67 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'SQLCluster')) 'SQLCluster'))
@testtools.skip("New UI in progress")
def test_016_create_and_delete_tomcat_service(self): def test_016_create_and_delete_tomcat_service(self):
""" """
Test check ability to create and delete tomcat service Test check ability to create and delete Tomcat service
Scenario: Scenario:
1. Navigate to Environments page 1. Navigate to 'Application Catalog'
2. Create environment 2. Click on 'Quick Deploy' for Tomcat application
3. Create tomcat service in this environment by filling 3. Firstly, create PostgreSQL app by filling the creation form
the creation form 4. Create Tomcat app, in case of database select created
4. Delete tomcat service from environment early PostgreSQL
5. Delete Tomcat app from environment
""" """
self.navigate_to('Manage')
self.go_to_submenu('Package Definitions')
tomcat_id = self.get_element_id('Apache Tomcat')
postgre_id = self.get_element_id('PostgreSQL')
self.navigate_to('Application_Catalog')
self.go_to_submenu('Environments') self.go_to_submenu('Environments')
self.create_environment('test') self.create_environment('test')
env_id = self.get_element_id('test')
self.env_to_components_list('test') self.env_to_components_list('test')
self.driver.find_element_by_link_text('Add Component').click() self.driver.find_element_by_link_text('Add Component').click()
self.create_postgreSQL_service('posrgreSQL') self.select_and_click_action_for_app('add/{0}'.format(env_id),
postgre_id)
self.create_postgreSQL_service('PostgreSQL')
self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click()
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT, self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'posrgreSQL')) 'PostgreSQL'))
self.driver.find_element_by_link_text('Create Service').click() self.driver.find_element_by_link_text('Add Component').click()
self.create_tomcat_service('tomcat-serv', 'posrgreSQL') self.select_and_click_action_for_app('add/{0}'.format(env_id),
tomcat_id)
self.create_tomcat_service('tomcat-serv', 'PostgreSQL')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT, self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'tomcat-serv')) 'tomcat-serv'))
self.delete_component('tomcat-serv') self.delete_component('tomcat-serv')
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'tomcat-serv')) 'tomcat-serv'))
@testtools.skip("New UI in progress")
def test_017_create_and_delete_postgreSQL_service(self): def test_017_create_and_delete_postgreSQL_service(self):
""" """
Test check ability to create and delete postgreSQL service Test check ability to create and delete PostgreSQL service
Scenario: Scenario:
1. Navigate to Environments page 1. Navigate to 'Application Catalog'
2. Create environment 2. Click on 'Quick Deploy' for PostgreSQL application
3. Create postgreSQL service in this environment by filling 3. Create PostgreSQL app by filling the creation form
the creation form 4. Delete PostgreSQL app from environment
4. Delete postgreSQL service from environment
""" """
self.go_to_submenu('Environments') self.navigate_to('Manage')
self.create_environment('test') self.go_to_submenu('Package Definitions')
self.env_to_components_list('test') postgresql_id = self.get_element_id('PostgreSQL')
self.driver.find_element_by_link_text('Add Component').click() self.navigate_to('Application_Catalog')
self.go_to_submenu('Applications')
self.select_and_click_action_for_app('quick-add', postgresql_id)
self.create_postgreSQL_service('PostgreSQL') self.create_postgreSQL_service('PostgreSQL')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT, self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'PostgreSQL')) 'PostgreSQL'))
@ -456,7 +461,7 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT, self.assertFalse(self.check_element_on_page(by.By.LINK_TEXT,
'PostgreSQL')) 'PostgreSQL'))
@testtools.skip("New UI in progress") @testtools.skip("https://bugs.launchpad.net/murano/+bug/1321690")
def test_018_check_regex_expression_for_ad_name(self): def test_018_check_regex_expression_for_ad_name(self):
""" """
Test check that validation of domain name field work and appropriate Test check that validation of domain name field work and appropriate
@ -483,13 +488,14 @@ class UISanityTests(UITestCase):
12. Set "domain.local" as a domain name and check that 12. Set "domain.local" as a domain name and check that
error message didn't appear error message didn't appear
""" """
self.go_to_submenu('Environments') self.navigate_to('Manage')
self.create_environment('test') self.go_to_submenu('Package Definitions')
self.env_to_components_list('test') ad_id = self.get_element_id('Active Directory')
self.driver.find_element_by_link_text('Add Component').click() self.navigate_to('Application_Catalog')
self.driver.find_element_by_xpath( self.go_to_submenu('Applications')
self.elements.get('apps', 'AD')).click()
self.select_and_click_action_for_app('quick-add', ad_id)
self.fill_field(by.By.ID, field='id_0-name', value='a') self.fill_field(by.By.ID, field='id_0-name', value='a')
self.assertTrue(self.check_that_error_message_is_correct( self.assertTrue(self.check_that_error_message_is_correct(
@ -537,7 +543,7 @@ class UISanityTests(UITestCase):
'Period characters are allowed only when ' 'Period characters are allowed only when '
'they are used to delimit the components of domain style names', 1)) 'they are used to delimit the components of domain style names', 1))
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_019_check_regex_expression_for_iis_name(self): def test_019_check_regex_expression_for_iis_name(self):
""" """
Test check that validation of iis name field work and appropriate Test check that validation of iis name field work and appropriate
@ -577,70 +583,67 @@ class UISanityTests(UITestCase):
self.assertFalse(self.check_that_error_message_is_correct( self.assertFalse(self.check_that_error_message_is_correct(
'Just letters, numbers, underscores and hyphens are allowed.', 1)) 'Just letters, numbers, underscores and hyphens are allowed.', 1))
@testtools.skip("New UI in progress")
def test_020_check_regex_expression_for_git_repo_field(self): def test_020_check_regex_expression_for_git_repo_field(self):
""" """
Test check that validation of git repository field work and appropriate Test check that validation of git repository field work and appropriate
error message is appeared after entering incorrect url error message is appeared after entering incorrect url
Scenario: Scenario:
1. Navigate to Environments page 1. Navigate to Application Catalog > Applications
2. Create environment and start to create ASP.Net service 2. Start to create Tomcat service
3. Set "a" as a git repository url and verify error message 3. Set "a" as a git repository url and verify error message
4. Set "://@:" as a git repository url and verify error message 4. Set "://@:" as a git repository url and verify error message
""" """
self.go_to_submenu('Environments') self.navigate_to('Manage')
self.create_environment('test') self.go_to_submenu('Package Definitions')
self.env_to_components_list('test') tomcat_id = self.get_element_id('Apache Tomcat')
self.driver.find_element_by_link_text('Add Component').click() self.navigate_to('Application_Catalog')
self.driver.find_element_by_xpath( self.go_to_submenu('Applications')
self.elements.get('apps', 'ASP')).click() self.select_and_click_action_for_app('quick-add', tomcat_id)
self.fill_field(by.By.ID, field='id_0-repository', value='a') self.fill_field(by.By.ID, field='id_0-repository', value='a')
self.assertTrue(self.check_that_error_message_is_correct( self.assertTrue(self.check_that_error_message_is_correct(
'Enter correct git repository url', 4)) 'Enter a correct git repository URL', 3))
self.fill_field(by.By.ID, field='id_0-repository', value='://@:') self.fill_field(by.By.ID, field='id_0-repository', value='://@:')
self.assertTrue(self.check_that_error_message_is_correct( self.assertTrue(self.check_that_error_message_is_correct(
'Enter correct git repository url', 4)) 'Enter a correct git repository URL', 3))
@testtools.skip("New UI in progress")
def test_021_check_validation_for_hostname_template_field(self): def test_021_check_validation_for_hostname_template_field(self):
""" """
Test check that validation of hostname template field work and Test check that validation of hostname template field work and
appropriate error message is appeared after entering incorrect name appropriate error message is appeared after entering incorrect name
Scenario: Scenario:
1. Navigate to Environments page 1. Navigate to Application Catalog > Applications
2. Create environment and start to create demo service 2. Start to create Telnet service
3. Set "demo" as a hostname template name a and verify error message 3. Set "`qwe`" as a hostname template name a and verify error message
4. Set "demo" as a hostname template name and change number of 4. Set "host" as a hostname template name and
instances from 2 to 1 and check that there is no error message check that there is no error message
""" """
self.go_to_submenu('Environments') self.navigate_to('Manage')
self.create_environment('test') self.go_to_submenu('Package Definitions')
self.env_to_components_list('test') telnet_id = self.get_element_id('Telnet')
self.driver.find_element_by_link_text('Add Component').click() self.navigate_to('Application_Catalog')
self.driver.find_element_by_xpath( self.go_to_submenu('Applications')
self.elements.get('apps', 'Demo')).click()
self.fill_field(by.By.ID, 'id_0-name', 'demo') self.select_and_click_action_for_app('quick-add', telnet_id)
self.fill_field(by.By.ID, 'id_0-unitNamingPattern', 'demo') self.fill_field(by.By.ID, 'id_0-name', 'name')
self.fill_field(by.By.ID, 'id_0-unitNamingPattern', '`qwe`')
xpath = ".//*[@id='create_service_form']/div[1]/div[1]/fieldset/div[1]"
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'ButtonSubmit')).click() self.elements.get('button', 'ButtonSubmit')).click()
self.assertTrue(self.check_element_on_page(by.By.XPATH, xpath)) self.assertTrue(self.check_that_error_message_is_correct(
'Enter a valid value.', 1))
self.fill_field(by.By.ID, 'id_0-dcInstances', value='1') self.fill_field(by.By.ID, 'id_0-unitNamingPattern', 'host')
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'ButtonSubmit')).click() self.elements.get('button', 'ButtonSubmit')).click()
WebDriverWait(self.driver, 10).until(lambda s: s.find_element( WebDriverWait(self.driver, 10).until(lambda s: s.find_element(
by.By.ID, '1-osImage').is_displayed()) by.By.ID, 'id_1-osImage').is_displayed())
@testtools.skip("New UI in progress") @testtools.skip("New UI in progress")
def test_022_check_bool_field_validation(self): def test_022_check_bool_field_validation(self):
@ -702,7 +705,7 @@ class UISanityTests(UITestCase):
self.assertTrue(self.check_that_error_message_is_correct( self.assertTrue(self.check_that_error_message_is_correct(
'This field is required.', 1)) 'This field is required.', 1))
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_023_positive_scenario_1_for_the_MS_SQL_Cluster_Form(self): def test_023_positive_scenario_1_for_the_MS_SQL_Cluster_Form(self):
""" """
Test check one possible scenario of creation mssql cluster Test check one possible scenario of creation mssql cluster
@ -748,7 +751,7 @@ class UISanityTests(UITestCase):
self.assertTrue(self.check_element_on_page( self.assertTrue(self.check_element_on_page(
by.By.ID, 'id_msSqlClusterServer-1-clusterIp')) by.By.ID, 'id_msSqlClusterServer-1-clusterIp'))
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_024_positive_scenario_2_for_the_MS_SQL_Cluster_Form(self): def test_024_positive_scenario_2_for_the_MS_SQL_Cluster_Form(self):
""" """
Test check one possible scenario of creation mssql cluster Test check one possible scenario of creation mssql cluster
@ -800,7 +803,7 @@ class UISanityTests(UITestCase):
self.assertTrue(self.check_element_on_page( self.assertTrue(self.check_element_on_page(
by.By.ID, 'id_msSqlClusterServer-1-clusterIp')) by.By.ID, 'id_msSqlClusterServer-1-clusterIp'))
@testtools.skip("New UI in progress") @testtools.skip("App is not in incubator")
def test_025_positive_scenario_3_for_the_MS_SQL_Cluster_Form(self): def test_025_positive_scenario_3_for_the_MS_SQL_Cluster_Form(self):
""" """
Test check one possible scenario of creation mssql cluster Test check one possible scenario of creation mssql cluster
@ -883,7 +886,7 @@ class UISanityTests(UITestCase):
self.assertTrue(self.check_element_on_page( self.assertTrue(self.check_element_on_page(
by.By.XPATH, './/*[@data-display="PostgreSQL"]')) by.By.XPATH, './/*[@data-display="PostgreSQL"]'))
def test_041_modify_description(self): def test_040_modify_description(self):
""" """
Test check ability to change description of the package Test check ability to change description of the package
@ -993,7 +996,7 @@ class UISanityTests(UITestCase):
self.assertTrue(self.check_package_parameter( self.assertTrue(self.check_package_parameter(
'PostgreSQL', '3', 'True')) 'PostgreSQL', '3', 'True'))
def test_040_check_opportunity_to_delete_package(self): def test_041_check_opportunity_to_delete_package(self):
""" """
Test check ability to delete package from database Test check ability to delete package from database
@ -1025,7 +1028,6 @@ class UISanityTests(UITestCase):
self.assertTrue(self.check_element_on_page( self.assertTrue(self.check_element_on_page(
by.By.XPATH, ".//*[@id='content_body']/div[1]/h2")) by.By.XPATH, ".//*[@id='content_body']/div[1]/h2"))
@testtools.skip("There are no default apps in Murano")
def test_034_env_creation_form_app_catalog_page(self): def test_034_env_creation_form_app_catalog_page(self):
""" """
Test checks that app's option 'Add to environment' is operable Test checks that app's option 'Add to environment' is operable
@ -1039,15 +1041,15 @@ class UISanityTests(UITestCase):
4. Add application in created environment 4. Add application in created environment
""" """
self.go_to_submenu('Applications') self.go_to_submenu('Applications')
self.driver.find_element_by_link_text('Add to environment').click() self.driver.find_element_by_xpath(
self.elements.get('button', 'AddToEnv')).click()
self.fill_field(by.By.ID, 'id_name', 'test_033') self.fill_field(by.By.ID, 'id_name', 'test_env')
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
self.elements.get('button', 'InputSubmit')).click() self.elements.get('button', 'InputSubmit')).click()
self.navigate_to('Application_Catalog')
self.go_to_submenu('Environments') self.go_to_submenu('Environments')
self.driver.find_element_by_link_text('test_033').click() self.driver.find_element_by_link_text('test_env').click()
self.assertTrue( self.assertTrue(
self.driver.find_element_by_id('services__action_AddApplication')) self.driver.find_element_by_id('services__action_AddApplication'))
@ -1089,7 +1091,6 @@ class UISanityTests(UITestCase):
self.driver.find_element_by_xpath( self.driver.find_element_by_xpath(
".//*[@id='MuranoSearchPanel']/form/button").click() ".//*[@id='MuranoSearchPanel']/form/button").click()
@testtools.skip("There are no default apps in Murano")
def test_037_filter_by_category(self): def test_037_filter_by_category(self):
""" """
Test checks ability to filter applications by category Test checks ability to filter applications by category
@ -1102,28 +1103,28 @@ class UISanityTests(UITestCase):
4. Verify result 4. Verify result
""" """
self.navigate_to('Manage') self.navigate_to('Manage')
self.go_to_submenu('Package Definition') self.go_to_submenu('Package Definitions')
package_category1 = self.get_element_id('PACKAGE_CATEGORY1') package_category1 = self.get_element_id('PostgreSQL')
package_category2 = self.get_element_id('PACKAGE_CATEGORY2') package_category2 = self.get_element_id('Active Directory')
self.navigate_to('Application_Catalog') self.navigate_to('Application_Catalog')
self.go_to_submenu('Applications') self.go_to_submenu('Applications')
self.driver.find_element_by_id('MuranoCategoriesPanelToggle').click() self.driver.find_element_by_id('MuranoCategoriesPanelToggle').click()
self.driver.find_element_by_link_text('CATEGORY1').click() self.driver.find_element_by_link_text('Databases').click()
self.assertTrue(self.check_element_on_page( self.assertTrue(self.check_element_on_page(
by.By.XPATH, "//*[@href='/murano/catalog/details/{1}']". by.By.XPATH, ".//*[@href='/horizon/murano/catalog/details/{0}']".
format(package_category1))) format(package_category1)))
self.driver.find_element_by_id('MuranoCategoriesPanelToggle').click() self.driver.find_element_by_id('MuranoCategoriesPanelToggle').click()
self.driver.find_element_by_link_text('CATEGORY2').click() self.driver.find_element_by_link_text('Microsoft Services').click()
self.assertTrue(self.check_element_on_page( self.assertTrue(self.check_element_on_page(
by.By.XPATH, "//*[@href='/murano/catalog/details/{1}']". by.By.XPATH, ".//*[@href='/horizon/murano/catalog/details/{0}']".
format(package_category2))) format(package_category2)))
@testtools.skip("There are no default apps in Murano") @testtools.skip("Work in progress")
def test_038_check_option_switch_env(self): def test_038_check_option_switch_env(self):
""" """
Test checks ability to switch environment and to add app in other env Test checks ability to switch environment and to add app in other env
@ -1139,20 +1140,31 @@ class UISanityTests(UITestCase):
8. Navigate to 'Application Catalog>Environments' and go to the env2 8. Navigate to 'Application Catalog>Environments' and go to the env2
9. Check that added application is here 9. Check that added application is here
""" """
self.navigate_to('Manage')
self.go_to_submenu('Package Definitions')
app_id = self.get_element_id('Telnet')
self.navigate_to('Application_Catalog')
self.go_to_submenu('Environments') self.go_to_submenu('Environments')
self.create_environment('env1') self.create_environment('env1')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'env1'))
self.create_environment('env2') self.create_environment('env2')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'env1'))
self.go_to_submenu('Applications') self.go_to_submenu('Applications')
self.driver.find_element_by_link_text('Environment').click() self.driver.find_element_by_id('MuranoDefaultEnvPanelToggle').click()
self.driver.find_element_by_link_text('env2').click() self.driver.find_element_by_id('environment_switcher').click()
self.driver.find_element_by_xpath(
".//*[@id='environment_list']/li[2]/a").click()
self.select_and_click_action_for_app('add', 'PostgreSQL') self.create_linux_telnet('linuxtelnet', app_id)
self.create_iis_service('IISService')
self.go_to_submenu('Environments') self.go_to_submenu('Environments')
self.env_to_components_list('env2') self.env_to_components_list('env1')
self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT, self.assertTrue(self.check_element_on_page(by.By.LINK_TEXT,
'PostgreSQL')) 'linuxtelnet'))
def test_039_check_statistics_panel(self): def test_039_check_statistics_panel(self):
""" """