IDE - Visual Studio Code
Pre-requisites -
- Download Node Js in Local Machine
- Download Visual Studio Code
How to Setup Framework -
- Pull the framework from github via Visual Studio Code
- Open new Terminal
- run cmd - 'npm init' (To create package.json file)
- run cmd - 'npm install --save-dev [email protected]' (To install cypress)
- run cmd - 'npm install -g [email protected]' (to install latest version of npm)
How To Run - Via - Cypress Test Runner
- run cmd - './node_modules/.bin/cypress open'
- The above command will open the cypress test runner
- Select the browser type from dropbox located at the top right hand corner (Selector Electron Browser since it runs faster)
- You should see "search-for_cars.js" file in the test runner
- Click on the file to start runner the test
- test execution starts in a seperate runner window
Via - Terminal
- Open Terminal
- run command - './node_modules/.bim/cypress run' (This will tigger your entire test suite in headless mode)
- run command - './node_modules/.bin/cypress run --headed (This will tigger your entire test suite in headed mode)
Autotrader Search Testing Optimisation and Expansion Ideas -
Test Optimisation -
- Use of Alias to make code more readable
- Use of Data Tables inorder to pass different filters rather than hardcoded as in this example
- Use of better reporting tools like Mochawesome Reporting
- Use of CI Tools likes of Jenkins
- Resuability of Code by using beforeEach()
Test Expansion -
- Use Page Object Models to improve Framework
- Negative Testing for all Webelements
- Use Boundary Values analysis to apply filters
- Robost selectors (css, xpath) in case of change in webelements
Challenges and Issues Encountered - Challenges -
- Selectors for WebElements
- Implementation of Cypress (since I havent used it before)
Issues -
- same values and texts for multiple tags in on WebElement