mirror of
https://github.com/hanzodao/ui-automation.git
synced 2026-10-30 20:01:03 +00:00
27 lines
1.3 KiB
TypeScript
27 lines
1.3 KiB
TypeScript
import { getBaseUrl, appendFlagsToUrl } from '../../test-helpers';
|
|
import { getTestDao } from '../../../config/test-daos';
|
|
import { BaseSeleniumTest } from '../../base-selenium-test';
|
|
import { By } from 'selenium-webdriver';
|
|
import { pages } from '../../../config/pages';
|
|
|
|
// Parse governance type from CLI args
|
|
const governanceArg = process.argv.find(arg => arg.startsWith('--governance='));
|
|
const governanceType = governanceArg ? governanceArg.split('=')[1].toLowerCase() : 'erc20';
|
|
|
|
const test = new BaseSeleniumTest('settings', 'modules-tab');
|
|
BaseSeleniumTest.run(async (test) => {
|
|
// Load the DAO homepage
|
|
await test.start();
|
|
const daoHomePath = `${pages['dao-homepage']}?dao=${getTestDao(governanceType).value}`;
|
|
await test.driver!.get(appendFlagsToUrl(getBaseUrl() + daoHomePath));
|
|
// Click the 'Manage DAO' button
|
|
const manageBtn = await test.waitForElement(By.css('[aria-label="Manage DAO"]'));
|
|
await manageBtn.click();
|
|
// Click on the 'Modules and Guards' tab
|
|
const modulesTab = await test.waitForElement(By.xpath("//p[text()='Modules and Guards']"));
|
|
await modulesTab.click();
|
|
// Wait for the 'Modules' paragraph (exact text match)
|
|
await test.waitForElement(By.xpath("//p[text()='Modules']"));
|
|
console.log('Modules and Guards tab opened and "Modules" paragraph found.');
|
|
}, test);
|