Overview
The article discusses the implementation of live testing using the Play Framework and Ember.js at LinkedIn. It highlights the benefits of using Ember.js for end-to-end testing, the challenges faced during implementation, and the strategies employed to overcome these hurdles.
What You'll Learn
1
How to implement live testing for Ember.js applications
2
Why using Ember.js improves end-to-end testing efficiency
3
When to use promise-based actions in Ember.js for testing
Prerequisites & Requirements
- Basic understanding of Ember.js and its testing framework
- Familiarity with Play Framework and Casper.js(optional)
Key Questions Answered
What are the benefits of using Ember.js for live testing?
Ember.js provides promise-based actions that ensure tests execute only after rendering is complete, reducing flakiness in tests. This approach allows developers to write tests using familiar syntax, improving efficiency and consistency in testing processes.
How does LinkedIn implement live testing with Ember.js?
LinkedIn implements live testing by serving tests alongside the Ember application in production builds. This involves packaging test assets with the application and restricting access to tests, ensuring they are only executable during LinkedIn test execution runs.
What challenges are faced when enabling live testing in Ember?
Challenges include ensuring tests are not served to production users, making tests available as part of the build, and restricting execution to LinkedIn's test runs. These hurdles require careful management of the build process and server configurations.
Technologies & Tools
Frontend
Ember.js
Used for developing web applications and conducting live testing.
Backend
Play Framework
Serves the Ember application and manages test execution.
Testing
Casper.js
Used to automate the testing process and report results.
Key Actionable Insights
1Leverage Ember.js's promise-based actions to enhance the reliability of your tests.Using promise-based actions ensures that tests only run after all rendering is complete, minimizing flakiness and improving test accuracy.
2Integrate your testing framework within your deployment pipeline.By packaging tests with your application, you can ensure that testing occurs in the same environment as production, leading to more accurate results.
3Limit access to testing routes to prevent exposure to end users.Restricting test routes ensures that tests are only executed in controlled environments, protecting the integrity of your production application.
Common Pitfalls
1
Serving tests to production users can lead to security risks and performance issues.
To avoid this, ensure that tests are only accessible in controlled environments and implement proper routing restrictions.
2
Failing to include necessary test assets in the production build can result in incomplete testing.
It's crucial to manage the build process to ensure all required test files are included without bloating the production package.
Related Concepts
End-to-end Testing Methodologies
Integration Of Testing Frameworks In CI/CD Pipelines
Best Practices For Managing Test Assets In Production