Build a small script that retrieves data from duckduckgo's api ( DuckDuckGo Instant Answer API ):
- Search for 'dogs' and print a list of all images retrieved
- Search for 'dogecoin' and print a list of all urls
- The code has been tested on Python 3.9.4 and Windows 11
Pip
is requiredPytest
,PytestBDD
andRequest
libraries were used
- Clone repository:
git clone https://github.com/EfrainAndres/Challenge-Automation-API.git
- Create Virtual Enviroment
- The idea is create this virtual enviroment, in the same folder (Challenge-Automation-API):
python -m venv venv
- Then we should activate the virtual enviroment:
myenv\Scripts\activate
Install the dependencies:
pip install -r requirements.txt
Running the tests:
- We can run the tests with the next commands:
make e2etest
Or
pytest tests/e2e -s --gherkin-terminal-reporter -vv --html=report.html --capture=tee-sys
- When running the tests, a folder called
report
is generated and inside the folder there is a file calledindex.html
we open this file in the browser and we will be able to see the status of the test execution.