baangt.base package

Submodules

baangt.base.ApiHandling module

class baangt.base.ApiHandling.ApiHandling

Bases: object

getNewSession(sessionNumber=None)
getSession(sessionNumber=1)
getURL(url=None, sessionNumber=1)
postURL(url=None, content=None, sessionNumber=1)
static returnTestCaseStatus(status_code)
setBaseURL(url)
setEndPoint(endpoint)
setHeaders(sessionNumber=1, setHeaderData=None)
setLoginData(userName, password, sessionNumber=1)
tearDown(sessionNumber=None)

baangt.base.BrowserHandling module

baangt.base.CliAndInteractive module

baangt.base.CliAndInteractive.args_read(l_search_parameter)
baangt.base.CliAndInteractive.callTestrun(testRunFile)
baangt.base.CliAndInteractive.getGlobalSettings()
baangt.base.CliAndInteractive.print_args()
baangt.base.CliAndInteractive.run()

baangt.base.CustGlobalConstants module

baangt.base.ExportResults module

baangt.base.GlobalConstants module

baangt.base.HandleDatabase module

class baangt.base.HandleDatabase.HandleDatabase(linesToRead, globalSettings=None)

Bases: object

readNextRecord()

We built self.range during init. Now we need to iterate over the range(s) in range, find appropriate record and return that - one at a time

@return:

readTestRecord(lineNumber=None)
read_excel(fileName, sheetName)
updateGlobals(record)

baangt.base.IBAN module

class baangt.base.IBAN.IBAN(bankLeitZahl='20151', bankLand='AT')

Bases: object

getRandomIBAN()

Generates a random IBAN based on bankLand and bankLeitzahl as well as a random account number

@return: gives a String of IBAN

baangt.base.TestRun module

baangt.base.TestRunExcelImporter module

class baangt.base.TestRunExcelImporter.TestRunExcelImporter(FileNameAndPath, testRunUtils: baangt.base.TestRunUtils.TestRunUtils)

Bases: object

The TestrunSettings are in class TestRunUtils and expected to be a deep dict. For details see documentation there.

This class will migrate data from an excel sheet (either simple format with only 1 tab or complex format with all structural elements) into the deep dict.

In case the XLSX is simple format, all missing data is “predicted”/assumed.

getRowsWithHeadersAsDict(xlsTab)
get_browser()

If no browser is given in globals file then this method will first look for installed browsers in system. First priority will be given to firefox & then chrome.

importConfig(global_settings)
replaceFieldValueWithValueOfConstant(value)

baangt Global constants (baangt.base.GlobalConstants) are available everywhere as GC., e.g. the variable “BROWSER” defined in GlobalConstants can be accessed from everywhere within baangt by using “GC.BROWSER”.

The variables can also be used in configuration files (would be very stupid if we need to change a constant and then 100s of Config-Files need adjustment - worst case the testruns behave unexepected). This applies both to XLSX and JSON Config files.

The CGC.-Part is still needs fixing. It shouldn’t appear in Baangt base, but currently still needed.

@param value: potentially convertable value (e.g. GC.BROWSER) @return: potentially converted value (e.g. “Browser”)

baangt.base.TestRunUtils module

class baangt.base.TestRunUtils.TestRunUtils

Bases: object

getCompleteTestRunAttributes(testRunName)
getSequenceByNumber(sequence, testRunName)
getTestCaseByNumber(sequence, testcaseNumber)
getTestStepByNumber(testCase, testStepNumber)
replaceClasses(testRunName, classes: baangt.base.TestRun.ClassesForObjects.ClassesForObjects)

Apart from what is defined in the TestRunDefintion (XLSX or “guessed” by TestRunExcelImporter) the user may give new class names in the globals file.

We shall replace all corresponding appearances with those new class names

Parameters:classes
Returns:No return parameter. Changes are kept internally
replaceGlobals(globals)

Will go through all testcase-Settings and replace values with values from global settings, if matched

setCompleteTestRunAttributes(testRunName: str, testRunAttributes: dict)

baangt.base.Timing module

baangt.base.Utils module

class baangt.base.Utils.utils

Bases: object

static anything2Boolean(valueIn)
static datetime_return()
static dynamicImportOfClasses(modulePath=None, className=None, fullQualifiedImportName=None)

Will import a class from a module and return the class reference

@param fullQualifiedImportName: Full name of Module and Class. Alternatively: @param modulePath: Path to module and: @param className: Name of the class inside the module @return: The class instance. If no class instance can be found the TestRun aborts hard with sys.exit

static extractFileNameFromFullPath(fileAndPathName)
static findFileAndPathFromPath(fileNameAndPath, basePath=None)

Tries different approaches to locate a file lBasePath = the Path where the script is run

@param fileNameAndPath: Filename and potentially relative path @param basePath (optional): Optional basePath to look at @return:

static listToString(completeList)

Returns a concatenated string from a list-object :param completeList: any List :return: String

static openJson(fileNameAndPath)
static replaceAllGlobalConstantsInDict(lDict: dict)
static replaceFieldValueWithValueOfConstant(value)

If a String reference to global Constant (e.g. GC.BROWSER_FF) is given, this function will replace it with the actual value (e.g. FIREFOX)

static sanitizeFileName(value)
static setLocatorFromLocatorType(lLocatorType, lLocator)

@param lLocatorType: XPATH, CSS, ID, etc. @param lLocator: Value of the locator @return:

static setLogLevel(level)

Module contents