codeceptjs / codeceptjs/CodeceptJS

I.seeTraffic on post data traffic unexpectedly passes

Open
#3,920 6 comments 0 reactions 0 assignees View on GitHub
stale
Dominant language
JavaScript
Stars
4.2k
Forks
757
Avg merge
2d 9h
Merged PRs (30d)
16

Description

#### What are you trying to achieve?
Test a POST request with `I.seeTraffic` (Playwright Helper) with an intentional fail.

For example at https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST
the existing POST request to https://developer.mozilla.org/pong/get with payload
```
{
keywords: [],
pongs: ["top", "side"
}
```

I use this test code:
```
Scenario('DEMO', async ({I}) => {
I.amOnPage('https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST');
await I.seeTraffic({
url: 'https://developer.mozilla.org/pong/get',
name: 'POST Test',
timeout: 3,
requestPostData: {
keywords: [],
pongs: ["side", "top"],
doesNotExist: true
}
})
})
```

#### What do you get instead?

Test passes unexpectedly.

### Details

* CodeceptJS version: 3.5.6
* NodeJS Version: 20.6.1
* Operating System: MacOS latest version
* Playwright: 1.38.1

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.