Introducing Puppeteer Schematics: Test Your Angular Apps with Ease

Nikolay Vitkov from the Puppeteer Team co-authored this blog post.Puppeteer, a powerful tool for automating browser interactions, is now even easier to integrate with your Angular projects thanks to the newly released @puppeteer/ng-schematics package.T…


This content originally appeared on Angular Blog - Medium and was authored by Jecelyn Yeen

Nikolay Vitkov from the Puppeteer Team co-authored this blog post.

Introducing Puppeteer Angular Schematics

Puppeteer, a powerful tool for automating browser interactions, is now even easier to integrate with your Angular projects thanks to the newly released @puppeteer/ng-schematics package.

This package provides an out-of-the-box experience for setting up and running Puppeteer tests, minimizing the configuration burden and accelerating your automation journey — especially creating end-to-end tests!

Quick setup for new project

For new projects, integrating Puppeteer is a breeze. Run ng e2e and choose the Puppeteer option. It automatically configures your project for basic testing. This includes setting up a simple test that verifies your project name on the homepage.

Console window displaying the results of “ng e2e” command, including the new Puppeteer option.

Once you set up the above, running again will execute the tests.

Integrate with your existing project

If your project already utilizes ng e2e with another library like Protractor, fear not! You can still integrate Puppeteer with the following command:

ng add @puppeteer/ng-schematics

This command preserves your existing ng e2e configuration while installing Puppeteer separately. You can then run your Puppeteer tests with npm run puppeteer.

Create a test and customize configuration

Here are two more helpful commands in @puppeteer/ng-schematics to speed up your workflow.

  • Setting up a new Puppeteer test:
ng generate @puppeteer/ng-schematics:e2e <NewTest>
ng generate @puppeteer/ng-schematics:config

Migrating from Protractor

Transitioning from Protractor to Puppeteer for your Angular testing is made easier with our guide on porting existing tests. You can find the detailed steps and considerations in our guide.

Sneak peek: Cross-browser automation with Firefox

The latest release of Puppeteer v21.6.0 brings exciting news. With experimental WebDriver BiDi support, you’ll be able to leverage Puppeteer’s power for cross-browser automation in Chrome, as well as Firefox!

If you haven’t heard about WebDriver BiDi yet, it is a new standard browser automation protocol that comes with lower level control by design, and supports speedy, bi-directional communication.

Resources


Introducing Puppeteer Schematics: Test Your Angular Apps with Ease was originally published in Angular Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.


This content originally appeared on Angular Blog - Medium and was authored by Jecelyn Yeen


Print Share Comment Cite Upload Translate Updates
APA

Jecelyn Yeen | Sciencx (2023-12-20T17:42:46+00:00) Introducing Puppeteer Schematics: Test Your Angular Apps with Ease. Retrieved from https://www.scien.cx/2023/12/20/introducing-puppeteer-schematics-test-your-angular-apps-with-ease/

MLA
" » Introducing Puppeteer Schematics: Test Your Angular Apps with Ease." Jecelyn Yeen | Sciencx - Wednesday December 20, 2023, https://www.scien.cx/2023/12/20/introducing-puppeteer-schematics-test-your-angular-apps-with-ease/
HARVARD
Jecelyn Yeen | Sciencx Wednesday December 20, 2023 » Introducing Puppeteer Schematics: Test Your Angular Apps with Ease., viewed ,<https://www.scien.cx/2023/12/20/introducing-puppeteer-schematics-test-your-angular-apps-with-ease/>
VANCOUVER
Jecelyn Yeen | Sciencx - » Introducing Puppeteer Schematics: Test Your Angular Apps with Ease. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2023/12/20/introducing-puppeteer-schematics-test-your-angular-apps-with-ease/
CHICAGO
" » Introducing Puppeteer Schematics: Test Your Angular Apps with Ease." Jecelyn Yeen | Sciencx - Accessed . https://www.scien.cx/2023/12/20/introducing-puppeteer-schematics-test-your-angular-apps-with-ease/
IEEE
" » Introducing Puppeteer Schematics: Test Your Angular Apps with Ease." Jecelyn Yeen | Sciencx [Online]. Available: https://www.scien.cx/2023/12/20/introducing-puppeteer-schematics-test-your-angular-apps-with-ease/. [Accessed: ]
rf:citation
» Introducing Puppeteer Schematics: Test Your Angular Apps with Ease | Jecelyn Yeen | Sciencx | https://www.scien.cx/2023/12/20/introducing-puppeteer-schematics-test-your-angular-apps-with-ease/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.