Fixture.httpAuth Method

Specifies the credentials for HTTP Basic and Windows (NTLM) authentication.

fixture.httpAuth(credentials) → this
Parameter Type Description
credentials Object Contains credentials used for authentication.

The credentials parameter has the following properties.

Parameter Type Description
username String The user name for the account.
password String The password for the account.
domain (optional) String The domain name.
workstation (optional) String The workstation's ID in the local network.

The credentials parameter requires username and password. For NTLM authentication, the server may require additional information, such as the workstation ID and the domain name.

TestCafe uses credentials specified with fixture.httpAuth for all requests that require authentication within the fixture. To specify credentials to be used in individual tests, use the test.httpAuth method.