Skip to content
Discussion options

You must be logged in to vote

If you're using Serenity/JS with Playwright Test, using the httpCredentials option is the easiest way to provide the credentials needed to authenticate the request.

Using the Playwright Test config file

You can configure httpCredentials in your Playwright Test config file:

import { defineConfig } from '@playwright/test'
import { SerenityFixtures, SerenityWorkerFixtures } from '@serenity-js/playwright-test'

/**
 * See https://playwright.dev/docs/test-configuration.
 */
export default defineConfig<SerenityFixtures, SerenityWorkerFixtures>({
  use: {
    httpCredentials: {
      username: 'user', // or read the value from process.env
      password: 'pass',
    },
  },
})

Using this approac…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jan-molak
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@serenity-js/playwright @serenity-js/playwright-test Serenity/JS reporter and test APIs for Playwright Test
2 participants
Converted from issue

This discussion was converted from issue #3127 on January 02, 2026 08:53.