1.0.2 • Published 2 years ago

wdio-enverus-core-ui-utils v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

WDIO Enverus Core UI utils

About

The motivation with this module is to provide a high-level abstraction for Core UI utils.

Getting Started

Install WDIO Enverus Core UI Utils as an npm module and save it to your package.json file as a development dependency:

npm install wdio-enverus-core-ui-utils --save-dev

Once installed it can now be referenced by simply calling

import {
    FileUtils as fileUtils,
    StringUtils as stringUtils,
    CookiesUtils as cookiesUtils
} from 'wdio-enverus-core-ui-utils';

Available methods:

File Utils:

  • isFileDownloadedThenMove - Check if file name with extension is present in Download folder and move it
  • isFileDownloadedThenMoveByPartName - Check if file name with extension is present in Download folder and move it (part of the name)
  • moveFileIfExists - Move File if exist
  • moveFileByPartNameIfExists - Move File if exist (part of the name)
  • getFullPathToFile - Get full path to file
  • getFullPathToFileByPartName - Get full path to file (part of the name )
  • _moveFile - Move File from directory
  • fileLineCount - Compare the number of line in file and table
  • downloadFileFromRemoteServer - Download file from remote server. Using session id
  • uploadFile - Upload file
  • readTextFile - Read text file
  • extractArchive - Extract archive to path
  • _getFileName - Return file name with with extension(check case)
  • fileHeader - Get file header
  • fileLineData - Get file line data By Index
  • csvToJson - Convert csv file to json
  • isFileExist - Check if file exist

Method Summary

MethodsMethods typeParameters
isFileDownloadedThenMovepublicfileName, fileExtension, suiteName, waitTimeout
isFileDownloadedThenMoveByPartNamepublicfileName, suiteName, waitTimeout
moveFileIfExistspublicdirName, fileNameWithExt, suiteName, timeOut
moveFileByPartNameIfExistspublicdirName, fileName, suiteName, timeOut
getFullPathToFilepublicdirName, fileNameWithExt
getFullPathToFileByPartNamepublicdirName, fileNameWithExt
_moveFileprivatefullPathToFile, fileNameWithExt, suiteName
fileLineCountpublicfileName, fileExtension, suiteName, remove, splitLine
downloadFileFromRemoteServerpublicEXPORT_FILE_NAME, FILE_EXTENSION, TIMEOUT
uploadFilepublicfileName
readTextFilepublicfileName, filePath, folder
extractArchivepublicsuiteName, fileName, timeout
_getFileNameprivatedirName, fileNameWithExt
async fileHeaderpublicfileName, fileExtension, suiteName
async fileLineDatapublicfileName, fileExtension, suiteName, index
async csvToJsonpublicfileName, fileExtension, suiteName
isFileExistpublicFILE_NAME, FILE_PATH

String Utils:

  • areArraysEqual - Compare if two string arrays are equal. Order of elements in arrays does not matter.
  • arrayToLowerCase - Convert all values in array to lowerCase.
  • randomInt - Get random integer
  • findDuplicatesInArray - Find duplicates in Array
  • stringToArray - Convert string to array

Method Summary

MethodsMethods typeParameters
areArraysEqualpublicarr1, arr2
arrayToLowerCasepublicstringArray
randomIntpublicmin, max
findDuplicatesInArraypublicarr
stringToArraypublicstring, separator, booleanRemoveLegend

Cookies Utils:

  • writeCookies - Write cookies file
  • userCookies - Get user cookies from file
  • userToken - Get user token from file
  • userEnv - Get env from file

Method Summary

MethodsMethods typeParameters
writeCookiespublicFILE_NAME, DATA, FILE_PATH
userCookiespublicFILE_NAME, USER
userTokenpublicFILE_NAME, USER
userEnvpublicFILE_NAME, FILE_PATH
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago