+1
CodEngine
LEVEL UP YOUR CRAFT
Home
About
Lessons
Features
Contact
Login
Menu
Home
/
Learning Tracks
/
JavaScript
JavaScript
Lesson 01 — JavaScript basics for QA automation
In this lesson, you will learn the basic parts of JavaScript: variables, numbers, strings, and simple expressions. These are the same building blocks used in Playwright tests, assertions, and API responses.
Lesson 02 — Arrays for QA automation
Arrays are used to store values in order, such as test data rows, API results, lines from a file, or related UI elements. This lesson shows how to access and update elements using indexes, how to add items with `push`, and why using `delete` for array items is usually not a good idea.
Lesson 03 — Objects for QA automation
Objects are used to model structured data like JSON request and response bodies, configuration maps, and test fixtures. This lesson covers how to create objects, read and update properties, use computed keys, and work with `Object.keys`, the `in` operator, and `delete`. It also explains the difference between objects and arrays.
Lesson 04 — Conditionals for QA automation
Conditional logic controls test flow and branching. It is used to skip tests in certain environments, separate checks based on HTTP status codes, and validate optional fields. This lesson covers comparison operators, loose vs strict equality (`==` vs `===`), logical operators (`&&`, `||`), truthy and falsy values, `else if`, `switch`, and the ternary operator. It also highlights common mistakes like missing braces and unexpected type conversion.
Lesson 05 — Loops and nested data for QA automation
Loops are used to go through lists of data such as test datasets, table rows, API responses, and grids. This lesson explains different loop types: classic for, `for...of` for iterables, `for...in` for object keys, and `while` loops with manual control. It also covers `break` and `continue`, working with nested arrays and objects, and basic patterns like filtering and accumulation.
Lesson 06 — Math and string/array helpers for QA automation
Built-in JavaScript methods are used for common test tasks like rounding numbers, finding minimum and maximum values, generating random test data, normalizing strings, splitting text into tokens, and working with arrays as simple queues or stacks. This includes methods like `Math.ceil`, `Math.floor`, `Math.min`, `Math.max`, string methods like `toLowerCase()` and `trim()`, and array operations like `push`, `pop`, `shift`, and `unshift`.
Lesson 07 — Functions for QA automation
Test code is often split into small reusable functions, such as helpers for parsing cookies, building URLs, retry logic, or reusable checks. This lesson covers function declarations, parameters, default values, return statements, function composition, and function expressions stored in `const`. It also explains how hoisting works for function declarations and not for function expressions.
Lesson 08 — Rest, spread, and destructuring
The same `...` token can **spread** values into a new array or object, collect **rest** items in a function or pattern, or **destructure** nested data into named bindings. The lesson shows shallow copies, fixture overrides, and unpacking API-shaped objects without repetitive property access.
Lesson 09 — Function styles for QA automation
In automation code, there are three common ways to write functions: `function declarations`, `function expressions stored` in const, and `arrow functions`. This lesson explains the differences in syntax, when each one is available, and how they handle `this`. It also covers concise syntax like implicit return in arrow functions.
Lesson 10 — Scope in JavaScript
Scope defines where variables can be accessed in code. JavaScript has global scope, function scope, and block scope (`{}` with `let` and `const`). Variables are resolved through a scope chain, where inner scopes can access outer ones. This lesson also covers shadowing, where inner variables override outer ones with the same name.
Lesson 11 — Object methods, `this`, constructors, and `new`
Objects can store both data and behavior. A **method** is a function stored as an object property. Inside a normal method, **`this`** refers to the object that received the call. Before modern `class` syntax, JavaScript used **constructor functions** with the **`new`** operator to create multiple similar objects (for example, test runs or API clients).
Lesson 12 — `var`, `let`, `const`, and hoisting
This lesson compares `var`, `let`, and `const` in JavaScript. `var` is function-scoped, can be redeclared, and is hoisted with an initial value of `undefined`. `let` and `const` are block-scoped and cannot be used before declaration due to the temporal dead zone. It also explains the difference between reassignment (changing a variable) and mutation (changing an object), as well as how hoisting affects variable behavior.
Lesson 13 — Async JavaScript for QA automation
JavaScript uses asynchronous programming to handle operations like network requests, timers, and file access. Promises represent values that will be available later and can be handled with `.then()` and `.catch()`. async functions always return a Promise, and `await` pauses execution until that Promise is resolved, making async code easier to read. This lesson also covers error handling with `try` / `catch` / `finally` and the basics of how the event loop schedules tasks.
Lesson 14 — OOP for QA automation
This lesson introduces object-oriented design in JavaScript using classes. It covers class definitions, constructors, methods, private fields, inheritance, composition, and aggregation. It also explains how to structure reusable components like UI drivers, API clients, and test data builders using patterns such as the Page Object Model (POM).