https://github.com/gemini-testing/playwright-selenium-oauth
https://github.com/gemini-testing/playwright-selenium-oauth
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/gemini-testing/playwright-selenium-oauth
- Owner: gemini-testing
- Created: 2023-06-19T09:42:23.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2023-07-05T08:15:58.000Z (almost 2 years ago)
- Last Synced: 2025-02-16T03:32:53.806Z (4 months ago)
- Language: TypeScript
- Size: 294 KB
- Stars: 0
- Watchers: 9
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Playwright-selenium-oauth
A library for OAuth Selenium authentication in PlayWright## How to use
1. `npm install playwright-selenium-oauth -D`
2. [Add global setup to your playwright configuration](https://playwright.dev/docs/test-global-setup-teardown#configure-globalsetup-and-globalteardown) and specify the token e.g.
```
import {setup} from "playwright-selenium-oauth"
async function globalSetup() {
await setup({token: }); // specifying token directlyawait setup({token: process.env.SELENIUM_OAUTH_CI_TOKEN || process.env.SELENIUM_OAUTH_USER_TOKEN}); // example for a CI setup
await setup({tokenFilePath: "/path/to/my/token"}); // specyfing path to a text file with the token
await setup({tokenFilePath: process.env.CI ? "/robot/token" : "/user/token"}); // example for a CI setup
}
export default globalSetup;
```## Help
You can pass a helpful string that would be printed when there is a problem loading a token file.
```
await setup({help: "You can generate the token here: https://here/the/user/may/get/his/token"})
```