Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
3458fc0
WIP - docker compose
Mar 19, 2017
f4c6b1b
WIP docker
Mar 20, 2017
179120e
Docker-compose MVP
Mar 20, 2017
520a796
utf8
Mar 20, 2017
977e9ab
Merge pull request #1 from timbortnik/docker
timbortnik Mar 20, 2017
c4f631e
[vagrant] add vagrant for easier management on windows hosts
DmyMi Mar 21, 2017
4f3d9c8
Merge pull request #2 from timbortnik/vagrant
DmyMi Mar 21, 2017
defd701
[fix] Force linux style line endings
DmyMi Mar 22, 2017
1cb2967
Merge pull request #3 from timbortnik/windows-vagrant-patch-endings
DmyMi Mar 23, 2017
0c2d53e
github signout test by page object
olenakhom Mar 29, 2017
e385de0
page object ecomap
olenakhom Mar 31, 2017
96d3a6e
page object without chromedriver
olenakhom Mar 31, 2017
93e4feb
page object ecomap
olenakhom Mar 31, 2017
a1fdaec
page object ecomap after inspection
olenakhom Apr 1, 2017
bc73d76
page object final version
olenakhom Apr 3, 2017
a0b720a
Merge pull request #6 from timbortnik/olena
olenakhom Apr 3, 2017
80662b6
simple test get_colors image
olenakhom Apr 3, 2017
04198d8
Location test
AnastasiiaLatysh Apr 5, 2017
3a0b3ad
Login as admin added
alianInGitHub Apr 5, 2017
6564c2e
USER_Profile_LINK was fixed
alianInGitHub Apr 5, 2017
4511555
Merge branch 'STAGE' into AnastasiiaLatysh
AnastasiiaLatysh Apr 5, 2017
ebd7a4b
Improvement refactored TestBase
nklymenok Apr 5, 2017
9be17b3
Final improvement
nklymenok Apr 5, 2017
78edc5f
Merge pull request #10 from timbortnik/testbase_improvement
nklymenok Apr 5, 2017
1b7fec1
Merge branch 'STAGE' into anastasiaBond
alianInGitHub Apr 5, 2017
b03874b
Update
alianInGitHub Apr 5, 2017
5e08dcb
Merge branch 'STAGE' into ecomap_local
olenakhom Apr 5, 2017
e246291
Refactored
alianInGitHub Apr 5, 2017
189ed4d
Issue openning was added
alianInGitHub Apr 6, 2017
951e8d9
Fixed
alianInGitHub Apr 6, 2017
705d2b2
Some fixes in test location
AnastasiiaLatysh Apr 6, 2017
3757443
Assertion fixed
alianInGitHub Apr 6, 2017
f1ff597
Done with registration positive tests
nklymenok Apr 6, 2017
2bdbfb9
Small refactoing in test location
AnastasiiaLatysh Apr 6, 2017
8161ea1
fixed
alianInGitHub Apr 6, 2017
9534268
test of map displaying
olenakhom Apr 6, 2017
adb753e
Improvement TestRegistration
nklymenok Apr 6, 2017
faf8144
delete png files
olenakhom Apr 6, 2017
5cc031f
delete TestLogin.py from repo
olenakhom Apr 6, 2017
3e7826f
Division assertions in different tests
AnastasiiaLatysh Apr 6, 2017
9db2271
Merge pull request #13 from timbortnik/Test_Registration
nklymenok Apr 6, 2017
4a04269
Merge branch 'STAGE' into AnastasiiaLatysh
Apr 6, 2017
77e41cb
Merge pull request #15 from timbortnik/AnastasiiaLatysh
AnastasiiaLatysh Apr 6, 2017
c3bbc09
Fixed assertion in test 3
alianInGitHub Apr 6, 2017
d1d9cf8
Merge branch 'STAGE' into anastasiaBond
alianInGitHub Apr 6, 2017
aec8119
Merge branch 'STAGE' into anastasiaBond
alianInGitHub Apr 6, 2017
ba15983
Merge pull request #12 from timbortnik/anastasiaBond
alianInGitHub Apr 6, 2017
eea4c81
Merge branch 'STAGE' into ecomap_local
olenakhom Apr 6, 2017
3046539
adding import Timeout Exception
olenakhom Apr 6, 2017
9d41910
Merge pull request #14 from timbortnik/test_map_visible
olenakhom Apr 6, 2017
3b62b85
working on pwd_change
dmytrorybin Apr 6, 2017
d25495b
Merge branch 'STAGE' into pwd_change
dmytrorybin Apr 6, 2017
b2a1633
Refactoring Test Registration
nklymenok Apr 7, 2017
880846b
Move method click on Add Problem from LoginPage to HomeUserPage
AnastasiiaLatysh Apr 7, 2017
46b0f83
Chaning in structure of test
AnastasiiaLatysh Apr 7, 2017
ad758da
Some debugging
AnastasiiaLatysh Apr 7, 2017
663607e
Refactoring Test Registration
nklymenok Apr 7, 2017
75d20eb
Deleting HomePageLocator from import
nklymenok Apr 7, 2017
3193bb0
add TestMapLoggedIn class, add png files into gitignore
olenakhom Apr 7, 2017
f1e9932
userChangePassword test done
dmytrorybin Apr 7, 2017
2442bdb
new function added
alianInGitHub Apr 7, 2017
4441f3b
code fixed
alianInGitHub Apr 7, 2017
2e60a2c
replace method is_element_present on is_logout_btn_present
olenakhom Apr 7, 2017
2533146
Merge pull request #19 from timbortnik/AnaLatysh
AnastasiiaLatysh Apr 7, 2017
c3ce978
Merge branch 'STAGE' into pwd_change
dmytrorybin Apr 7, 2017
4ddf273
password change minor changes
dmytrorybin Apr 7, 2017
6ac73e5
Merge pull request #22 from timbortnik/pwd_change
dmytrorybin Apr 7, 2017
bfad14d
Merge branch 'STAGE' into FixTestLogInAsAdmin
alianInGitHub Apr 7, 2017
69c0868
Merge pull request #21 from timbortnik/FixTestLogInAsAdmin
alianInGitHub Apr 7, 2017
06b768f
Merge pull request #20 from timbortnik/olena_testmap_after_loggedin
olenakhom Apr 7, 2017
9d0af27
add test in test_name
dmytrorybin Apr 7, 2017
66c45b2
Merge pull request #23 from timbortnik/pwd_change_fix
dmytrorybin Apr 7, 2017
d535398
add registration to change pass test
dmytrorybin Apr 7, 2017
2ac1c98
Merge pull request #24 from timbortnik/pwd_change_fix
dmytrorybin Apr 7, 2017
247eeff
Improvement and bug fixes - add assertTrue
nklymenok Apr 7, 2017
7b644fc
Merge pull request #17 from timbortnik/FinalRefactoringRegistrationTest
nklymenok Apr 7, 2017
b9e47ff
url_test created
StanislavVyshnevskyy Apr 9, 2017
93ce960
add statistic page test
StanislavVyshnevskyy Apr 10, 2017
78214ff
implemented page object pattern
StanislavVyshnevskyy Apr 15, 2017
633bcf7
final fixes
StanislavVyshnevskyy Apr 15, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# For lazy people who set up Windows git with windows style checkout/commit
# as it breaks scripts that run after setting up container
*.sh text eol=lf
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,9 @@ target/

