mirror of
https://github.com/GSA/notifications-admin.git
synced 2025-12-10 23:23:27 -05:00
19 lines
618 B
JavaScript
19 lines
618 B
JavaScript
module.exports = async (page, scenario) => {
|
|
await page.goto(scenario.url, { waitUntil: 'networkidle2' });
|
|
|
|
console.log('Page loaded.');
|
|
|
|
// Count the number of items in the side navigation and log their text
|
|
const navItems = await page.$$eval('nav ul li.usa-sidenav__item a', (items) =>
|
|
items.map((item) => item.textContent.trim())
|
|
);
|
|
|
|
console.log(`Found ${navItems.length} navigation items:`);
|
|
navItems.forEach((itemText, index) => {
|
|
console.log(`${index + 1}: ${itemText}`);
|
|
});
|
|
|
|
// Wait a moment for the logging to complete
|
|
await new Promise((resolve) => setTimeout(resolve, 1000));
|
|
};
|