Skip to content

sad #37

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

sad #37

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
67 changes: 67 additions & 0 deletions .github/workflows/Pr-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: SmartUI PR Check with NodeJS SDK

on:
pull_request:
branches:
- main
- stage

env:
LT_USERNAME: ${{ secrets.LT_USERNAME }}
LT_ACCESS_KEY: ${{ secrets.LT_ACCESS_KEY }}
PROJECT_TOKEN: ${{ secrets.PROJECT_TOKEN }}
LT_SDK_DEBUG: true
SMARTUI_DEBUG: true

jobs:
smartui-pr-check:
name: Execute SmartUI PR Check with NodeJS SDK
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}

- name: Find Last CommitId
run: |
API_HOST=https://api.github.com
# Get the commit ID of the last commit
COMMIT_ID=$(git rev-parse HEAD)
echo "Last commit ID of PR: $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: Install Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # Use the appropriate Node.js version for your project

- name: Install SmartUI SDK
run: |
npm install @lambdatest/smartui-cli@latest
npm install @lambdatest/selenium-driver
npm install selenium-webdriver

- name: Set up SmartUI Config
run: |
npx smartui config:create smartui-config.json

- name: Execute SmartUI Tests
run: |
npx smartui --config smartui-config.json exec -- npm run smartui-cloud
env:
SMARTUI_PROJECT_NAME: "your-project-name" # Replace with your SmartUI project name
SMARTUI_BUILD_NAME: ${{ github.sha }}

- name: Check for Visual Changes
run: |
echo "Checking for visual differences..."

- name: Comment on PR with Results
if: failure()
run: |
echo "Visual differences found. Please review the SmartUI report."
# You can add code to post this comment to the PR using GitHub API
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<h1>Smart UI Testing With Selenium Node.JS</h1>
<h1>Smart UI Testing With Selenium Node.JS </h1>

<img height="400" src="https://user-images.githubusercontent.com/126776938/232535511-8d51cf1b-1a33-48fc-825c-b13e7a9ec388.png">

Expand Down
Loading