2019-04-03 04:59:15 +08:00
|
|
|
# Test the SeleniumBase Python package with Azure Pipelines.
|
|
|
|
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
|
|
|
|
|
|
|
|
trigger:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
- job: 'Test'
|
|
|
|
pool:
|
2021-03-06 08:17:57 +08:00
|
|
|
vmImage: 'Ubuntu-20.04'
|
2019-04-03 04:59:15 +08:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2021-11-16 04:10:55 +08:00
|
|
|
Python3_6:
|
2019-04-03 04:59:15 +08:00
|
|
|
python.version: '3.6'
|
2021-11-16 04:10:55 +08:00
|
|
|
Python3_7:
|
2019-04-03 04:59:15 +08:00
|
|
|
python.version: '3.7'
|
2021-11-16 04:10:55 +08:00
|
|
|
Python3_8:
|
2020-06-29 23:45:22 +08:00
|
|
|
python.version: '3.8'
|
2021-11-16 04:10:55 +08:00
|
|
|
Python3_9:
|
2020-11-18 22:37:48 +08:00
|
|
|
python.version: '3.9'
|
2022-01-27 15:35:26 +08:00
|
|
|
Python3_10:
|
|
|
|
python.version: '3.10'
|
2021-03-18 11:34:16 +08:00
|
|
|
maxParallel: 5
|
2019-04-03 04:59:15 +08:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- task: UsePythonVersion@0
|
|
|
|
inputs:
|
|
|
|
versionSpec: '$(python.version)'
|
|
|
|
architecture: 'x64'
|
|
|
|
|
2019-12-24 12:56:26 +08:00
|
|
|
- script: python -m pip install --upgrade pip && pip --version
|
|
|
|
displayName: 'Install/upgrade pip'
|
|
|
|
|
2019-12-28 09:44:26 +08:00
|
|
|
- script: python -m pip install seleniumbase
|
2019-12-24 12:56:26 +08:00
|
|
|
displayName: 'Verify install from PyPI'
|
|
|
|
|
2021-03-06 08:17:57 +08:00
|
|
|
#- script: python -m pip install -r requirements.txt --upgrade
|
|
|
|
# displayName: 'Install dependencies'
|
2019-04-03 04:59:15 +08:00
|
|
|
|
2021-03-06 08:17:57 +08:00
|
|
|
- script: python -m pip install -e .
|
2019-04-26 19:10:37 +08:00
|
|
|
displayName: 'Install SeleniumBase'
|
|
|
|
|
2019-04-03 06:12:55 +08:00
|
|
|
- script: |
|
|
|
|
sudo apt install google-chrome-stable
|
2021-03-06 07:16:53 +08:00
|
|
|
displayName: 'Install Chrome'
|
|
|
|
|
|
|
|
#- script: |
|
|
|
|
# sudo apt-get install firefox
|
|
|
|
# displayName: 'Install Firefox'
|
2019-04-03 04:59:15 +08:00
|
|
|
|
2020-09-10 05:33:19 +08:00
|
|
|
- script: |
|
|
|
|
seleniumbase
|
|
|
|
sbase
|
|
|
|
displayName: 'Check the console scripts interface'
|
|
|
|
|
2019-04-03 06:12:55 +08:00
|
|
|
- script: |
|
2021-03-06 08:33:37 +08:00
|
|
|
seleniumbase install chromedriver
|
2019-12-23 03:17:03 +08:00
|
|
|
displayName: 'Install chromedriver'
|
2019-04-03 04:59:15 +08:00
|
|
|
|
2019-04-27 23:49:48 +08:00
|
|
|
- script: |
|
|
|
|
echo "def test_1(): pass" > nothing.py
|
|
|
|
pytest nothing.py
|
|
|
|
displayName: 'Make sure pytest is working'
|
|
|
|
|
2021-03-06 08:37:26 +08:00
|
|
|
#- script: python -m pytest examples/unit_tests/verify_framework.py
|
|
|
|
# displayName: 'Run pytest verify_framework.py'
|
2021-03-06 08:00:42 +08:00
|
|
|
|
2019-12-28 09:44:26 +08:00
|
|
|
- script: python -m pytest examples/boilerplates/boilerplate_test.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
|
2019-04-06 05:01:17 +08:00
|
|
|
displayName: 'Run pytest boilerplate_test.py --browser=chrome --headless'
|
2019-04-03 04:59:15 +08:00
|
|
|
|
2021-03-06 07:16:53 +08:00
|
|
|
#- script: python -m pytest examples/boilerplates/boilerplate_test.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
|
|
|
|
# displayName: 'Run pytest boilerplate_test.py --browser=firefox --headless'
|
|
|
|
|
|
|
|
#- script: python -m pytest examples/test_demo_site.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
|
|
|
|
# displayName: 'Run pytest test_demo_site.py --browser=chrome --headless'
|
2020-06-29 23:45:22 +08:00
|
|
|
|
2021-03-05 06:09:47 +08:00
|
|
|
#- script: python -m pytest examples/my_first_test.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
|
|
|
|
# displayName: 'Run pytest my_first_test.py --browser=chrome --headless'
|
|
|
|
|
2020-03-16 12:46:41 +08:00
|
|
|
#- script: python -m pytest examples/test_inspect_html.py --browser=chrome --headless -v -s --junit-xml=junit/test-results.xml
|
|
|
|
# displayName: 'Run pytest test_inspect_html.py --browser=chrome --headless'
|
2019-11-19 16:02:11 +08:00
|
|
|
|
2020-01-25 11:55:25 +08:00
|
|
|
#- task: PublishTestResults@2
|
|
|
|
# inputs:
|
|
|
|
# testResultsFiles: '**/test-results.xml'
|
|
|
|
# testRunTitle: 'Python $(python.version)'
|
|
|
|
# condition: succeededOrFailed()
|
|
|
|
|
|
|
|
#- job: 'Publish'
|
|
|
|
# dependsOn: 'Test'
|
|
|
|
# pool:
|
2020-11-18 22:37:48 +08:00
|
|
|
# vmImage: 'Ubuntu-18.04'
|
2020-01-25 11:55:25 +08:00
|
|
|
|
|
|
|
# steps:
|
|
|
|
# - task: UsePythonVersion@0
|
|
|
|
# inputs:
|
|
|
|
# versionSpec: '3.x'
|
|
|
|
# architecture: 'x64'
|
|
|
|
|
|
|
|
# - script: python setup.py sdist
|
|
|
|
# displayName: 'Build sdist'
|