You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since Playwright Version 1.46 it is possible to provide a certificate to login.
It would make sense to integrate this into the login middleware.
In a minimal sample i was able to login with my SAP Passport X.509 Certificate in pfx format:
playwright.config.ts
import{defineConfig}from'@playwright/test';exportdefaultdefineConfig({use: {headless: false,// Set to true if you want headless modeviewport: {width: 1280,height: 720},ignoreHTTPSErrors: false,clientCertificates: [{origin: 'https://accounts.sap.com',pfxPath: 'sap.pfx',passphrase: 'XXX',// Password for the .pfx file}]},});
sap-login.spec.ts
import{test,expect}from'@playwright/test';test('Login to SAP BTP Cockpit with client certificate',async({ page })=>{// Go to the SAP BTP Cockpit URLawaitpage.goto('https://emea.cockpit.btp.cloud.sap/cockpit#/');// Wait for the login page to load (adjust the selector based on the actual login form structure)awaitexpect(page).toHaveURL('https://emea.cockpit.btp.cloud.sap/cockpit#/');// You can add further checks to ensure successful login based on page content, URL change, etc.// add 10 seconds waitawaitpage.waitForTimeout(10000);// Take a screenshot of the pageawaitpage.screenshot({path: 'screenshot.png'});});
Since Playwright Version
1.46
it is possible to provide a certificate to login.It would make sense to integrate this into the login middleware.
In a minimal sample i was able to login with my SAP Passport X.509 Certificate in pfx format:
playwright.config.ts
sap-login.spec.ts
package.json
The text was updated successfully, but these errors were encountered: