diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..8f0fab7 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +.github/workflows/*.yml @browserstack/asi-devs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..47f9724 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/browserstack.yml b/browserstack.yml index c3c534b..feaa66c 100644 --- a/browserstack.yml +++ b/browserstack.yml @@ -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) @@ -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 @@ -49,11 +50,14 @@ browserstackLocal: true # (Default false) # Options to be passed to BrowserStack local in-case of advanced configurations # localIdentifier: # (Default: null) Needed if you need to run multiple instances of local. # forceLocal: true # (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 # # Set to true if you need screenshots for every selenium command ran networkLogs: false # Set to true to enable HAR logs capturing -consoleLogs: errors # Remote browser's console debug levels to be printed (Available levels: `disable`, `errors`, `warnings`, `info`, `verbose`, Default: errors) +consoleLogs: errors # Remote browser's console debug levels to be printed (Default: errors) +# Available options are `disable`, `errors`, `warnings`, `info`, `verbose` (Default: errors)