This commit is contained in:
2025-11-27 18:14:25 +01:00
parent 1348c37675
commit f552649357
52 changed files with 1465 additions and 8765 deletions

View File

@@ -52,7 +52,7 @@ describe('Selector Verification against HTML Dumps', () => {
.replace(/:has-text\("[^"]+"\)/g, '')
.replace(/:has\([^)]+\)/g, '')
.replace(/:not\([^)]+\)/g, '');
// If selector became empty or too complex, we might need manual verification logic
if (!cleanSelector || cleanSelector === selector) {
// Try standard querySelector
@@ -89,11 +89,12 @@ describe('Selector Verification against HTML Dumps', () => {
describe('Wizard Modal', () => {
it('should find the wizard modal container', () => {
if (!dumps['create']) return;
if (!dumps['raceInfo']) return;
// The modal is present in step 3 (race information), not in step 2 (create-a-race)
// IRACING_SELECTORS.wizard.modal
// '#create-race-modal, [role="dialog"], .modal.fade.in'
const modal = dumps['create'].querySelector('#create-race-modal') ||
dumps['create'].querySelector('[role="dialog"]');
const modal = dumps['raceInfo'].querySelector('#create-race-modal') ||
dumps['raceInfo'].querySelector('.modal.fade.in');
expect(modal).not.toBeNull();
});
@@ -111,7 +112,7 @@ describe('Selector Verification against HTML Dumps', () => {
// IRACING_SELECTORS.steps.sessionName
// This is a complex selector, let's check the input exists
const input = dumps['raceInfo'].querySelector('input[name="sessionName"]') ||
dumps['raceInfo'].querySelector('input.form-control');
dumps['raceInfo'].querySelector('input.form-control');
expect(input).not.toBeNull();
});
@@ -123,14 +124,14 @@ describe('Selector Verification against HTML Dumps', () => {
// or the dump doesn't capture the password field correctly (e.g. dynamic rendering).
// However, we see many text inputs. Let's try to find one that looks like a password field
// or just verify ANY input exists if we can't be specific.
// For now, let's check if we can find the input that corresponds to the password field
// In the absence of a clear password field, we'll check for the presence of ANY input
// that could be the password field (e.g. second form group)
const inputs = dumps['step3'].querySelectorAll('input.chakra-input');
expect(inputs.length).toBeGreaterThan(0);
// If we can't find a specific password input, we might need to rely on the fact that
// there are inputs present and the automation script uses a more complex selector
// that might match one of them in a real browser environment (e.g. by order).
@@ -178,8 +179,8 @@ describe('Selector Verification against HTML Dumps', () => {
// IRACING_SELECTORS.BLOCKED_SELECTORS.checkout
// Look for button with "Check Out" or cart icon
const buttons = Array.from(dumps['checkout'].querySelectorAll('a.btn, button'));
const checkoutBtn = buttons.find(b =>
b.textContent?.includes('Check Out') ||
const checkoutBtn = buttons.find(b =>
b.textContent?.includes('Check Out') ||
b.querySelector('.icon-cart') ||
b.getAttribute('data-testid')?.includes('checkout')
);