mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 15:54:29 +02:00
Trying Sauce Labs
This commit is contained in:
parent
6dfe6a8af8
commit
b2488d858b
16
.travis.yml
16
.travis.yml
@ -4,8 +4,14 @@ language: python
|
|||||||
python:
|
python:
|
||||||
- 2.7
|
- 2.7
|
||||||
|
|
||||||
|
env:
|
||||||
|
- SAUCE_USERNAME="artica_pandorafms"
|
||||||
|
global:
|
||||||
|
- secure: "MEfyEpYEBkPmgPYX3CDKhaoiOltH5lDcUOYZ/19Yflg6ee20IBZOywCmrKH7VouKlOHUrGTUQqHBou0npm93qBju3MrPCE2R62PiDV2EHCGl3AFpLkgt0m1/DceWCWKlL+gI8uvnEFzVUuaPm6cEcRn1ikzg5b084bTxJ2B1Bvs="
|
||||||
|
|
||||||
addons:
|
addons:
|
||||||
firefox: "latest"
|
firefox: "latest"
|
||||||
|
sauce_connect: true
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- docker
|
- docker
|
||||||
@ -15,12 +21,12 @@ before_install:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
- docker run --rm -t -v "$TRAVIS_BUILD_DIR:/tmp/pandorafms" -p 80:80 pandorafms/pandorafms-base /tmp/pandorafms/tests/test.sh
|
- docker run --rm -t -v "$TRAVIS_BUILD_DIR:/tmp/pandorafms" -p 80:80 pandorafms/pandorafms-base /tmp/pandorafms/tests/test.sh
|
||||||
- pip install selenium PyVirtualDisplay
|
- pip install selenium PyVirtualDisplay sauceclient
|
||||||
|
|
||||||
before_script:
|
#before_script:
|
||||||
- "export DISPLAY=:99.0"
|
# - "export DISPLAY=:99.0"
|
||||||
- "sh -e /etc/init.d/xvfb start"
|
# - "sh -e /etc/init.d/xvfb start"
|
||||||
- sleep 4 # give xvfb some time to start
|
# - sleep 4 # give xvfb some time to start
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- python $TRAVIS_BUILD_DIR/tests/console/PAN1.py
|
- python $TRAVIS_BUILD_DIR/tests/console/PAN1.py
|
||||||
|
@ -16,9 +16,7 @@ class PAN1(PandoraWebDriverTestCase):
|
|||||||
|
|
||||||
def test_pan1(self):
|
def test_pan1(self):
|
||||||
driver = self.driver
|
driver = self.driver
|
||||||
#login(driver,"admin","t3st1ng!",self.base_url)
|
|
||||||
login(driver,"admin","pandora",self.base_url)
|
login(driver,"admin","pandora",self.base_url)
|
||||||
#driver.find_element_by_css_selector("#subSetup > li.sub_subMenu > a > div.submenu_text.submenu2_text_middle").click()
|
|
||||||
element = driver.find_element_by_css_selector("#subSetup > li.sub_subMenu > a > div.submenu_text.submenu2_text_middle")
|
element = driver.find_element_by_css_selector("#subSetup > li.sub_subMenu > a > div.submenu_text.submenu2_text_middle")
|
||||||
driver.execute_script("arguments[0].click();", element)
|
driver.execute_script("arguments[0].click();", element)
|
||||||
self.assertEqual("IP list with API access", driver.find_element_by_id("table2-15-0").text)
|
self.assertEqual("IP list with API access", driver.find_element_by_id("table2-15-0").text)
|
||||||
|
@ -8,6 +8,7 @@ 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 os import environ
|
||||||
|
|
||||||
|
|
||||||
class ArticaTestResult(TestResult):
|
class ArticaTestResult(TestResult):
|
||||||
@ -24,10 +25,20 @@ 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_access_key = environ["SAUCE_ACCESS_KEY"]
|
||||||
|
|
||||||
|
desired_cap = {
|
||||||
|
'tunnel-identifier': environ["TRAVIS_JOB_NUMBER"],
|
||||||
|
'platform': "Windows 10",
|
||||||
|
'browserName': "firefox",
|
||||||
|
'version': "46",
|
||||||
|
}
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.time_started = datetime.now()
|
self.time_started = datetime.now()
|
||||||
self.driver = webdriver.Firefox()
|
#self.driver = webdriver.Firefox()
|
||||||
|
self.driver = webdriver.Remote(command_executor='http://'+self.sauce_username+':'+self.sauce_access_key+'@ondemand.saucelabs.com:80/wd/hub',desired_capabilities=self.desired_cap)
|
||||||
self.driver.implicitly_wait(30)
|
self.driver.implicitly_wait(30)
|
||||||
self.base_url = "http://localhost/"
|
self.base_url = "http://localhost/"
|
||||||
self.verificationErrors = []
|
self.verificationErrors = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user