Comments (8)
@vandanak-allegion According to the docs: If the path provided to storageState() is a relative path, then it is resolved relative to current working directory. Ensure that you are accessing the correct file path in your playwright config file. Also, I encountered issues where playwright was attempting to access the storageState.json file prematurely, a workaround is to use a boolean value checking if the file exists using FS module.
ex: const foundStorageState = fs.existsSync('storageState.json');
...
use: {
baseURL: 'https://test.com', //dummy url
storageState: foundStorageState ? 'storage.json' : undefined,
trace: 'on-first-retry',
},
...
from playwright.
I included the check and also debugged by simply plugging in the absolute path. I also had a fixture that included this check for every test. For simplicity and triaging I removed the fixture
from playwright.
I have also tried beforeEach, again it works for the first test and again the second test is prompting to login
test.beforeEach(async () => {
const browser = await chromium.launch();
const context = await browser.newContext({ storageState: 'absolute/path/to/json' });
page = await context.newPage();
await page.goto("/");
});
from playwright.
I am also logging the cookies within each test which works fine
const cookies = await page.context().cookies();
console.log(`cookies: ${JSON.stringify(cookies, null, 2)}`);
from playwright.
@vishvan92 Could you please provide a full repro that we can run locally? Unfortunately, the dummy url https://test.com
or the generateOTP
function that is not defined anywhere, do not allow us to reproduce the issue.
from playwright.
@vishvan92 Could you please provide a full repro that we can run locally? Unfortunately, the dummy url
https://test.com
or thegenerateOTP
function that is not defined anywhere, do not allow us to reproduce the issue.
This is from an testing an internal application. Using the below for generateOTP, where the secret is from deciphering the QR code from an authenticator app.
import * as speakeasy from 'speakeasy';
async function generateOTP(secret: string) {
return speakeasy.totp({
secret: secret,
encoding: 'base32',
});
}
from playwright.
We unfortunately need a self-contained reproduction, which we can run locally to reproduce your issue. Ideally something with expected and actual. Otherwise we can't act on it. Thanks for your understanding!
from playwright.
Closing as per above - feel free to get back to us if you have a reproduction which you can share. Thanks for your understanding!
from playwright.
Related Issues (20)
- [Feature]: Make HTML report test results easier to navigate HOT 3
- [Feature]: Abstract binding types with non-static methods HOT 1
- [Bug]: UI and Timeline wiped away even when any test is passed or failed both are not working hence debugging is not possible. HOT 1
- [Regression]: Inspector and Browser doesn't close on CTRL+C HOT 7
- [Regression]: `snapshotPathTemplate` seems to have a character limitation HOT 3
- [Bug]: Missing explicit waits cause an issue with a UI automation HOT 1
- [Bug]: Pending Requests When Using page.route() to Intercept API Calls in Playwright in debug mode HOT 3
- [Bug]: EvaluateAsync silently fails on some webpages, but not others HOT 4
- [Feature]: Add custom project level fixtures from the config file HOT 1
- [Feature]: remove the deprecated `timeout` argment to `Locator.isVisible`, or make the deprecation more obvious to the user HOT 3
- [Bug]: Locator.ScrollIntoViewIfNeeded or page.mouse.down() are not working without --headed flag HOT 1
- [internal] don't put page stack into error.stack when evaluating
- [Feature]: apply $SHELL env variable at playwright test command. HOT 1
- [Docs]: Incorrect advice about worker count on CircleCI
- [Bug]: command line flag --headed has no effect in ui mode
- [Bug]: Play wright test cases are failing intermittently when PW version is upgraded to "@playwright/test": "^1.47.2" . cloud test win32. HOT 1
- intro.mdx Version in pom.xml is wrong HOT 2
- [Bug]: "stop dev server" button in vs code extension is hidden
- [Bug]: 1.48.0 missing chromium-bidi dependency HOT 3
- [Bug]: playwright vs code plugin not working in remote development mode HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playwright.