Tagged: testing

Testing Ionic

Dealing with Timing Issues in Ionic E2E Tests

When creating End-to-End (E2E) tests, we are basically programming the browser to behave like a human. We tell the browser what pages to go to, what input to send, what buttons to click, and so on. In a typical E2E test, we will send multiple commands to the browser. We might tell it to click […]

Testing Ionic

The Role of End-To-End (E2E) Tests in Ionic

End-To-End (E2E) testing involves creating automated tests that will test your application as a whole, rather than testing individual chunks of code in isolation (which is the purpose of a unit test). In this video tutorial, I walk through a real-world application that has some e2e tests implemented and discuss the purpose and value of […]

Testing Ionic

The Role of Unit Tests in Ionic

Unit testing is an intimidating task to get started with, and with no prior knowledge of creating automated tests, it can be hard to understand the how and why of unit testing. In this video, I walk through some unit tests I have set up for a real-world application I am working on, and we […]

Testing Ionic

Setting Up Unit and E2E Tests in Ionic

I’ve written many tutorials on adding automated tests to Ionic applications, but one of the trickiest parts of the whole process is just getting the testing environment configured. If you want to set up unit and end-to-end tests you will need to install Jasmine, Karma, Protractor, and an array of other packages that need to […]

Unit Testing in Ionic

Testing Asynchronous Code with FakeAsync in Angular

When creating automated unit tests in Ionic and Angular applications we would typically follow a process like this: Set up the testing environment Run some code Make assertions as to what should have happened This process is also commonly referred to as AAA (Arrange, Act, Assert). I don’t plan to provide an introduction to unit […]

Testing in Ionic 2

E2E (End-to-End) Testing in Ionic 2: An Introduction

Over the past few weeks, I have been releasing a series of tutorials on creating automated tests for Ionic 2 applications. The tutorials so far have focused on how to apply the Test Driven Development (TDD) methodology to unit test an Ionic 2 application. If the concept of automated tests is new to you, or […]

Testing in Ionic 2

Test Driven Development in Ionic 2: Services and Templates

Throughout this tutorial series, we have been learning various methods for unit testing Ionic 2 applications and using a Test Driven Development approach to building an application. In the previous tutorials we have covered: How to set up unit testing in an Ionic 2 application What Test Driven Development (TDD) and Behaviour Driven Development (BDD) […]

Testing in Ionic 2

Test Driven Development in Ionic 2: Navigation and Spies

In the previous tutorial in this series, we covered the concept of mocks and creating a fake backend that we could make HTTP requests to. The general idea is that we want to isolate the thing we are testing, we don’t want external dependencies complicating our unit tests. We have been taking a Test Driven […]

Testing in Ionic 2

Test Driven Development in Ionic 2: Http and Mocks

In the previous tutorial in this series, we introduced the concept of Test Driven Development and how those concepts can be applied to Ionic 2 development. I won’t be introducing the concepts again here, but in short: Test Driven Development, or TDD, is a method of development that involves writing tests before writing your application […]

Testing in Ionic 2

Test Driven Development in Ionic 2: An Introduction to TDD

The concept of creating automated tests for your application allows you to improve the quality of your code, protect against regressions when making updates, and speed up the testing and debugging process. There are many different types of tests you can add to your applications, including: Unit tests which test small isolated chunks of code […]

Testing in Ionic 2

Introduction to Testing Ionic 2 Applications with TestBed

Creating automated tests for your application is a great way to improve the quality of your code, protect against code breaking regressions when implementing new features, and speed up testing and debugging. In a Javascript environment, the Jasmine framework is typically used for writing tests and Karma is used to run them. This is still […]

Unit Testing in Ionic

How to Unit Test an Ionic 2 Application

Everybody (hopefully) tests their applications in some manner before submitting them to the app stores, and for a lot of people, this will include playing around with the app and trying it on different devices. That alone is a poor and inefficient testing process, however. Unit testing, on the other hand, is a very efficient […]