Skip to content

Add gh actions; new sample yml #21

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 10 commits into
base: sdk
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.github/workflows/*.yml @browserstack/asi-devs
33 changes: 33 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
name: CI python selenium
on:
pull_request:
branches: [sdk, master]
types: [opened, reopened]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest, ubuntu-latest]
python: ['3.7', '3.10', '3.11']
name: python-sel-repo ${{ matrix.python }} - ${{ matrix.os }}
env:
BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }}
BROWSERSTACK_ACCESS_KEY: ${{ secrets.BROWSERSTACK_ACCESS_KEY }}
steps:
- uses: actions/checkout@v3
- name: Setup python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python }}
- name: Print python version
run: python --version
- name: Install dependencies
run: python -m pip install -r requirements.txt
- name: Print browserstack-sdk version
run: browserstack-sdk --version
- name: run tests in parallel
run: browserstack-sdk ./tests/test.py
- name: run local tests in parallel
run: browserstack-sdk ./tests/local-test.py
38 changes: 21 additions & 17 deletions browserstack.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
# =============================
# Set BrowserStack Credentials
# =============================
# Add your BrowserStack userName and acccessKey here or set BROWSERSTACK_USERNAME and
# Add your BrowserStack userName and accessKey here or set BROWSERSTACK_USERNAME and
# BROWSERSTACK_ACCESS_KEY as env variables
userName: YOUR_USERNAME
accessKey: YOUR_ACCESS_KEY

# ======================
# Organizing your tests
# BrowserStack Reporting
# ======================
# Use `projectName`, `buildName`, `name` capabilities to organise your tests
# `name` is the name of your test sessions and is automatically picked from your
# test name and doesn't need to be set manually when using BrowserStack SDK
# `buildName` is used to name your CI/CD job or the execution of your test suite.
# Ensure you add a dynamic identifier, like an incremental build number from your
# CI/CD or timestamp at the end of every build; otherwise tests from different
# executions will be grouped together on BrowserStack
buildName: browserstack-build-1
# Use `projectName` to set the name of your project. Example, Marketing Website
projectName: BrowserStack Samples
# The following capabilities are used to set up reporting on BrowserStack:
# Set 'projectName' to the name of your project. Example, Marketing Website
projectName: BrowserStack Samples
# Set `buildName` as the name of the job / testsuite being run
buildName: browserstack build
# `buildIdentifier` is a unique id to differentiate every execution that gets appended to
# buildName. Choose your buildIdentifier format from the available expressions:
# ${BUILD_NUMBER} (Default): Generates an incremental counter with every execution
# ${DATE_TIME}: Generates a Timestamp with every execution. Eg. 05-Nov-19:30
# Read more about buildIdentifiers here -> https://www.browserstack.com/docs/automate/selenium/organize-tests
buildIdentifier: '#${BUILD_NUMBER}' # Supports strings along with either/both ${expression}

# =======================================
# Platforms (Browsers / Devices to test)
Expand All @@ -28,13 +29,13 @@ projectName: BrowserStack Samples
platforms:
- os: OS X
osVersion: Big Sur
browser: Chrome
browserName: Chrome
browserVersion: latest
- os: Windows
osVersion: 10
browser: Edge
browserName: Edge
browserVersion: latest
- device: Samsung Galaxy S22 Ultra
- deviceName: Samsung Galaxy S22 Ultra
browserName: chrome # Try 'samsung' for Samsung browser
osVersion: 12.0

Expand All @@ -49,11 +50,14 @@ browserstackLocal: true # <boolean> (Default false)
# Options to be passed to BrowserStack local in-case of advanced configurations
# localIdentifier: # <string> (Default: null) Needed if you need to run multiple instances of local.
# forceLocal: true # <boolean> (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel.
# Entire list of arguments availabe here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections
# Entire list of arguments available here -> https://www.browserstack.com/docs/automate/selenium/manage-incoming-connections

source: python-selenium:sample-sdk:v1.0

# ===================
# Debugging features
# ===================
debug: false # <boolean> # Set to true if you need screenshots for every selenium command ran
networkLogs: false # <boolean> Set to true to enable HAR logs capturing
consoleLogs: errors # <string> Remote browser's console debug levels to be printed (Available levels: `disable`, `errors`, `warnings`, `info`, `verbose`, Default: errors)
consoleLogs: errors # <string> Remote browser's console debug levels to be printed (Default: errors)
# Available options are `disable`, `errors`, `warnings`, `info`, `verbose` (Default: errors)