test.beforeAll(async () => {
test.setTimeout(90000);
browser = await chromium.launch();
context = await browser.newContext();
// Create a new page in the context
page = await context.newPage();
const login = new LoginPage(page);
await login.goto(data.devurl);
await login.loginapplication(data.username, data.password);
});
This is my beforeAll and I never logout and continue the same browser for all the test cases with each test..
Eg.,
test.only("Verify Waive Functionality in AlertsPage", async ({ }, testInfo) => {
test.setTimeout(0)
const alertsPage = new AlertsPage(page);
await alertsPage.navigateToAlertsToBeReviewedTab(testInfo);
const alertNumber = await alertsPage.selectNthAlertCheckBox(testInfo, 2, data.WaiveAlertAction);
await alertsPage.verifyAlert(testInfo, 2, alertNumber);
});
like this n number of test cases..
I dont have anything on BeforeEach since i am not logging each time..
But I am trying to fetch the status of Each Test cases and steps to post in TestRail.
Is it possible in AfterEach?
Pls suggest..