Когда Test1 выходит из строя в Test Suite, он выполняется после обучения и в конце концов, даже если он не завершил выполнение Test2. Особенно, когда Test1 не удастся из -за ошибки тайм -аута < /p>
const { test, expect } = require('@playwright/test');
class TimeoutError extends Error {
constructor(message) {
super(message);
this.name = 'TimeoutError';
}
}
test('test1 - timeout intentionally', async () => {
console.log('executing test1');
throw new TimeoutError('Simulated TimeoutError in test2-here after this test it runs afterEach(Expected) and afterAll(not expected, it should be running after all tests in this suite');
});
test('test2 - should still run', async () => {
console.log('executing test2');
});
test.afterEach(async ({ }, testInfo) => {
console.log('In AFTER_EACH');
});
test.afterAll(async () => {
console.log('In AFTER_ALL');
});
< /code>
Ожидаемое: после того, как вы должны выполнить все мои тесты в тестовом наборе.>
Подробнее здесь: https://stackoverflow.com/questions/796 ... or-in-test