mirror of
https://github.com/luxdao/ui-automation.git
synced 2026-10-30 19:53:14 +00:00
26 lines
1.2 KiB
TypeScript
26 lines
1.2 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', 'general-tab');
|
|
BaseSeleniumTest.run(async (test) => {
|
|
// Step 1: Load the DAO homepage
|
|
await test.start();
|
|
const daoHomePath = `${pages['dao-homepage']}?dao=${getTestDao(governanceType).value}`;
|
|
await test.driver!.get(appendFlagsToUrl(getBaseUrl() + daoHomePath));
|
|
// Step 2: Click the 'Manage DAO' button
|
|
const manageBtn = await test.waitForElement(By.css('[aria-label="Manage DAO"]'));
|
|
await manageBtn.click();
|
|
// Step 3: Wait for the DAO settings name element
|
|
await test.waitForElement(By.css('[data-testid="daoSettings.name"]'));
|
|
console.log('Settings modal opened, General tab active, and DAO settings name element found.');
|
|
}, test);
|