Skip to content
Open
Show file tree
Hide file tree
Changes from 6 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
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
name: CI python selenium
on:
push:
Comment thread
Ankit098 marked this conversation as resolved.
Outdated
branches:
- sdk
pull_request:
Comment thread
Ankit098 marked this conversation as resolved.
branches:
- sdk
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
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
# `buildIdentifer` is a unique id to differentiate every execution that gets appended to
Comment thread
Ankit098 marked this conversation as resolved.
Outdated
# buildName. Choose your buildIdentifier format from the the available expressions:
Comment thread
Ankit098 marked this conversation as resolved.
Outdated
# ${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)