wip
This commit is contained in:
@@ -280,6 +280,30 @@ export class IRacingDomInteractor {
|
||||
const page = this.getPage();
|
||||
|
||||
if (!this.isRealMode()) {
|
||||
const timeout = this.config.timeout;
|
||||
|
||||
try {
|
||||
const footerButtons = page.locator('.wizard-footer a.btn, .wizard-footer button');
|
||||
const count = await footerButtons.count().catch(() => 0);
|
||||
|
||||
if (count > 0) {
|
||||
const targetText = nextStepName.toLowerCase();
|
||||
for (let i = 0; i < count; i++) {
|
||||
const button = footerButtons.nth(i);
|
||||
const text = (await button.innerText().catch(() => '')).trim().toLowerCase();
|
||||
if (text && text.includes(targetText)) {
|
||||
await button.click({ timeout, force: true });
|
||||
this.log('info', 'Clicked mock next button via footer text match', {
|
||||
nextStepName,
|
||||
text,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch {
|
||||
}
|
||||
|
||||
await this.clickAction('next');
|
||||
return;
|
||||
}
|
||||
@@ -346,7 +370,13 @@ export class IRacingDomInteractor {
|
||||
try {
|
||||
const count = await page.locator(h).first().count().catch(() => 0);
|
||||
if (count > 0) {
|
||||
const tag = await page.locator(h).first().evaluate((el) => el.tagName.toLowerCase()).catch(() => '');
|
||||
const tag = await page
|
||||
.locator(h)
|
||||
.first()
|
||||
.evaluate((el: any) =>
|
||||
String((el as any).tagName || '').toLowerCase(),
|
||||
)
|
||||
.catch(() => '');
|
||||
if (tag === 'select') {
|
||||
try {
|
||||
await page.selectOption(h, value);
|
||||
@@ -514,7 +544,11 @@ export class IRacingDomInteractor {
|
||||
const count = await locator.count().catch(() => 0);
|
||||
if (count === 0) continue;
|
||||
|
||||
const tagName = await locator.evaluate((el) => el.tagName.toLowerCase()).catch(() => '');
|
||||
const tagName = await locator
|
||||
.evaluate((el: any) =>
|
||||
String((el as any).tagName || '').toLowerCase(),
|
||||
)
|
||||
.catch(() => '');
|
||||
const type = await locator.getAttribute('type').catch(() => '');
|
||||
|
||||
if (tagName === 'input' && (type === 'checkbox' || type === 'radio')) {
|
||||
@@ -648,7 +682,11 @@ export class IRacingDomInteractor {
|
||||
const count = await locator.count().catch(() => 0);
|
||||
if (count === 0) continue;
|
||||
|
||||
const tagName = await locator.evaluate((el) => el.tagName.toLowerCase()).catch(() => '');
|
||||
const tagName = await locator
|
||||
.evaluate((el: any) =>
|
||||
String((el as any).tagName || '').toLowerCase(),
|
||||
)
|
||||
.catch(() => '');
|
||||
if (tagName === 'input') {
|
||||
const type = await locator.getAttribute('type').catch(() => '');
|
||||
if (type === 'range' || type === 'text' || type === 'number') {
|
||||
@@ -746,7 +784,7 @@ export class IRacingDomInteractor {
|
||||
|
||||
const addCarButtonSelector = this.isRealMode()
|
||||
? IRACING_SELECTORS.steps.addCarButton
|
||||
: '[data-action="add-car"]';
|
||||
: `${IRACING_SELECTORS.steps.addCarButton}, [data-action="add-car"]`;
|
||||
|
||||
try {
|
||||
this.log('info', 'Clicking Add Car button to open modal');
|
||||
|
||||
Reference in New Issue
Block a user