From 6fdfadae92cd75b833e336c1d602a3fe4235b4c4 Mon Sep 17 00:00:00 2001 From: JeeveshJ7 Date: Fri, 27 Sep 2024 14:05:21 +0530 Subject: [PATCH 1/3] PR check action --- .github/workflows/Pr-check.yml | 68 ++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/Pr-check.yml diff --git a/.github/workflows/Pr-check.yml b/.github/workflows/Pr-check.yml new file mode 100644 index 0000000..2d72a62 --- /dev/null +++ b/.github/workflows/Pr-check.yml @@ -0,0 +1,68 @@ +name: SmartUI PR Check with NodeJS SDK + +on: + pull_request: + branches: + - master + +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: '14' # Use the appropriate Node.js version for your project + + - name: Install Dependencies + run: | + npm ci + + - name: Install SmartUI SDK + run: | + npm install @lambdatest/smartui-cli + + - 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 From 9dc6c599b55b8c688b50694a1a3ef898113d9659 Mon Sep 17 00:00:00 2001 From: JeeveshJ7 Date: Fri, 27 Sep 2024 14:10:34 +0530 Subject: [PATCH 2/3] Changes --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eb71fa6..104d776 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -

Smart UI Testing With Selenium Node.JS

+

Smart UI Testing With Selenium Node.JS

From e988292fb734f32af32cad808a299395a007d349 Mon Sep 17 00:00:00 2001 From: JeeveshJ7 Date: Fri, 27 Sep 2024 14:25:51 +0530 Subject: [PATCH 3/3] ... --- .github/workflows/Pr-check.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/Pr-check.yml b/.github/workflows/Pr-check.yml index 2d72a62..4313dab 100644 --- a/.github/workflows/Pr-check.yml +++ b/.github/workflows/Pr-check.yml @@ -3,7 +3,8 @@ name: SmartUI PR Check with NodeJS SDK on: pull_request: branches: - - master + - main + - stage env: LT_USERNAME: ${{ secrets.LT_USERNAME }} @@ -36,15 +37,13 @@ jobs: - name: Install Node.js uses: actions/setup-node@v3 with: - node-version: '14' # Use the appropriate Node.js version for your project - - - name: Install Dependencies - run: | - npm ci + node-version: '20' # Use the appropriate Node.js version for your project - name: Install SmartUI SDK run: | - npm install @lambdatest/smartui-cli + npm install @lambdatest/smartui-cli@latest + npm install @lambdatest/selenium-driver + npm install selenium-webdriver - name: Set up SmartUI Config run: |