Skip to content

Commit

Permalink
test adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonmadigan committed Aug 21, 2024
1 parent 60916a1 commit 596924c
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions tests/topology.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,23 @@ describe('PolicyTopology Page', function () {
});

it('should render and interact with dropdown', async function () {
const dropdownButton = await page.waitForSelector('#pf-dropdown-toggle-id-2');
await dropdownButton.click();
console.log('Dropdown found, attempting to click');
try {
const dropdownButton = await page.waitForSelector('[data-ouia-component-type="PF4/DropdownToggle"]');
await dropdownButton.click();

const gatewayItem = await page.waitForSelector('text=Gateway');
const listenerItem = await page.waitForSelector('text=Listener');
await page.waitForSelector('.pf-c-dropdown__menu', { visible: true });

expect(gatewayItem).to.not.be.null;
expect(listenerItem).to.not.be.null;
console.log('Gateway and Listener items found');
const gatewayItem = await page.waitForSelector('text=Gateway');
const listenerItem = await page.waitForSelector('text=Listener');

await gatewayItem.click();
console.log('Clicked on Gateway item');
expect(gatewayItem).to.not.be.null;
expect(listenerItem).to.not.be.null;

await gatewayItem.click();
} catch (error) {
const rootContent = await page.evaluate(() => document.querySelector('#root').innerHTML);
console.error('Error encountered, dumping #root content:\n', rootContent);
throw error;
}
});
});

0 comments on commit 596924c

Please sign in to comment.