Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added normalization function to make options case-insensitive #1865

Merged
merged 5 commits into from
Feb 20, 2025

Conversation

bs-shobhitkumar
Copy link
Contributor

@bs-shobhitkumar bs-shobhitkumar commented Feb 19, 2025

Have added a normalization function in validateSnaphotOptions to convert any type of casing of options to camecase making them case-insensitive.

Example:

If a user provides options as:

  options = {
          nAmE: 'Snapshot 1',
          url: 'http://localhost:8000',
          WiDtHs: [375, 1280],
          sCoPe: '#app',
          sCoPeOpTiOnS: { scroll: true },
          mInHeIgHt: 1024,
          eNaBlEJaVaScRiPt: true,
          eNaBlELaYoUt: false,
          cLiEnTInFo: 'client-info',
          eNvIrOnMeNtInFo: 'env-info',
          sYnC: true,
          tEsTcAsE: 'testCase',
          lAbElS: 'label1',
          tHtEsTcAsEeXeCuTiOnId: '12345'
        }

These will be converted to:

 options = {
        clientInfo: 'client-info',
        environmentInfo: 'env-info',
        name: 'Snapshot 1',
        url: 'http://localhost:8000',
        widths: [375, 1280],
        scope: '#app',
        scopeOptions: { scroll: true },
        minHeight: 1024,
        enableJavaScript: true,
        enableLayout: false,
        sync: true,
        testCase: 'testCase',
        labels: 'label1',
        thTestCaseExecutionId: '12345'
      }

@bs-shobhitkumar bs-shobhitkumar added the ✨ enhancement New feature or request label Feb 20, 2025
@bs-shobhitkumar bs-shobhitkumar merged commit 43820b8 into master Feb 20, 2025
38 checks passed
@bs-shobhitkumar bs-shobhitkumar deleted the PER_3287_options_case_insensitive branch February 20, 2025 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants