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.TestRunDatabaseCreate module

class baangt.base.TestRunDatabaseCreate.TestRunDatabaseCreate(dbConnection=None)

Bases: object

Initializes the Database and loads some sample data

commit()
createActivityTypes()
createExectionMethods()
createLocatorTypes()
createMasterClasses()
createStructures()
createTestCase()
createTestCase2TestData()
createTestCaseSequence()
createTestDataDefinition()
createTestRun()
createTestStep()
createTestStepSequence()
createValidator()
getCursor()
class baangt.base.TestRunDatabaseCreate.TestRunDatabaseFill(cursor)

Bases: object

fill()

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)
importConfig()
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)
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 datetime_return()
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 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)

Module contents