mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Merge branch 'develop' of https://brutus.artica.lan:8081/artica/pandorafms into develop
This commit is contained in:
commit
3c3229c3d2
13
.travis.yml
13
.travis.yml
@ -4,14 +4,8 @@ language: python
|
|||||||
python:
|
python:
|
||||||
- 2.7
|
- 2.7
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- secure: "MEfyEpYEBkPmgPYX3CDKhaoiOltH5lDcUOYZ/19Yflg6ee20IBZOywCmrKH7VouKlOHUrGTUQqHBou0npm93qBju3MrPCE2R62PiDV2EHCGl3AFpLkgt0m1/DceWCWKlL+gI8uvnEFzVUuaPm6cEcRn1ikzg5b084bTxJ2B1Bvs="
|
|
||||||
- SAUCE_USERNAME="artica_pandorafms"
|
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
firefox: "latest"
|
firefox: "latest"
|
||||||
sauce_connect: true
|
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
@ -20,12 +14,7 @@ before_install:
|
|||||||
- sudo apt-get install xvfb
|
- sudo apt-get install xvfb
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- pip install selenium PyVirtualDisplay sauceclient testtools
|
- pip install selenium PyVirtualDisplay testtools
|
||||||
|
|
||||||
#before_script:
|
|
||||||
# - "export DISPLAY=:99.0"
|
|
||||||
# - "sh -e /etc/init.d/xvfb start"
|
|
||||||
# - sleep 4 # give xvfb some time to start
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- docker run --name pandorafms -h pandorafms -dt -v "$TRAVIS_BUILD_DIR:/tmp/pandorafms" -p 127.0.0.1:80:80 pandorafms/pandorafms-base tail -f /var/log/messages
|
- docker run --name pandorafms -h pandorafms -dt -v "$TRAVIS_BUILD_DIR:/tmp/pandorafms" -p 127.0.0.1:80:80 pandorafms/pandorafms-base tail -f /var/log/messages
|
||||||
|
@ -2,13 +2,14 @@
|
|||||||
from unittest import TestResult, TestCase
|
from unittest import TestResult, TestCase
|
||||||
from common_functions_60 import *
|
from common_functions_60 import *
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from pyvirtualdisplay import Display
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
from selenium.webdriver.common.by import By
|
from selenium.webdriver.common.by import By
|
||||||
from selenium.webdriver.common.keys import Keys
|
from selenium.webdriver.common.keys import Keys
|
||||||
from selenium.webdriver.support.ui import Select
|
from selenium.webdriver.support.ui import Select
|
||||||
from selenium.common.exceptions import NoSuchElementException
|
from selenium.common.exceptions import NoSuchElementException
|
||||||
from selenium.common.exceptions import NoAlertPresentException
|
from selenium.common.exceptions import NoAlertPresentException
|
||||||
from sauceclient import SauceClient
|
#from sauceclient import SauceClient
|
||||||
from os import environ
|
from os import environ
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -25,17 +26,17 @@ class PandoraWebDriverTestCase(TestCase):
|
|||||||
time_started = None
|
time_started = None
|
||||||
time_elapsed = None #Total time of the test
|
time_elapsed = None #Total time of the test
|
||||||
tickets_associated = []
|
tickets_associated = []
|
||||||
sauce_username = environ["SAUCE_USERNAME"]
|
#sauce_username = environ["SAUCE_USERNAME"]
|
||||||
sauce_access_key = environ["SAUCE_ACCESS_KEY"]
|
#sauce_access_key = environ["SAUCE_ACCESS_KEY"]
|
||||||
sauce_client = None
|
#sauce_client = None
|
||||||
sauce_labs_job_id = None
|
#sauce_labs_job_id = None
|
||||||
|
|
||||||
desired_cap = {
|
#desired_cap = {
|
||||||
'tunnel-identifier': environ["TRAVIS_JOB_NUMBER"],
|
# 'tunnel-identifier': environ["TRAVIS_JOB_NUMBER"],
|
||||||
'platform': "Windows 10",
|
# 'platform': "Windows 10",
|
||||||
'browserName': "firefox",
|
# 'browserName': "firefox",
|
||||||
'version': "46",
|
# 'version': "46",
|
||||||
}
|
#}
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
@ -46,14 +47,17 @@ class PandoraWebDriverTestCase(TestCase):
|
|||||||
cls.base_url = os.getenv('DEVELOPMENT_URL')
|
cls.base_url = os.getenv('DEVELOPMENT_URL')
|
||||||
else:
|
else:
|
||||||
#Start VM in Sauce Labs
|
#Start VM in Sauce Labs
|
||||||
cls.driver = webdriver.Remote(command_executor='http://'+cls.sauce_username+':'+cls.sauce_access_key+'@ondemand.saucelabs.com:80/wd/hub',desired_capabilities=cls.desired_cap)
|
#cls.driver = webdriver.Remote(command_executor='http://'+cls.sauce_username+':'+cls.sauce_access_key+'@ondemand.saucelabs.com:80/wd/hub',desired_capabilities=cls.desired_cap)
|
||||||
cls.sauce_labs_job_id = cls.driver.session_id
|
#cls.sauce_labs_job_id = cls.driver.session_id
|
||||||
|
display = Display(visible=0, size=(800, 600))
|
||||||
|
display.start()
|
||||||
|
cls.driver = webdriver.Firefox()
|
||||||
cls.base_url = "http://127.0.0.1/"
|
cls.base_url = "http://127.0.0.1/"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def tearDownClass(cls):
|
def tearDownClass(cls):
|
||||||
|
if cls.is_development == False:
|
||||||
|
display.stop()
|
||||||
cls.driver.quit()
|
cls.driver.quit()
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
from unittest import *
|
from unittest import *
|
||||||
from console.include.common_functions_60 import *
|
from console.include.common_functions_60 import *
|
||||||
from console.include.common_classes_60 import *
|
from console.include.common_classes_60 import *
|
||||||
from sauceclient import SauceClient
|
#from sauceclient import SauceClient
|
||||||
from os import environ, getenv
|
from os import environ, getenv
|
||||||
import subprocess, time, sys
|
import subprocess, time, sys
|
||||||
|
|
||||||
@ -20,22 +20,22 @@ tests = a.discover(start_dir='console',pattern='*.py')
|
|||||||
c = ArticaTestResult()
|
c = ArticaTestResult()
|
||||||
tests.run(c)
|
tests.run(c)
|
||||||
|
|
||||||
|
#sauce_client = SauceClient(environ["SAUCE_USERNAME"], environ["SAUCE_ACCESS_KEY"])
|
||||||
|
#for test,error_msg in c.failures+c.errors:
|
||||||
|
# try:
|
||||||
|
# sauce_client.jobs.update_job(test.sauce_labs_job_id, passed=False,tags=[environ["TRAVIS_BRANCH"],test.id()],build_num=environ["TRAVIS_JOB_NUMBER"],name=str(test.id().split('.')[1]+': '+test.id().split('.')[2]))
|
||||||
|
# except:
|
||||||
|
# print "Could not annotate Sauce Labs job #%s" % str(test)
|
||||||
|
# next
|
||||||
|
#
|
||||||
|
#for test,error_msg in c.success+c.skipped:
|
||||||
|
# try:
|
||||||
|
# sauce_client.jobs.update_job(test.sauce_labs_job_id, passed=True,tags=[environ["TRAVIS_BRANCH"],test.id()],build_num=environ["TRAVIS_JOB_NUMBER"],name=str(test.id().split('.')[1]+': '+test.id().split('.')[2]))
|
||||||
|
#
|
||||||
|
# except:
|
||||||
|
# print "Could not annotate Sauce Labs job #%s" % str(test)
|
||||||
|
# next
|
||||||
#Update Saouce Labs jobs
|
#Update Saouce Labs jobs
|
||||||
sauce_client = SauceClient(environ["SAUCE_USERNAME"], environ["SAUCE_ACCESS_KEY"])
|
|
||||||
for test,error_msg in c.failures+c.errors:
|
|
||||||
try:
|
|
||||||
sauce_client.jobs.update_job(test.sauce_labs_job_id, passed=False,tags=[environ["TRAVIS_BRANCH"],test.id()],build_num=environ["TRAVIS_JOB_NUMBER"],name=str(test.id().split('.')[1]+': '+test.id().split('.')[2]))
|
|
||||||
except:
|
|
||||||
print "Could not annotate Sauce Labs job #%s" % str(test)
|
|
||||||
next
|
|
||||||
|
|
||||||
for test,error_msg in c.success+c.skipped:
|
|
||||||
try:
|
|
||||||
sauce_client.jobs.update_job(test.sauce_labs_job_id, passed=True,tags=[environ["TRAVIS_BRANCH"],test.id()],build_num=environ["TRAVIS_JOB_NUMBER"],name=str(test.id().split('.')[1]+': '+test.id().split('.')[2]))
|
|
||||||
|
|
||||||
except:
|
|
||||||
print "Could not annotate Sauce Labs job #%s" % str(test)
|
|
||||||
next
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user