@applitools/sdk-coverage-tests
TypeScript icon, indicating that this package has built-in type declarations

3.1.0 • Public • Published

SDK Agnostic Test-framework

SAT is internal CLI tool for Applitools SDKs. With the CLI, you can:

  • Generate code: create test suites and generate test files.
  • Send reports: send reports to the dashboard as part of release event.

Usage

# To save as a dependency
$ npm install -D sdk-coverage-test
# or
$ yarn add --dev sdk-coverage-test

$ npx coverage-tests --help

Generate Code

$ npx coverage-tests generate [config-path]

Configuration

You can specify path to the configuration file (by default: ./test/coverage/index.js) or specify almost everything using CLI options.

Configuration file should export a config object with next structure:

type Configuration = {
  name: string, // SDK name
  testsPath: string, // path or url to the file with tests declarations
  outPath: string, // path to save generated tests files
  metaPath: string, // path to save metadata file
  ext: string, // extension for generated files (e.g. `.spec.js`)
  initializeSdk: (tracker: Tracker, test: Test) => SDKEmitter, // sdk constructor which returns all possible commands
  testFrameworkTemplate: (test: Test) => string,
  overrideTests: object,
  strict: boolean, // if `true` will fail whole generation if at least one test emitting will fail, `false` will gracefully handle emitting errors
  emitOnly: string[], // array of test names that should be generated, all others will not be generated
}

Test declarations

All test declarations should be placed in a file (you can specify path to this file using testsPath configuration option). The file itself is a js file which have two special global methods test and config. You can use test method to add a test declaration and config method to set a declaration level tests configuration object.

type TestsConfiguration = {
  pages: {
    [key: string]: string
  }
}

type TestDeclaration = {
  page: string, // page (name or raw url) to visit in a very beginning of the test
  env: {
    url: string // driver url (better use browser and/or device to target a specific driver)
    browser: string, // browser name supported by sdk implementation (e.g. 'chrome' or 'ie-11')
    device: string, // device name supported by sdk implementation (e.g 'Pixel 4' or 'iPhone XS')
    app: string, // url to the native app to be run (make sens only in combination with `device`)
    headless: boolean, // whether browser should be ran in headless mode
    orientations: 'portrait' | 'landscape', // device orientation (make sens only in combination with `device`)
    proxy: { // driver proxy configuration
      http: string,
      https: string,
      server: string,
      ftp: string,
      bypass: string[]
    }
  },
  config: EyesConfiguration & {vg: boolean, check: 'classic' | 'fluent'}
  variants: { [key: string]: TestDeclaration }
  test: ({eyes: object, driver: object, assert: object}) => void
}

type SetTestsConfiguration = (config: TestsConfiguration) => void
type AddTestDeclaration = (string: name, test: TestDeclaration) => void

Report

$ npx coverage-tests report [config-path]

TBD

Readme

Keywords

none

Package Sidebar

Install

npm i @applitools/sdk-coverage-tests

Weekly Downloads

6

Version

3.1.0

License

SEE LICENSE IN LICENSE

Unpacked Size

59.5 kB

Total Files

25

Last publish

Collaborators

  • roeefr
  • livgerti
  • shiran.sidis
  • mmilapp
  • anandbagmar
  • dockermaster
  • mkowalew3382
  • itaiz134
  • anastasia.koifman
  • eirenik0
  • sergovapplitools
  • fatihsolhan-applitools
  • grayscale64
  • itaibh-applitools
  • bongo123
  • aretm_borodavka
  • netaavivi
  • applitoolsmustafa
  • zamboney
  • benbaba
  • amit.rokach
  • eladheller
  • adamcarmi
  • amir.groisman
  • noamshv
  • noam.gaash
  • giladgd
  • ran-itzhaki
  • noam.mendel
  • gearm
  • benny.halberstadt
  • gofilord
  • alex.burdeynyy
  • david.haeffner
  • chaimaharonson
  • roy.sela
  • ronikar_applitools
  • danielputerman
  • amitzur
  • ramapplitools
  • applitools-admin
  • applitools-readonly
  • iasisapp
  • yotammadem
  • liranbarokas
  • itayy.applitools
  • denis.styrt
  • kyrylo.onufriiev
  • amitzur-applitools
  • yardenw.applitools
  • ormeda
  • vgprod
  • clementbarry