Home / Companies / Cypress / Blog / Post Details
Content Deep Dive

Control an AngularJS Application From E2E Tests

Blog post from Cypress

Post Details
Company
Date Published
Author
Gleb Bahmutov
Word Count
1,093
Company Posts That Month
4
Language
English
Hacker News Points
-
Post removed?
No
Summary

In his blog post, Gleb Bahmutov explores techniques for controlling an AngularJS application directly from end-to-end (E2E) tests using Cypress. The post explains how Cypress's close proximity to the application allows developers to manipulate application code directly, bypassing the Document Object Model (DOM). Bahmutov demonstrates how to modify an application's data model from the DevTools console and how to access AngularJS instances within the Cypress Test Runner. He provides examples of setting properties on an AngularJS scope object, triggering updates with the digest cycle, and using helper functions to interact with elements and their scopes. The post also discusses the complexity of directly manipulating application internals, such as localStorage, and the potential risks of tightly coupling tests to implementation details. Bahmutov concludes by advising developers to carefully consider the trade-offs of such direct access in E2E testing.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.