Skip to content

Notes from a training conducted to go through test automation (UI and API) using javascript frameworks. It covers (Selenium, webdriver, nightwatch, nightwatch, mocha, supertest, selenium grid, azure pipeline, etc)

Notifications You must be signed in to change notification settings

jawadkc/Test-Automation-Training-Program

Repository files navigation

Test Automation Training Program

Lecture 1

We tried to explore and understand a bit of Selenium projects and related tools:

Lecture 2

We tried to explore and understand some basics of javascript to get started

Lecture 3

We tried to setup and run some basic nightwatch tests

Sample Project is available here

Lecture 4

We tried to understand a bit more about Nightwatch and explore how to use it more efficiently

Sample Project is available here

Assignment

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

Lecture 5

We tried to develop further understanding of nightwatch and some framework improvements by re-doing and discussing the solution for above assignment

Lecture 6

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';

Lecture 7

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'
}

Lecture 8

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.

Lecture 9

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

Lecture 10

We continued with some discussion on dockers and containers and we setup our project to run in containerized mode

Sample project is available here

Lecture 11

We revisited some concepts and the set up azure pipeline

Then we started creating a project for our code and added pipeline

Sample project is available here

Lecture 12

Setup Grid

https://github.com/SeleniumHQ/docker-selenium#selenium-grid-hub-and-nodes

A couple of options:

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

Success Factors:

  • 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

Career Growth:

  • 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 ;).

Reach out to me at

[email protected] +92 321 4189015 Keep an eye on this project and feel free to share any feedback.

About

Notes from a training conducted to go through test automation (UI and API) using javascript frameworks. It covers (Selenium, webdriver, nightwatch, nightwatch, mocha, supertest, selenium grid, azure pipeline, etc)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published