https://github.com/satyajit5988/BritAPIAutomate
The project root location contains the requirement.txt file which lists all the packages required to run the test after cloning the repository in the local system. Base python version is 3.13.XX.
Few of the major libraries that are used in this project are:
-
pip install requests
-
pip install json
-
pip install jsonpath
-
pip install pytest
-
pip install pytest-xdist
-
pip install pytest-html
-
pip install pytest-json-report
-
pip install pytest-cov
-
pip install openpyxl
10 ) pip install allure-pytest
In order to clone the repository on your local system, create a folder to store the code, open GitBash terminal and redirect to the created folder location and run below commands:
cd <Path of folder>
git clone https://github.com/satyajit5988/BritAPIAutomate.git
Git can be used for pushing or pulling your code. Steps to set up remote GIT repository is as follows:
-
Create a remote repository by login to GitHub. Note the HTTP's URL to connect to it - git@github.com:XYZ/ABC.git
-
Now go to the folder where all your automation code is written. Create a local repository by initializing git = git init
-
Check status of untracked file by running below command - git status
-
Add these files to staging area - git add or git add .
-
Commit these changes - git commit -m "Updating project Files"
-
Then connect the local and remote repository by running the command - git remote add origin git@github.com:XYZ/ABC.git
-
Set the branch to which code is to be pushed - git branch -M main
-
Finally push your code using below command - git push -u origin main
GitHub Actions can be used for pushing or pulling your code. Steps to set up remote GIT repository is as follows:
-
In our project repository, create the folders:
Open GitBash and run the below commands:
cd /path/to/your/repo
mkdir -p .github/workflows
-
Create a
.yml
file and add the below code to it:name: Python CI Pipeline (Github Actions) on: push: branches: - main pull_request: branches: - main jobs: test: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v3 - name: Set up Python uses: actions/setup-python@v4 with: python-version: '3.13' - name: Install dependencies run: | python -m pip install --upgrade pip pip install -r requirements.txt - name: Create Reports Folder run: | mkdir -p Reports - name: Run tests run: | pytest TestCases/test_EndToEnd.py -v --html=Reports/report.html --capture=no --disable-warnings - name: Upload HTML report uses: actions/upload-artifact@v4 with: name: TestReportHTML path: Reports/report.html
-
Commit this file and push to repo:
git add .github/workflows/ci.yml
git commit -m "Adding CI pipeline yml file"
git push origin main
-
Go to Actions tab in GitHub repository and check if the workflow ran, and it is successful or not - https://github.com/satyajit5988/BritAPIAutomate/actions
1) With the PUT Request we get following error when we try to delete any of the existing user.
{ "error": "7 is a reserved id and the data object of it cannot be overridden. You can create a new object via POST request and use new generated by id from it to send a PUT request." }
2) When we hit overall 200 requests from an IP address, we get the following message which explains that we have hit our limit for the day. { "error": "We are very sorry but you reached your limit of requests per day. Our current limit is equal to 100 requests per day. The reason for that is the fact that servers cost money and 200 requests per user per day is all that we can afford at the moment. Tomorrow the limit will reset and you will be able to continue. Thanks and have a good day!" }