-
Notifications
You must be signed in to change notification settings - Fork 0
Ranadip271191/weatherVeriation
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Scenario : Create a test automation solution that compares weather information from web & API sources Source 1 : The website https://www.ndtv.com/. Source 2 : The public weather API by https://openweathermap.org/ Phase 1 1. Use any UI automation tool to automate https://www.ndtv.com/ 2. Reach the weather section of the website 3. Use the `Pin your city` section on the left of the screen to search & select any given city 4. Validate that the corresponding city is available on the map with temperature information 5. Validate that selecting any city on the map reveals the weather details Phase 2 1. Use the APIs listed here (https://openweathermap.org/current) for getting current weather data for any city NOTE: the value as API key in the request : “7fe67bf08c80ded756e598d6f8fedaea” 2. Trigger the REST API (identified in step 1 above) to retrieve weather information using any Rest client Phase 3 1. Implement a comparator logic that matches the temperature information from the UI in phase 1 against the API response in phase 2 (ensure that comparison is done using same temperature unit) 2. Use a configurable data file to hold magnitude of variation between UI & API response values and the test shall return a success if temperature difference is within a specified range, else return a user defined exception while marking the test as failed Workflow : 1. Visit ndtv website’s weather page and search for Bangalore 2. Make necessary validations on the UI 3. Store weather object 1 w.r.t this Bangalore (e.g. temp value as 33 degree celsius) 4. Get response from the weather API for Bangalore 5. Make necessary validations on the API response 6. Store the API response and build the weather object 2 7. Specify the magnitude of allowed variation - for e.g. 2 for temperature - which means that temperature difference between API and UI layer should not be more than 2(in the the same unit of measurement) 8. Compare weather objects 1 and 2 along with the variance and mark tests as pass or fail based on comparator response Technology used : Programming Languange : Java UI automation tool : Selenium API automation tool : Rest Assured Unit testing framework : Junit Framework : BDD framework with cucumber System Requirement : JDK 1.8 and above, Maven, Chrome Browser version 87 How to start the Execution : 1. For windows os, execute the "run.bat" file to start the execution. 2. From any IDE, execute "TestRunner.java" file to start the execution Execution flow : from feature file 1. @GetWeatherFromAPI will be executed and it will update API data in results.properties and testData.xlsx file 2. @GetWeatherFromNDTV will be executed then and it will update UI data in results.properties and testData.xlsx file 3. @CompareVariation will be executed then and fetch both UI and API data from results.properties file and compare the veriation of 2. Results : 1. After the execution, Results will be placed on "cucumber-html-reports" folder. 2. Open the "overview-features.html" on browser. 3. "testData.xlsx" will have all results of both API and UI 4. "CompareVeriation.java" file will do the comparison between UI and API results
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published