codeceptjs / codeceptjs/CodeceptJS

I.seeTraffic on post data traffic unexpectedly passes

Đang mở
#3,920 6 bình luận 0 reaction 0 người được giao Xem trên GitHub
stale
Ngôn ngữ chính
JavaScript
Star
4.2k
Fork
757
Merge trung bình
2 ngày 9 giờ
Pull request đã merge (30 ngày)
16

Mô tả

#### 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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.