webdriverio-command-parser

0.0.3 • Public • Published

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.


\n Установка

npm install --save webdriverio-command-parser

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

npm install -g webdriverio-command-parser

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

Из командой строки

wparser -p /path/to/you/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/you/command').then(() => {
    console.log('done');
}).catch(err => {
    console.log(`some error here ${err}`);
});

Package Sidebar

Install

npm i webdriverio-command-parser

Weekly Downloads

4

Version

0.0.3

License

GPL-3.0

Last publish

Collaborators

  • pompi