I have been struggling to run the following complete end-to-end test for my project. I have a collection of pages, each consisting of a page title and a list of steps required. However, in order to retrieve these pages, an asynchronous call is necessary. Consequently, the 'it' method is not being executed as expected.
I am looking for a way to loop through the 'it' method for all the pages in my array.
describe('Test Suite', () => {
let pages: Page[]; //Page = { Name: string, testSteps: string[] }
beforeAll(async () => {
pages = await service.GetPages();
});
pages.forEach((page) => {
it("Test Cases", () => {
return executePageTests(page);
});
});
});