From 4f4b551e7ab406ebfc074a74f6d1d73771dd9807 Mon Sep 17 00:00:00 2001 From: Ankit Singh <2501.ankit@gmail.com> Date: Mon, 12 Dec 2022 12:50:58 +0530 Subject: [PATCH 01/10] add: GH action for SDK branch PRs --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a697243 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,33 @@ +--- +name: CI python selenium +on: + push: + branches: + - sdk + pull_request: + 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 }} + run: python -m pip install -r requirements.txt + - name: Install dependencies + run: python -m pip install -r requirements.txt + - name: run tests in parallel + run: browserstack-sdk ./tests/test.py + - name: run local tests in parallel + run: browserstack-sdk ./tests/local-test.py From 2f07407d6c55b893a8e959b19e9af59a68b48829 Mon Sep 17 00:00:00 2001 From: Ankit Singh <2501.ankit@gmail.com> Date: Mon, 12 Dec 2022 12:52:47 +0530 Subject: [PATCH 02/10] update: sample yml --- browserstack.yml | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/browserstack.yml b/browserstack.yml index c3c534b..7041eb5 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 +# `buildIdentifer` is a unique id to differentiate every execution that gets appended to +# buildName. Choose your buildIdentifier format from the 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,12 @@ 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 # =================== # 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) From cee93a57f81419ac166c28706e8566961c3c3f41 Mon Sep 17 00:00:00 2001 From: Ankit Singh <2501.ankit@gmail.com> Date: Mon, 12 Dec 2022 13:07:44 +0530 Subject: [PATCH 03/10] add: GH action for SDK branch PRs --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a697243..2fe5adb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,8 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} - run: python -m pip install -r requirements.txt + - name: Print python version + run: python --version - name: Install dependencies run: python -m pip install -r requirements.txt - name: run tests in parallel From 17246c94161eb3519414fd982f31a3c8a2c90902 Mon Sep 17 00:00:00 2001 From: Ankit Singh <2501.ankit@gmail.com> Date: Mon, 12 Dec 2022 13:10:06 +0530 Subject: [PATCH 04/10] Add: source to yml --- browserstack.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/browserstack.yml b/browserstack.yml index 7041eb5..a84f5f3 100644 --- a/browserstack.yml +++ b/browserstack.yml @@ -52,6 +52,8 @@ browserstackLocal: true # (Default false) # forceLocal: true # (Default: false) Set to true if you need to resolve all your traffic via BrowserStack Local tunnel. # 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 # =================== From bc99006b988aca07cece883767819033f82233d9 Mon Sep 17 00:00:00 2001 From: Ankit Singh <2501.ankit@gmail.com> Date: Mon, 12 Dec 2022 13:27:40 +0530 Subject: [PATCH 05/10] add: gh codeowners file --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS 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 From d67912db33cbe6579030c4edc23c22835d96bb05 Mon Sep 17 00:00:00 2001 From: Ankit Singh <2501.ankit@gmail.com> Date: Mon, 12 Dec 2022 14:53:50 +0530 Subject: [PATCH 06/10] add: update gh action to print sdk version --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2fe5adb..4a9cd25 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,8 @@ jobs: 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 From c2075ae88f3a26cc2727c2949a6d195d659d8cf5 Mon Sep 17 00:00:00 2001 From: Ankit Singh <51696887+Ankit098@users.noreply.github.com> Date: Tue, 13 Dec 2022 15:03:44 +0530 Subject: [PATCH 07/10] chore: typo fix Co-authored-by: Kamalpreet Kaur <38219887+kamal-kaur04@users.noreply.github.com> --- browserstack.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/browserstack.yml b/browserstack.yml index a84f5f3..feaa66c 100644 --- a/browserstack.yml +++ b/browserstack.yml @@ -14,8 +14,8 @@ accessKey: YOUR_ACCESS_KEY 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 -# buildName. Choose your buildIdentifier format from the the available expressions: +# `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 From ebe4c5562173132f31d84acda9cfb5ef71166f55 Mon Sep 17 00:00:00 2001 From: Ankit Singh <2501.ankit@gmail.com> Date: Tue, 13 Dec 2022 17:05:54 +0530 Subject: [PATCH 08/10] update: GH action to run only on PR, py versions --- .github/workflows/ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a9cd25..ef40ed8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,9 +1,6 @@ --- name: CI python selenium on: - push: - branches: - - sdk pull_request: branches: - sdk @@ -12,8 +9,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, windows-latest] - python-version: ['3.7', '3.8', '3.9', '3.10'] + os: [macos-latest, windows-latest, ubuntu-latest] + python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] name: python-sel-repo ${{ matrix.python }} - ${{ matrix.os }} env: BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} From a84e4621edee58c85d8bda68ca19ba7c10be4535 Mon Sep 17 00:00:00 2001 From: Ankit Singh <2501.ankit@gmail.com> Date: Wed, 28 Dec 2022 11:00:31 +0530 Subject: [PATCH 09/10] update: python versions, types to run on --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef40ed8..4a838ba 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,15 +2,15 @@ name: CI python selenium on: pull_request: - branches: - - sdk + branches: [sdk] + types: [opened, reopened] jobs: build: runs-on: ${{ matrix.os }} strategy: matrix: os: [macos-latest, windows-latest, ubuntu-latest] - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11'] + python: ['3.7', '3.10', '3.11'] name: python-sel-repo ${{ matrix.python }} - ${{ matrix.os }} env: BROWSERSTACK_USERNAME: ${{ secrets.BROWSERSTACK_USERNAME }} From 2a0c3b65a94fe2ac45f3b37e6dc8a07d58b8c746 Mon Sep 17 00:00:00 2001 From: Ankit Singh <2501.ankit@gmail.com> Date: Wed, 28 Dec 2022 11:04:30 +0530 Subject: [PATCH 10/10] add: master to gh actions branch list --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4a838ba..47f9724 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,7 +2,7 @@ name: CI python selenium on: pull_request: - branches: [sdk] + branches: [sdk, master] types: [opened, reopened] jobs: build: