Skip to main content
Version: 1.1.0

Installation

This guide will walk you through installing and setting up Playwright-SAP for your project.

Installation Methods​

You can install Playwright-SAP using your preferred JavaScript package manager. The installation process will either initialize a new project or add Playwright-SAP to your existing project.

npm init playwright-sap@latest

Installation Options​

During installation, you'll be prompted to configure your project with the following options:

OptionDescriptionDefault
LanguageChoose between TypeScript or JavaScriptTypeScript
Tests FolderDirectory where test files will be storedtests (or e2e if tests already exists)
GitHub ActionsAdd workflow for CI integrationYes
Install BrowsersDownload browsers required for testingYes

Understanding Package Aliasing​

Playwright-SAP uses a technique called package aliasing to seamlessly integrate with the standard Playwright API. This means:

  1. You'll import from @playwright/test in your code (the standard Playwright import)
  2. Behind the scenes, npm redirects this to the Playwright-SAP package
  3. This allows Playwright-SAP to extend Playwright without changing your imports

Your package.json will contain an entry like this:

package.json
"devDependencies": {
"@playwright/test": "npm:@playwright-sap/test@^1.0.2",
"@types/node": "^24.2.0"
}

The npm:@playwright-sap/test@^1.0.2 syntax tells npm to use the @playwright-sap/test package whenever code imports from @playwright/test.

Read more about package aliasing

Getting Help​

If you encounter issues during installation:

  1. Check the FAQs for common problems and solutions
  2. Open an issue on GitHub

Next Steps​

After installation, you're ready to:

  1. Configure automatic SAP login for your tests
  2. Learn about specialized SAP locators
  3. Create your first test script