Closed danielsobon closed 1 year ago
hey @AmsterGet, any update regarding the issue? I'm asking because we realized the problem is more serious than we thought. Because of fact the assertion cannot be finished we don't receive report, nor valid status of entire playwright run.
Hey @danielsobon! Thanks for pointing this out! Our team has begun to investigate this issue. We will keep you updated on this thread.
Hey @danielsobon. This issue has been successfully fixed and will be available in the next version of the agent. But I have several questions. Why are you using timeout inside the test greater than your global timeout? Does your provided example only reproduce the bug, or is it the real case?
If it is only to reproduce, and you have such tests which run as long as the global timeout exceeds we recommend splitting it into small pieces and running them in parallel.
@Bam6ycha yep :) We have tests that consist of many steps. Each of them can take some time. In case of bad performance of application, all combined steps can reach the test timeout, so this is a real case.
Second thing, what you can also reproduce is, when we reach expect timeout during preforming operation, example API request. Example code (I recommend to set 2-3 retries because it might be reproduced in random run):
import test, { expect, request } from '@playwright/test';
test.describe('Expect @desktop @smoke', () => {
test.only('Expect toPass @desktop @smoke', async () => {
await expect(async () => {
const status = await sendRequestStep();
expect(status).toBe(400); //status returns 200
}).toPass({ timeout: 5_000 });
});
});
async function sendRequestStep() {
return await test.step(`I get available pets status response`, async () => {
const context = await request.newContext({
baseURL: 'https://petstore.swagger.io',
});
const status = await context
.get('/v2/pet/findByStatus?status=available', {})
.then((response) => response.status())
.finally(async () => await context.dispose());
return status;
});
}
RP view
hey @AmsterGet do you know when I could expect new release?
Hi @danielsobon ! I suppose in a few days. Stay tuned, we'll notify you here.
Hi @danielsobon ! Please check the version 5.1.3.
@AmsterGet , @Bam6ycha I've already retested it. Problem does not occur anymore, thx for fix! 😎
Test setup:
├── @playwright/test@1.35.1 ├── @reportportal/agent-js-playwright@5.1.2
How to reproduce
test.describe('Expect', () => { test(
Expect pool @desktop
, async () => { await expect .poll( () => { return 1; }, { timeout: 30_000 } ) .toBe(2); }); test('Expect toPass @desktop', async () => { await expect(() => { expect(1).toBe(2); }).toPass({ timeout: 30_000 }); }); });