You will walk away from this workshop being able to do all of these things by yourself.
- 01. Know the best practices for testing applications
Testing applications requires an understanding of the tools and strategies, and the effectiveness of each. You'll know what to test, and where to put your testing efforts, before writing your first test.
- 02. Using the SIFERS pattern
The setup required for tests starts simple and small, but grows in complexity over time, leading to code that is difficult to understand and maintain. Using the Simple Injectable Functions Explicitly Returning State (SIFERS) pattern reduces the mental overhead of determining the correct state and environment for a test to run within, reduces leaks between tests, and removes the need for before blocks in your tests.
- 03. Start writing tests with Cyress
You'll be able to install and configure Cypress to get started on writing your firsts end-to-end tests.
- 04. Use best practices for querying elements in the DOM
During the arrangement of your tests you'll need to query and get access to elements in the DOM. You'll know the best practices for ensuring the maintainability of finding elements and using chaining commands.
- 05. User-like interactions
The goal of end-to-end tests is to validate your application works as expected as if a user was using the application themselves. You'll have the skills to mimic user interactions with elements to have confidence when shipping your application.
- 06. Effective and explicit assertions
Writing good end-to-end tests requires an understanding of assertions. You'll know how Cypress performs default asserts, how to use chai-based assertions, chain assertions, and perform explicit assertions.
- 07. All commands yield a subject
It's important to know that all commands in Cypress yield a subject, and it's equally important to understand what a subject is, and how you can leverage subjects when writing tests.
- 08. Write a full suite of tests
You'll be able to write a full suite of tests for an application to give you hands-on real-world experience using Cypress.
- 09. Use variables and aliases for efficiency
Cypress provides mechanisms for you to write more efficient and maintainable tests. You'll know how to create and access aliases in your tests.
- 10. Setting up Fixtures
It's important that most of our tests do not rely on external sources. This would create a dependency for the success of our tests and place a burden on the execution of our tests. You'll learn how to create fixtures to separate the concerns of displaying data and fetching data when testing your application.
Pricing
Transparent and simple pricing to skill up your team.
Day One
- End-to-end testing best practices
- Mocking APIs
- Writing SIFERS
- Focusing on the happy path
- Quantity vs quality and the testing pyramid
- Getting Started with Cypress
- Installing Cypress
- Launching the test runner
- Using
cy.visit()
- Writing your first test
- Finding Elements
- It's just jQuery (but better)
- Use
get()
to find elements - Use
contains()
to find by text - Chaining commands
- Best practices
- Interactions
- Use
type()
to type into an input - Use
click()
to click an element - Use
clear()
to clear an input - Using
check()
anduncheck()
with checkboxes - Use
select()
to select an option
- Use
- Assertions
- Default assertions
- Chai-based assertions using
should()
- Chaining implicit assertions using
and()
- Explicit assertions
- Subjects and Promises
- Commands yield a subject
- Use of
.then()
for asynchronous code
- Timeouts
- Timeouts for default assertions
- Modifying timeouts
- Using
cy.wait()
- Variables and Aliases
- Asserting mutable values
- Create alias using
as()
command - Access alias via
this
scope - Access alias via
get(@)
- Fixtures
- Creating a fixture with
cy.fixture()
- Using fixtures to bootstrap data
- Creating a fixture with
- Capstone Test
Prereqs
Attendees should be familiar with the following technologies:
- JavaScript
Can't find the topic you are looking for? Contact Us to learn about our custom training solutions.