Quantcast
Channel: Active questions tagged config - Stack Overflow
Viewing all articles
Browse latest Browse all 5049

Global setup file for resuable signed in state is not considering global timeouts

$
0
0

So I am automating a scenario where I am using the session storage across multiple tests and for that I have written a simple script like this

// global-setup.tsimport { chromium, FullConfig } from '@playwright/test';async function globalSetup(config: FullConfig) {  const browser = await chromium.launch();  const page = await browser.newPage();  await page.goto('https://github.com/login');  await page.locator('input[name="login"]').fill('user');  await page.locator('input[name="password"]').fill('password');  await page.locator('text=Sign in').click();  // Save signed-in state to 'storageState.json'.  await page.context().storageState({ path: 'storageState.json' });  await browser.close();}export default globalSetup;

Now the problem here is that the webpage elements of the login page are being loaded very slowly and the commands are unfortunately not following the timeouts defined in playwright config file. Any suggetsions what can I do so that the elements follow the timeouts from the playwright config file?


Viewing all articles
Browse latest Browse all 5049

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>