Skip to content

aikrasnov/webdriverio-command-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Coverage Status

NPM

Webdriverio-command-parser

Webdriverio-command-parser generates js module with functions based on custom command for webdriverio.

Source file

    /**
    * Check something
    */
    browser.addCommand('myCustomCommand', async (myArg, myArgTwo) => {
       // do smth
    });

Outcome

const myCustomCommand => (myArg, MyArgTwo) => {};

module.exports = {
	myCustomCommand
};

Outcoming module may be used for autocomplete in WebStorm.


Installation

npm install --save webdriverio-command-parser

for CLI

npm install -g webdriverio-command-parser

Usage

CLI (e.g with cron)

wparser -p /path/to/your/commands/ -o /place/for/save/parsed/commands/

You can indicate path to folder or directory

Possible args

  -p, --path             path to file or directory                           
  -o, --output           path to directory or file for write parsed commands 
  -f, --refile           regexp for match files                              
  -c, --recommand        regexp for match custom command definitions         
  -d, --eslintdisable    disable eslint in output file                       
  -s, --showall          show defective commands                             
  -h, --help             show help   

As extrenal library

const {parsePath} = require('webdriverio-command-parser');
parsePath('/path/to/your/command').then(() => {
    console.log('done');
}).catch(err => {
    console.log(`some error here ${err}`);
});

Webdriverio-command-parser

Webdriverio-command-parser генерирует js модуль с функциями на основе кастомных комманд для webdriverio.

Исходный файл

    /**
    * Check something
    */
    browser.addCommand('myCustomCommand', async (myArg, myArgTwo) => {
       // do smth
    });

Результат

const myCustomCommand => (myArg, MyArgTwo) => {};

module.exports = {
	myCustomCommand
};

Полученный модуль можно использовать для автокомплита в WebStorm.


Установка

npm install --save webdriverio-command-parser

Или для использования из командной строки

npm install -g webdriverio-command-parser

Использование

Из командой строки (например, в кроне)

wparser -p /path/to/your/commands/ -o /place/for/save/parsed/commands/

Можно указывать путь до файла, или до папки.

Возможные аргументы

  -p, --path             path to file or directory                           
  -o, --output           path to directory or file for write parsed commands 
  -f, --refile           regexp for match files                              
  -c, --recommand        regexp for match custom command definitions         
  -d, --eslintdisable    disable eslint in output file                       
  -s, --showall          show defective commands                             
  -h, --help             show help   

Как подключаемую либу

const {parsePath} = require('webdriverio-command-parser');
parsePath('/path/to/your/command').then(() => {
    console.log('done');
}).catch(err => {
    console.log(`some error here ${err}`);
});

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published