What if you want to test an implementation that needs to interact with the browser? With a normal unit test, as in the previous chapter, this is not possible.
- View Offline
- [Instructor] Welcome to the video on Browser Tests.…In the previous video, we looked at how to write a test,…so that we can test our codes.…In this video, we're going to take a look…at how to write a test that involves browser features,…then, we would run the HTML page,…and then execute our tests in the browser.…We can run our tests in different environments,…Virtual Machine, Chrome, Dartium,…Content Shell, and so on.…
First of all, we need to set up our test.…We need two files for this, a test_harness.dart,…and a test_harness.html.…It is important that you have a link tag…with the address of our Dart file,…that contains all the tests we want to run.…It is also important to have a script tag,…with the inclusion of the test package into it.…For this video, we have a very basic test.…You can extend this test,…and experiment with it if you want,…but for now, this is good.…
If you want to run this test,…we can right-click on the .dart file,…and click on the Pub Run.…Here, we need to choose our test file.…With the -p parameter, you can select the platform…
Dart is a new open-source programming language for the web. It is a single language for both client and server that can be used to build large-scale web, server, and mobile applications. Stop solving new challenges with the same old tools—let Dart show you a whole new way! In this course, author Joris Hermans guides you into the wonderful world of web development with the dartlang programming language. By following along, you get a more mature sense of how to build a great application and see all the facets needed to reach that goal.
Learn the important language features of Dart, along with some advanced features such as mixins and null-aware operators. Later on, see how to use unit tests, work with browser APIs, and set up of a web server. Finally, take a look at Angular 2, a great front-end framework also built by Google.
This course provides you with everything you need to know to start or enhance your career in web development with Dart.
- Installing Dart
- Creating a basic web application with Dart
- Creating DOM interactions
- Creating classes and objects
- Implementing a library
- Using parameters, null-aware operators, and mixins
- Testing your code
- Setting up APIs
- Using Dart localStorage
- Working with AngularJS
- Troubleshooting Dart applications