Skip to content

feat(puppeteer): network traffics manipulation - #4263

Merged
kobenguyent merged 7 commits into
3.xfrom
feat-grab-network-traffics-ppt
Mar 23, 2024
Merged

feat(puppeteer): network traffics manipulation#4263
kobenguyent merged 7 commits into
3.xfrom
feat-grab-network-traffics-ppt

Conversation

@kobenguyent

Copy link
Copy Markdown
Collaborator

Motivation/Description of the PR

🛩️ Features

  • [Puppeteer] Added commands to check network traffics
    • startRecordingTraffic
    • grabRecordedNetworkTraffics
    • flushNetworkTraffics
    • stopRecordingTraffic
    • seeTraffic
    • dontSeeTraffic

Examples:

// recording traffics and verify the trafficI.startRecordingTraffic();I.amOnPage('https://codecept.io/');I.seeTraffic({name: 'traffics',url: 'https://codecept.io/img/companies/BC_LogoScreen_C.jpg'});
// check the traffic with advanced paramsI.amOnPage('https://openai.com/blog/chatgpt');I.startRecordingTraffic();I.seeTraffic({name: 'sentry event',url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',parameters: {width: '1919',height: '1138',},});

Applicable helpers:

  • Playwright
  • WebDriver
  • Puppeteer

Type of change

  • 📋 Documentation changes/updates
  • 🔨 Markdown files fix - not related to source code

Checklist:

  • Tests have been added
  • Documentation has been added (Run npm run docs)
  • Lint checking (Run npm run lint)
  • Local tests are passed (Run npm test)

@DavertMikDavertMik left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no plural for traffic and share

so better to rename "networkTraffics" => network

"shares" => "share"

but maybe we don't need this share?
it is already shared

@@ -0,0 +1,123 @@
const assert = require('assert');
const { isInTraffic, createAdvancedTestResults, getTrafficDump } = require('../utils');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need shares folder for that?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are the same pieces of code that appeared in 3 helpers. So I wanna move them to a shared folder which is better than copy/paste the same code in 3 helpers.

@kobenguyent
kobenguyent merged commit c44ce74 into 3.xMar 23, 2024
@kobenguyent
kobenguyent deleted the feat-grab-network-traffics-ppt branch March 23, 2024 06:37
@kobenguyentkobenguyent mentioned this pull request Apr 2, 2024
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@kobenguyent@DavertMik