codeceptjs / codeceptjs/CodeceptJS

webdriverio, window.fetch and basic Auth receive: Request cannot be constructed from a URL that includes credentials

Đang mở
#2,733 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
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?

I have a Basic Auth web page that contains a web form where user log in in our platform.

Setting the `basicAuth` WebDriver' attribute, The basic Auth works fine,
but when we try to click the "Login button" of our web page, I receive:
`Request cannot be constructed from a URL that includes credentials web driver`

This because the button click trigger a window.fetch call and the url contains the basic authentication.

#### What do you get instead?

Is there a method to force the set of the `Authentication header` instead of append credential into the url?

### Details

* CodeceptJS version: 3.0.2
* NodeJS Version: v14.4.0
* Operating System: Mac OS
* webdriverio
* Configuration file:

```js

exports.config = {
tests: './e2e/**/*.spec.js',
output: './e2e/output',
helpers: {
WebDriver: {
browser: 'chrome',
host: '127.0.0.1',
port: 4444,
restart: false,
windowSize: '1920x1680',
basicAuth: env.basicAuth,
url: env.baseURL,
show: !headless,
ignoreHTTPSErrors: true,
emulate,
fullPageScreenshots: true,
chromium: {
args: [
'--ignore-certificate-errors',
'--no-sandbox',
'--disable-setuid-sandbox',
],
},
},
},
include: {
I: './e2e/steps_file.js',
},
bootstrap: null,
mocha: {},
name: 'login page',
plugins: {
wdio: {
enabled: true,
services: ['selenium-standalone'],
},
autoLogin: autologin,
retryFailedStep: {
enabled: true,
},
screenshotOnFail: {
enabled: true,
},
},
multiple: {
basic: {
browsers,
},
},
};

```

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.