Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
FROM ubuntu:xenial

ENV DEBIAN_FRONTEND=noninteractive \
MOZ_HEADLESS=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1

RUN apt-get update \
&& apt-get install -y software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update \
&& apt-get install -y bzip2 curl firefox git python2.7 python3.6 python3-pip \
&& rm -rf /var/lib/apt/lists/*

ENV FIREFOX_VERSION=59.0

RUN curl -fsSLo /tmp/firefox.tar.bz2 https://download-installer.cdn.mozilla.net/pub/firefox/releases/$FIREFOX_VERSION/linux-x86_64/en-US/firefox-$FIREFOX_VERSION.tar.bz2 \
&& apt-get -y purge firefox \
&& rm -rf /opt/firefox \
&& tar -C /opt -xjf /tmp/firefox.tar.bz2 \
&& rm /tmp/firefox.tar.bz2 \
&& mv /opt/firefox /opt/firefox-$FIREFOX_VERSION \
&& ln -fs /opt/firefox-$FIREFOX_VERSION/firefox /usr/bin/firefox

ENV GECKODRIVER_VERSION=0.20.0
RUN curl -fsSLo /tmp/geckodriver.tar.gz https://github.com/mozilla/geckodriver/releases/download/v$GECKODRIVER_VERSION/geckodriver-v$GECKODRIVER_VERSION-linux64.tar.gz \
&& rm -rf /opt/geckodriver \
&& tar -C /opt -zxf /tmp/geckodriver.tar.gz \
&& rm /tmp/geckodriver.tar.gz \
&& mv /opt/geckodriver /opt/geckodriver-$GECKODRIVER_VERSION \
&& chmod 755 /opt/geckodriver-$GECKODRIVER_VERSION \
&& ln -fs /opt/geckodriver-$GECKODRIVER_VERSION /usr/bin/geckodriver

ENV TOX_VERSION=2.9.1
RUN pip3 install tox==$TOX_VERSION

ADD . /src
WORKDIR /src
62 changes: 38 additions & 24 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,51 @@ def capabilities = [

pipeline {
agent any
libraries {
lib('fxtest@1.9')
}
options {
ansiColor('xterm')
timestamps()
timeout(time: 30, unit: 'MINUTES')
}
environment {
PYTEST_ADDOPTS =
"--tb=short " +
"--color=yes " +
"--driver=SauceLabs " +
"--variables=capabilities.json"
PULSE = credentials('PULSE')
SAUCELABS = credentials('SAUCELABS')
}
stages {
stage('Checkout') {
steps {
deleteDir()
checkout scm
stash 'workspace'
}
}
stage('Lint') {
agent {
dockerfile true
}
steps {
deleteDir()
unstash 'workspace'
ansiColor('xterm') {
sh "tox -e flake8"
}
sh "tox -e flake8"
}
}
stage('Test') {
environment {
SAUCELABS = credentials('SAUCELABS')
}
steps {
unstash 'workspace'
ansiColor('xterm') {
sh "tox"
parallel {
stage('py36') {
agent {
dockerfile true
}
steps {
writeCapabilities(capabilities, 'capabilities.json')
sh "tox -e py36"
}
}
}
post {
always {
stash includes: 'results/*', name: 'results'
archiveArtifacts 'results/*'
stage('py27') {
agent {
dockerfile true
}
steps {
writeCapabilities(capabilities, 'capabilities.json')
sh "tox -e py27"
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion axe_selenium_python/axe.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def execute(self, context=None, options=None):
"""
Run axe against the current page.

:param context: which part of the page to analyze and/or what to exclude.
:param context: which page part(s) to analyze and/or what to exclude.
:param options: dictionary of aXe options.
"""
template = 'return axe.run(%s).then(function(result){return result;});'
Expand Down
2 changes: 1 addition & 1 deletion axe_selenium_python/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def pytest_html_results_table_row(report, cells):

@pytest.mark.hookwrapper
def pytest_runtest_makereport(item, call):
"""Make HTML report. Use test function docstrings as description in report."""
"""Make HTML report using test-function docstrings as description."""
outcome = yield
report = outcome.get_result()
# add docstring to 'description' column
Expand Down
7 changes: 4 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
[tox]
envlist = py27, py3, flake8
envlist = py27, py36, flake8
skipsdist = true

[testenv]
passenv = HOME DISPLAY MOZ_HEADLESS PYTEST_ADDOPTS PYTEST_BASE_URL \
SAUCELABS_USR SAUCELABS_PSW JENKINS_URL JOB_NAME BUILD_NUMBER
deps = -raxe_selenium_python/tests/requirements/tests.txt
commands = pytest \
--verbose \
--driver=SauceLabs \
--base-url=https://mozillians.org \
--capability browserName Firefox
--base-url=https://web-mozillians-staging.production.paas.mozilla.community

[testenv:flake8]
deps = -raxe_selenium_python/tests/requirements/flake8.txt
Expand Down