1.1.7 • Published 4 years ago

automation-selectors v1.1.7

Weekly downloads
2
License
GNU General Publi...
Repository
github
Last release
4 years ago

Automation selectors for Web and Mobile Apps

A mini-package for iOS (testID), Android (accessibilityLabel) and web (data-test) property assignment based on environment & Platform.

Installation

Install automation-selectors with NPM or yarn

  1. Add automation-selectors as a devDependency:

    npm install --save-dev automation-selectors
    yarn add -D automation-selectors
  2. In your project create a module and pass in all the necessary props.

    RN Example:

    import { Platform } from "react-native";
    import { qaID } from "automation-selectors";
    
    export const selector = (selectorValue?: string) => {
      if (process.env.NODE_ENV !== "production") {
        return qaID(selectorValue || "", Platform.OS);
      }
    };

    Web Example:

    import { qaID } from "automation-selectors";
    
    export const selector = (selectorValue?: string) => {
      if (process.env.NODE_ENV !== "production") {
        return qaID(selectorValue || "", 'web');
      }
    };
  3. Invoke selectors in components:

    import { selector } from 'path/to/module';
    ...
    <View
        {...selector('VIEW_HOMEPAGE')}
    />
    ...
    };
  4. At this point your selector becomes a testID, accessibilityLabel or data-test based on OS.

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago