Skip to content

Playwright Tests

Playwright Tests #1580

Workflow file for this run

name: Playwright Tests
on:
# Add the triggers as required
push:
branches:
- '**'
pull_request:
branches:
- '**'
schedule:
# * is a special character in YAML so you have to quote this string
# This example triggers the workflow every day at 9:00 AM
- cron: '0 9 * * *'
# Trigger the workflow manually
workflow_dispatch:
env:
LT_USERNAME: ${{ secrets.LT_USERNAME }}
LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }}
jobs:
playwright-smart-ui:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 10
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Step for push event
run: |
echo "This is a push event!"
echo "The latest commitId $(git log -1 --format='%H')"
echo "COMMIT_ID=$(git log -1 --format='%H')" >> $GITHUB_ENV
if: github.event_name == 'push'
- name: Step for pull_request event
run: |
echo "This is a pull_request event!"
git log -n 5 --format="%H %an %s" | while read line; do echo "$line"; done
echo "The latest commitId $(git log -n 2 --format='%H' | tail -n 1)"
echo "COMMIT_ID=$(git log -n 2 --format='%H' | tail -n 1)" >> $GITHUB_ENV
if: github.event_name == 'pull_request'
- name: Create Github URL
run: |
API_HOST=https://api.github.com
echo "The latest commitId is $COMMIT_ID"
GITHUB_URL=$API_HOST/repos/$GITHUB_REPOSITORY/statuses/$COMMIT_ID
echo "GITHUB_URL: $GITHUB_URL"
echo "GITHUB_URL=$GITHUB_URL" >> $GITHUB_ENV
- name: Execute Playwright SmartUI Test
run: npm run test-smartui
playwright-single-test:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Execute Playwright Single Test
run: npm run test
playwright-parallel:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Execute Playwright Parallel Tests
run: npm run test-parallel
playwright-android:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Execute Playwright Android Real Device Test
run: npm run test-android
playwright-extension:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Execute Playwright Extension Test
run: npm run test-extension
playwright-iphone-emulation:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Execute Playwright iPhone Emulation Test
run: npm run test-iPhone-emulation
playwright-lighthouse:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Execute Playwright LightHouse Test
run: npm run test-lighthouse-report
playwright-cucumber-js:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./playwright-cucumber-js
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Execute Playwright Cucumber JS Test
run: npm run test
playwright-java:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./playwright-java
steps:
- uses: actions/checkout@v3
- name: Execute Playwright Java Test
run: mvn -Dexec.mainClass="com.lambdatest.PlaywrightTestSingle" -Dexec.classpathScope=test test-compile exec:java
playwright-java-junit:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./playwright-java-junit
steps:
- uses: actions/checkout@v3
- name: Execute Playwright Java JUnit Test
run: mvn clean test
playwright-jest-js:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./playwright-jest-js
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Install missing Playwright Dependencies
run: npx playwright install-deps
- name: Execute Playwright Cucumber Jest Test
run: npm test
playwright-test-js:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./playwright-test-js
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Install Playwright Browsers
run: npx playwright install
- name: Install missing Playwright Dependencies
run: npx playwright install-deps
- name: Execute Playwright Test JS
run: npm run test
- name: Execute Playwright Test JS on Android
run: npm run testAndroid
playwright-test-ts:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./playwright-test-ts
strategy:
matrix:
node-version: [18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- name: Install Playwright Browsers
run: npx playwright install
- name: Install missing Playwright Dependencies
run: npx playwright install-deps
- name: Execute Playwright Test TS
run: npm run test
playwright-python:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./playwright-python
strategy:
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip3 install playwright==1.39.0
- name: Execute Playwright Python GetTestDetails
run: python3 get_test_details_python_sample.py
- name: Execute Playwright Python iPhone Emulation
run: python3 playwright_sample_on_iphone.py
- name: Execute Playwright Python Sample Test
run: python3 playwright_sample.py
- name: Execute Playwright Python Lighthouse Test
run: python3 playwright_lighthouse_sample.py
playwright-csharp:
runs-on: windows-latest
defaults:
run:
working-directory: ./playwright-csharp
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0'
- run: dotnet build
- name: Execute Playwright CSharp Single Test
run: dotnet run single
- name: Execute Playwright CSharp iPhone Test
run: dotnet run iphonetest
- name: Execute Playwright CSharp iPad Test
run: dotnet run ipadtest
playwright-csharp-specflow:
runs-on: windows-latest
defaults:
run:
working-directory: ./playwright-csharp-specflow-xunit
steps:
- uses: actions/checkout@v3
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0'
- run: dotnet build
- name: Execute Playwright CSharp Specflow Tests
run: dotnet test