# upload folder
ecomap/www/uploads/

# Vagrant files
.vagrant/

# idea
.idea/
53 changes: 53 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
FROM ubuntu

RUN echo debconf debconf/frontend select Noninteractive | debconf-set-selections
RUN apt-get update && apt-get install -y \
apache2 \
git \
libapache2-mod-wsgi \
libffi-dev \
libmysqlclient-dev \
libssl-dev \
libxml2-dev \
libxslt1-dev \
memcached \
mysql-client \
python-dev \
python-pip \
&& apt-get clean && rm -rf /var/lib/apt/lists/*

RUN echo "[client]" >> /etc/mysql/conf.d/mysql.cnf
RUN echo "protocol=tcp" >> /etc/mysql/conf.d/mysql.cnf
RUN echo "default-character-set = utf8" >> /etc/mysql/conf.d/mysql.cnf

COPY ecomap /opt/ecomap
COPY requirements.txt /tmp/

RUN pip install --upgrade pip
RUN pip install -r /tmp/requirements.txt

ENV PRODROOT=/opt/ecomap
ENV PYSRCROOT=${PRODROOT}/src/python
ENV CONFROOT=${PRODROOT}/etc
ENV PYTHONPATH=${PRODROOT}/src/python
ENV PYTHON=/etc/python
ENV PYTHON_EGG_CACHE=/tmp/.python-eggs
ENV STATICROOT=${PRODROOT}/www/

RUN a2enmod wsgi
COPY ecomap/etc/_ecomap_apache.conf /etc/apache2/sites-available/ecomap.conf
RUN a2ensite ecomap
RUN a2dissite 000-default

RUN echo "ServerName localhost" >> /etc/apache2/conf-available/fqdn.conf
RUN a2enconf fqdn

ENV APACHE_RUN_USER www-data
ENV APACHE_RUN_GROUP www-data
ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_PID_FILE /var/run/apache2.pid
ENV APACHE_LOCK_DIR /var/run

CMD ["/opt/ecomap/bin/db_deploy_and_run.sh"]

EXPOSE 80
33 changes: 33 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# -*- mode: ruby -*-
# vi: set ft=ruby :

ENV['VAGRANT_DEFAULT_PROVIDER'] = 'virtualbox'

Vagrant.configure("2") do |config|

config.vm.box = "ubuntu/xenial64"
config.vm.network "forwarded_port", guest: 80, host: 8080
config.vm.network "forwarded_port", guest: 3306, host: 8081

config.vm.provider "virtualbox" do |vb|
# # Display the VirtualBox GUI when booting the machine
# # if needed
# vb.gui = true
vb.cpus = 2
vb.memory = "2048"
end
# Comment next line to save ~ 200 Mb of disk space :)
config.vm.provision "shell", path: "guestadditions.sh"

config.vm.provision "docker" do |d|
d.pull_images "ubuntu"
d.pull_images "mariadb"
d.build_image "/vagrant",
args: "-t web"
d.run "mariadb",
cmd: "mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init_connect='SET collation_connection = utf8_unicode_ci'",
args: "-p 3306:3306 -e MYSQL_ROOT_PASSWORD=megasecret -e MYSQL_DATABASE=ecomap"
d.run "web",
args: "-p 80:80 --link mariadb:mysql"
end
end
5 changes: 5 additions & 0 deletions compose.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

sudo docker-compose down
sudo docker-compose build
sudo docker-compose up
18 changes: 18 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '2'
services:
web:
build: .
ports:
- "80:80"
depends_on:
- mysql
links:
- mysql:mysql
mysql:
image: mariadb
ports:
- "3306:3306"
environment:
- MYSQL_ROOT_PASSWORD=megasecret
- MYSQL_DATABASE=ecomap
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci --init_connect='SET collation_connection = utf8_unicode_ci'
16 changes: 16 additions & 0 deletions ecomap/bin/db_deploy_and_run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
PRODROOT=${SCRIPT_DIR%/*}
echo "Product directory: $PRODROOT"
DBSCRIPTROOT=${PRODROOT}/db/ecomap
cd $DBSCRIPTROOT

while ! mysqladmin ping -h mysql --silent; do
echo "Waiting 5 seconds for mysql"
sleep 5
done

mysql -h mysql -u root -pmegasecret < DEPLOY.sql

/usr/sbin/apache2ctl -D FOREGROUND
8 changes: 5 additions & 3 deletions ecomap/bin/ecomap_config_builder.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# !/usr/bin/env bash
# Script run config builder
#!/usr/bin/env bash
# Script run config builder

PRODROOT=~/home/workspace/test_ecomap/ecomap
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
PRODROOT=${SCRIPT_DIR%/*}
echo "Product directory: $PRODROOT"
PYSRCROOT=${PRODROOT}/src/python
CONFROOT=${PRODROOT}/etc
PYTHONPATH=$PYSRCROOT
Expand Down
3 changes: 3 additions & 0 deletions ecomap/db/ecomap/DEPLOY.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
USE ecomap;
SOURCE CREATE_DB.sql;
SOURCE INSERT_DATA.sql;
28 changes: 14 additions & 14 deletions ecomap/etc/_ecomap_apache.conf
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<VirtualHost ecomap.new:80>
<VirtualHost *:80>

# --- Configure VirtualHost ---
# --- Configure VirtualHost ---

ServerName www.ecomap.new
ServerAdmin admin.email@gmail.com
ServerAlias ecomap.new
DocumentRoot "/path/to/project/directory/Lv-164.UI/"
DocumentRoot "/opt/ecomap/www"

# --- Configure WSGI Listening App(s) ---

WSGIDaemonProcess ecomap user=admin_name group=admin_name threads=5 processes=5
WSGIScriptAlias / /path/to/project/directory/Lv-164.UI/ecomap/www/ecomap.wsgi
WSGIDaemonProcess ecomap user=www-data group=www-data threads=5 processes=5
WSGIScriptAlias / /opt/ecomap/www/ecomap.wsgi

<Directory /path/to/project/directory/Lv-164.UI/ecomap/www/>
<Directory /opt/ecomap/www/>
WSGIProcessGroup ecomap
WSGIApplicationGroup %{GLOBAL}
WSGIScriptReloading Off
Expand All @@ -21,16 +21,16 @@

# --- Configure Static Files ---

Alias /uploads/ /path/to/project/directory/Lv-164.UI/ecomap/www/uploads/
Alias /js/ /path/to/project/directory/Lv-164.UI/ecomap/www/media/js/
Alias /css/ /path/to/project/directory/Lv-164.UI/ecomap/www/media/css/
Alias /image/ /path/to/project/directory/Lv-164.UI/ecomap/www/media/image/
Alias /templates/ /path/to/project/directory/Lv-164.UI/ecomap/www/templates/
Alias /fonts/ /path/to/project/directory/Lv-164.UI/ecomap/www/media/fonts/
Alias /uploads/ /opt/ecomap/www/uploads/
Alias /js/ /opt/ecomap/www/media/js/
Alias /css/ /opt/ecomap/www/media/css/
Alias /image/ /opt/ecomap/www/media/image/
Alias /templates/ /opt/ecomap/www/templates/
Alias /fonts/ /opt/ecomap/www/media/fonts/

# --- Configure Apache logging ---
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ErrorLog ${APACHE_LOG_DIR}/ecomap_error.log
CustomLog ${APACHE_LOG_DIR}/ecomap_access.log combined
LogLevel debug

</VirtualHost>
16 changes: 8 additions & 8 deletions ecomap/etc/_log.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
keys=root

[handlers]
keys=syslogHandler
keys=consoleHandler

[formatters]
keys=syslogFormat
keys=simpleFormatter

[logger_root]
level=DEBUG
handlers=syslogHandler
handlers=consoleHandler

[handler_syslogHandler]
class=handlers.SysLogHandler
formatter=syslogFormat
args=('/dev/log', handlers.SysLogHandler.LOG_LOCAL6)
[handler_consoleHandler]
class=StreamHandler
formatter=simpleFormatter
args=(sys.stdout,)

[formatter_syslogFormat]
[formatter_simpleFormatter]
format=ecomap: %(asctime)s %(levelname)s [%(module)s:%(lineno)d][%(funcName)s]%(threadName)s - %(message)s
datefmt=%d/%m/%y %H:%M:%S

10 changes: 5 additions & 5 deletions ecomap/etc/db.conf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[db]
db=ecomap_db
rw.host=localhost
db=ecomap
rw.host=mysql
rw.port=eval(3306)
rw.user=root
rw.password=root
rw.password=megasecret
rw.pool_size = eval(3)
ro.host=localhost
ro.host=mysql
ro.port=eval(3306)
ro.user=root
ro.password=root
ro.password=megasecret
ro.pool_size = eval(3)
connection_lifetime=eval(5)
connection_retries=eval(3)
Expand Down
26 changes: 26 additions & 0 deletions guestadditions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash

VBGAVERSION=5.1.18

sudo apt-get update -y

sudo apt-get dist-upgrade -y

sudo apt-get install linux-headers-$(uname -r) build-essential dkms -y

sudo wget -c http://download.virtualbox.org/virtualbox/$VBGAVERSION/VBoxGuestAdditions_$VBGAVERSION.iso \
-O /opt/VBoxGuestAdditions_$VBGAVERSION.iso > /dev/null 2>&1

sudo mount -o loop,ro /opt/VBoxGuestAdditions_$VBGAVERSION.iso /mnt

echo "yes" | sudo sh /mnt/VBoxLinuxAdditions.run uninstall

echo "yes" | sudo sh /mnt/VBoxLinuxAdditions.run --nox11

sudo groupadd vboxusers

sudo usermod -a -G vboxusers $USER

sudo umount /mnt

sudo rm /opt/*.iso
Empty file added page_object_ecomap/__init__.py
Empty file.
3 changes: 3 additions & 0 deletions page_object_ecomap/framework/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
chromedriver
.idea/

45 changes: 45 additions & 0 deletions page_object_ecomap/framework/BasePage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver import ActionChains
from page_object_ecomap.framework.Locators import HomePageLocator, LogoLocator


class BasePage:

def __init__(self, driver, base_url=HomePageLocator.BASE_URL):
self.driver = driver
self.base_url = base_url

def open(self, url=""):
url = self.base_url + url
self.driver.get(url)

def is_logo_present(self):
return self.is_element_present(*LogoLocator.LOGO)

def find_element(self, *locator):
return self.driver.find_element(*locator)

def click(self, *locator):
self.driver.find_element(*locator).click()

def type(self, text, *locator):
element = self.driver.find_element(*locator)
element.send_keys(text)

def get_title(self):
return self.driver.title

def get_current_url(self):
return self.driver.current_url

def hover(self, *locator):
element = self.driver.find_element(*locator)
hover = ActionChains(self.driver).move_to_element(element)
hover.perform()

def is_element_present(self, *locator):
try:
self.find_element(*locator)
except NoSuchElementException:
return False
return True
Loading