We tried to explore and understand a bit of Selenium projects and related tools:
- Why we should learn it
- Quick Notes about selenium projects
- Quick references for selenium IDE
- Explore w3c WebDrirver standard
- Exploring Webdriver endpoints with Chromedriver
We tried to explore and understand some basics of javascript to get started
We tried to setup and run some basic nightwatch tests
- First Nightwatch Test
- Setup Project
- Setup nightwatch config
- Add a test and run it
- Update the test to use page objects
Sample Project is available here
We tried to understand a bit more about Nightwatch and explore how to use it more efficiently
- Setup global launch URL
- Explore how to switch between xpath and css selector in Nightwatch
- Explore page object sections in Nightwatch
- Chaining of commands in nightwatch
- Explore this object in scope of Nightwatch
- Understand different assertions
- Understand different assertions
- Explore callbacks in Nightwatch api
- Explore ES6 async await from the perspective of Nightwatch commands
- Divide test in steps
- Make use of hooks in test files
Sample Project is available here
A small automation needs to be be done. The details of task are available at Assignment > Readme.md
A possible workable solution is available here
We tried to develop further understanding of nightwatch and some framework improvements by re-doing and discussing the solution for above assignment
- Handling multiple related projects
- Tags
- Disabling Tests
- Explore retries and cli Commands
- Explore element Index
- More Dynamic selectors in page objects
- useXpath and useCss
- Explore Page Props
- Test Data
- External globals
- Read and Use of value in subsequent steps
We tried to setup mocha, chai and supertest for some api testing
Sample Project is available here
The notes will be uploaded later
Note: To run the tests make sure you update, api_key
, server_token
and userId
the data.js
in utils
folder.
let api = {
base_url: "https://api.trello.com/1",
api_key: "your api key",
server_token: "your server token"
}
and
var userId = 'your user id';
We tried to mix our ui tests with api tests
Sample Project is available here
The notes will be uploaded later
Note: To run the tests make sure you update, email
, password
, api_key
, server_token
and userId
the data.js
in util
folder.
let api = {
base_url: "https://api.trello.com/1",
api_key: "your api key",
server_token: "your server token"
}
and
const userData = {
email: 'your email address',
password: 'your password',
userId:'your user id'
}
We explored a few other frameworks that can be alternates of frameworks and components discussed so far like
- Nightwatch api: A wrapper over Nightwatch to allow for more flexible framework structure
- Codecpet JS and Web Driver IO: A couple of frameworks that work quite similar to Nightwatch js
- Jest: An alternative of Mocha
- Cypress: A framework that does not use webdrivers and apply in-browser testing approach
We also discussed a few points towards framework selection as mentioned here.
We explored a bit about puppeteer
- Puppeteer: A nodejs library to give a high-level api to control chrome/chromium
Then we started our discussion towards CI/CD pipelines. For that we started of with a few basic discussions
We continued with some discussion on dockers and containers and we setup our project to run in containerized mode
- Docker Installation
- Exploring Dockers and containers
- Containerization of our project
- Updated the project files
- Create Dockerfile
- Create docker-compose files
- Run tests
Sample project is available here
We revisited some concepts and the set up azure pipeline
Then we started creating a project for our code and added pipeline
- Create project and push your code
- Add azure pipeline yaml file
- Add azure pipeline yaml file
- Other required changes
- Run and observer
Sample project is available here
https://github.com/SeleniumHQ/docker-selenium#selenium-grid-hub-and-nodes
A couple of options:
- Directly using Docker
- Using docker-compose
- Using docker-compose with swarn support
- Using kubernetes
- Using Helm charts
Using Docker swarm:
docker build -t workflows:latest .
docker swarm init
docker stack deploy -c docker-compose-grid.yml grid
docker service ls
docker service logs -f grid_workflows
docker stack rm grid
docker swarm leave -f
- Clear identification of purpose and goals of Automation
- Identification of current team as well as potential new highers
- Improving test-ability and automate-ability of system-under-test
- Taking all stack holders on board
- For any new automation project / New change focus on some key but easy test scenario for creating a POC
- Test Scenarios to be automated should come from QA team
- Manual Testing team should be aware of whats covered by automation
- Dev team should continuously be made aware of the changes made by them that broke the workflows and if possible they should be responsible of fixing those before deploying to any test/staging environments.
- Test suites should be executable on different environments so that their utilization scope can be increased.
- Test suite performance should be considered such that once should be able to get results as early as possible. This can help in increased utilization and invovlment from all team members
- The code should be made moduler but just enough that it does not require testing of its own
- Frequently change data set for the tests
- Test could should follow proper coding guidelines (i.e. eslint rules should be setup for your tests)
- Test files should be properly commented (preferably following a standard like jsdocs to auto generate documentation using it)
- A few KPIs to measure
- What are the typical false positives and how they can be mitigated
- Monitor the life of a test. i.e. Time between any update required. Frequency of updates required for a test. Time duration in which the test remains out-of-date and disabled
- Test run performance and how new tests effect the performance
- Ability of a test to be executed against different environments
- Life cycle of test data
- Continuous learning is the key
- Always start with minimal and learn as you go
- Explore different open source projects to learn how others are doing it
- Join different slack channels, chats, follow different repositories
- Learn under the hood stuff to be able to make more better decisions
- Sharing knowledge will always increase yours too so never hesitate. Infact, forcefully make your self to share. I do not say always do it for free ;).
jawad.k.cheema@gmail.com +92 321 4189015 Keep an eye on this project and feel free to share any feedback.