Skip to content

Commit

Permalink
fix: playwright test
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Jul 31, 2023
1 parent a8443e6 commit e8b7333
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions test/helper/Playwright_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -876,16 +876,27 @@ describe('Playwright', function () {
});

it('should check traffics with more advanced params', async () => {
I.amOnPage('https://openai.com/blog/chatgpt');
await I.startRecordingTraffic();
await I.seeTraffic({
name: 'sentry event',
url: 'https://images.openai.com/blob/cf717bdb-0c8c-428a-b82b-3c3add87a600',
parameters: {
width: '1919',
height: '1138',
},
});
await I.amOnPage('https://openai.com/blog/chatgpt');
const traffics = await I.grabRecordedNetworkTraffics();

for (const traffic of traffics) {
if (traffic.url.includes('&width=')) {
// new URL object
const currentUrl = new URL(traffic.url);

// get access to URLSearchParams object
const searchParams = currentUrl.searchParams;

await I.seeTraffic({
name: 'sentry event',
url: currentUrl.origin + currentUrl.pathname,
parameters: searchParams,
});

break;
}
}
});

it('should check traffics with more advanced post data', async () => {
Expand Down

0 comments on commit e8b7333

Please sign in to comment.