Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]When using browser from beforeAll the recorded video is not attaching to the final HTML report even though videos is kept on in config file #33720

Closed
mitrananda opened this issue Nov 21, 2024 · 1 comment

Comments

@mitrananda
Copy link

mitrananda commented Nov 21, 2024

When using browser from beforeAll the recorded video is not attaching to the final HTML report even though videos is kept on in config file

Note:
I see someone raising this issue and confirmed it as bug, what is the bug fix u r giving please let me know
https://stackoverflow.com/questions/78170953/playwright-is-not-generating-videos-when-we-create-our-own-context

code:

import { test } from '@playwright/test';
import { GLOBAL_VARIABLES } from '../../Utility/ENVIRONMENT_VARIABLES.js';
import { login } from '../../Pages/UserCredentials.js';

test.describe(' App Tests', () => {
let page, context;

// Before all tests, login once
test.beforeAll(async ({ browser }) => {
context = await browser.newContext();
page = await context.newPage();

await page.goto(GLOBAL_VARIABLES.baseURL);
await page.waitForLoadState('networkidle');
await login(page, GLOBAL_VARIABLES.username, GLOBAL_VARIABLES.password);

});

// After all tests, close the page
test.afterAll(async () => {
await page.close();
});

test ('creating app ', async ({ }, testInfo) =>
{
test.setTimeout(100000)
// Navigate to Apps
await page.click('#userMenu');
//The user clicks on the "Create App" button to initiate the app creation process.
await page.locator("//span[normalize-space()=' Apps']").click();

const generateRandomAppName = () => Questions_${Math.floor(Math.random() * 1000) + 1};

let appName = generateRandomAppName();
const appDescription = 'This is an exam for Java';

await page.getByTestId('createapp.button').click();

});
});

@dgozman
Copy link
Contributor

dgozman commented Nov 22, 2024

@mitrananda This is a known issue. The workaround is to manually record/save video with the recordVideo api. Take a look at this guide, make sure to click the "Library" tab.

See also #14813 which has the same underlying cause.

@dgozman dgozman closed this as completed Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants