From 5e6fb72ab719c441d4b21a1736638704eab28e13 Mon Sep 17 00:00:00 2001 From: sushobhit Date: Fri, 13 Jan 2023 18:32:22 +0530 Subject: [PATCH 1/2] update README file --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 414a6d0f..42e347e3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,61 @@ # smartui-github-testing - For Testing Github App Integration with SmartUI -- Just do a commit + +### Getting Started Github App Integration with SmartUI Product - Selenium Automation + +Steps 1: Setup Github App with lambdatest from link github setup + +- Using OAuth + +- Cloud, or + +- Self Hosted + + +Step 2: Once setup is done, you will see like + + +Step 3: Now you need to setup a sample repository where your test case are mentioned, [smartui-github-testing](https://github.com/LambdaTest/smartui-github-testing) + +Step 4: For Github Status updates on PR/ commit need to add capabilities in test suite, code snippet + +``` + github: { + "url": "https://api.github.com/repos/OWNER/REPO/statuses/commitId", + "owner": "{OWNER}", //Optional + "repo": "{REPO}", //Optional + "commit": "{commitId}" //Optional + }, +``` + +Step5: How to get the github.url value in test suite + +Here we have taken an example of github action to get the github.url + +Add below steps in your github action file .github/workflows/ci.yml +``` + name: Execute SmartUI Test with Github App Integration + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + + - name: Create commit status + run: | + API_HOST=https://api.github.com + # Check out the PR branch + git checkout $GITHUB_HEAD_REF + # 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 +``` + + +Step 6: Commit you changes over git on a branch and raise the PR to main branch + +Step 7: Now you will see the `lambdatest-smartui-app` check in the PR From 8945b23ef80ebafb5e51a50e7e72907ab37b2d39 Mon Sep 17 00:00:00 2001 From: sushobhit Date: Fri, 13 Jan 2023 22:04:08 +0530 Subject: [PATCH 2/2] fix README file --- README.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 42e347e3..7a1fd141 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Step 2: Once setup is done, you will see like Step 3: Now you need to setup a sample repository where your test case are mentioned, [smartui-github-testing](https://github.com/LambdaTest/smartui-github-testing) -Step 4: For Github Status updates on PR/ commit need to add capabilities in test suite, code snippet +Step 4: For Github Status updates on PR/ commit need to add capabilities in test suite, ``` github: { @@ -31,11 +31,10 @@ Step 4: For Github Status updates on PR/ commit need to add capabilities in test }, ``` -Step5: How to get the github.url value in test suite +Step5: How to get the `github.url` value in test suite -Here we have taken an example of github action to get the github.url +Here we have taken an example of github action, Add below steps in your github action file [.github/workflows/ci.yml](https://github.com/LambdaTest/smartui-github-testing/blob/main/.github/workflows/ci.yml) -Add below steps in your github action file .github/workflows/ci.yml ``` name: Execute SmartUI Test with Github App Integration runs-on: ubuntu-latest