DEV Community

Discussion on: How you can help Angular in 2020

layzee profile image
Lars Gyrup Brink Nielsen Author

Thanks for discussing, everyone. Just wanted to make you all aware that there are plenty of options for end-to-end testing:

Thread Thread
jwp profile image
John Peters • Edited

I was wanting to look into Puppeteer a while back, today I found this on their site:

How to intercept an HTTP request in Puppeteer

const puppeteer = require('puppeteer');

(async () => {
  const browser = await puppeteer.launch();
  const page = await browser.newPage();
  await page.setRequestInterception(true);
  page.on('request', interceptedRequest => {
    if (interceptedRequest.url().endsWith('.png') || interceptedRequest.url().endsWith('.jpg'))
      interceptedRequest.abort();
    else
      interceptedRequest.continue();
  });
  await page.goto('https://example.com');

  await browser.close();
})();
Enter fullscreen mode Exit fullscreen mode

They too can intercept inbound and outbound requests ✔️
I don't know yet if the data can be changed, but the workflow can be altered.