Namespace: SeLiteSettings

SeLiteSettings

Classes

FieldInformation
TestDbKeeper

Members

(static) commonSettings :SeLiteSettings.Module

This will be the module instance for extensions.selite-settings.common, once its definition is loaded.
Type:
Source:

(static) NULL

It indicates that a single-valued field has value of null. Used in both preferences and values manifests.
Source:

(static) reservedNames

An array of strings that are reserved names. For internal use only.
Source:

(static) VALUE_PRESENT :String

It indicates that a choice (single or multi-valued) or a multi-valued field is present in a set, even if it's unselected or an empty array; then it's stored as a preference with the key being 'moduleName.setName.fieldName' without a trailing dot. Used both in preferences and in values manifest files.
Type:
  • String
Source:

Methods

(static) addClosingIdeHandler()

Register a handler, that is invoked when Selenium IDE is being closed down. This can only be called from Javascript components - loaded through Components.utils.import() - and directly from Selenium Core extensions, because Core extensions get re-loaded on successive restarts of Se IDE (during the same run of Firefox).
Source:

(static) addTestSuiteFolderChangeHandler(handler, handlerName)

Add a handler, that will be called whenever the current test suite folder is changed in Se IDE. It won't be called when Se IDE is closed. When you invoke SeLiteSettings.addTestSuiteFolderChangeHandler(handler) and Se IDE already has a test suite from a known folder, this won't invoke the handler on that known folder. The handler will only be called on any subsequent changes. That should be OK, since this is intended for Core extensions, which are loaded at Se IDE start (before user opens a test suite). Se IDE 2.4.0 starts with the last opened test suite, which is fine - by that time the handlers are in place.
The order of calling handlers is not guaranteed.
Parameters:
Name Type Description
handler Function, with 1 parameter, which will be a string folder (or undefined, if the suite is unsaved and temporary).
handlerName String; Required if you call this from a Core extension, because those get re-loaded if you re-start Se IDE (without restarting Firefox). Optional if you call this from a Javascript component - loaded through Components.utils.import() - because those won't get re-loaded if you restart Se IDE. If there already was a handler registered with the same handlerName, this replaces the previously registered function with the one given now.
Source:

(static) applyTestSuiteFolderChangeHandlers()

Source:

(static) appPath(webURLopt) → {string}

Get application webroot-relative path out of given full URL. Use this instead of SeLiteMisc.selenium.browserbot.getCurrentWindow().location.pathname, which may be under a sub(sub...)folder of site webroot.
Parameters:
Name Type Attributes Description
webURL string <optional>
Full URL. Optional - it defaults to current URL.
Source:
Returns:
URI, in an absolute form (starting with /), relative to application's webroot as per SeLiteSettings.webRoot().
Type
string

(static) changedDefaultSet()

Source:

(static) Field(string, bool, defaultKey, allowNullopt, descriptionopt, customValidate)

Parameters:
Name Type Attributes Default Description
string name Name of the field
bool multivalued Whether the field is multivalued; false by default
defaultKey mixed Default key. It is the default value(s) for fields other than SeLiteSettings.Field.Choice. For SeLiteSettings.Field.Choice it is the default key(s). Optional. Leave it undefined if you don't want a default key (then it won't be set and it will be inherited, if any). It can be null only for single-valued fields, then the default key is null. Otherwise, if the fiels is single valued, the default key should fit the particular type. If multivalued is true, it must be an array (potentially empty) or undefined; it can't be null. For multivalued fields, this can be an empty array, or an array of keys (i.e. stored values, rather than labels to display, which may not be the same for SeLiteSettings.Field.Choice). If a non-null and not undefined, then the value (or values) will be each checked by validateKey(value).
defaultKey has effect only if no applicable set or 'values' manifest has a value for the field, and only if field's module has associatesWithFolders==true. That is done through getFieldsDownToFolder() and getDownToFolder().
allowNull bool <optional>
false Whether this field allows null value; only applicable for fields other than multivalued choice.
description string <optional>
Human-friendly description. It will show up as a tooltip in GUI.
customValidate Function to perform custom validation. It takes - 1 parameter: 'key' (same as the value) for fields other than SeLiteSettings.Field.Choice - 2 parameters: 'key' and 'value' for SeLiteSettings.Field.Choice and its subclasses It returns boolean - true on success, false on failure. Optional.
Source:

(static) getField(fullNameOrField)

Parameters:
Name Type Description
fullNameOrField string | SeLiteSettings.Field String, in form moduleName+fieldName, excluding any set; or a Field instance.
Source:
Returns:
SeLiteSettings.Field instance if present and if fullNameOrField is a string; fullNameOrField if it is a Field. It fails otherwise.

(static) getTestSuiteFolder()

Source:
Returns:
string Full path of the current Se IDE test suite folder. Or undefined - see SeLiteSettings.testSuiteFolder.

(static) loadFromJavascript(moduleNameFileUrl, moduleFileOrUrlopt, forceReload) → {SeLiteSettings.Module}

Load & register the module from its Javascript file, if stored in preferences. The file will be cached - any changes will have affect only once you reload Firefox. If called subsequently, it returns an already loaded instance (unless forceReload is true).
Parameters:
Name Type Attributes Description
moduleNameFileUrl string Either - module name, that is name of the preference path/prefix up to the module (including the module name), excluding the trailing dot; or
moduleFileOrUrl string <optional>
Either - file path + name of the module definition file; or - URL (either chrome:, resource: or file:) to the module definition file Optional; even if it's specified, it's used only if the module has not been registered yet (and then it's required). Standard client code should only pass it when installing a module. Clients that expect a module to be installed shouldn't pass moduleFileOrUrl.
forceReload bool Whether reload the module and overwrite the already cached object, rather than return a cached definition, even if it has been loaded already. False by default (i.e. by default it returns the cached object, if present). It re-adds any fields previously added by addField() - but it doesn't (and it can't) reload source of those added fields.
Source:
Throws:
an error if no such preference branch, or preferences don't contain javascript file, or the javascript file doesn't exist.
Returns:
instance
Type
SeLiteSettings.Module

(static) roleToUser(userNameOrRoleWithPrefix) → {string}

Convert a given symbolic role name (prefixed with '&') to username, or return a given username unchanged.
Parameters:
Name Type Description
userNameOrRoleWithPrefix string Either a symbolic role name, starting with '&', or a username.
Source:
Returns:
Username mapped to userNameOrRoleWithPrefix (after removing '&' prefix) through extensions.selite.common.roles field. If userNameOrRoleWithPrefix doesn't start with '&', this returns it unchanged.
Type
string

(static) setModuleForReloadButtons(moduleOrName)

Associate a settings module to be used by GUI reload/snapshot buttons. Call this from your framework. Do not call it from your settings module definition, otherwise if you load other such definitions (e.g. through API or by opening chrome://selite-settings/content/tree.xul), then the last call to this function would apply.
Parameters:
Name Type Description
moduleOrName SeLiteSettings.Module | string Module, or its full name. The module definition must have fields - testDbField SeLiteSettings.Field.SQLite that points to test SQLite DB; required - appDbField SeLiteSettings.Field.SQLite that points to app SQLite DB; optional - vanillaDbField SeLiteSettings.Field.SQLite that points to vanilla (snapshot) SQLite DB; optional At least two of appDbField and vanillaDbField must exist.
Source:
To Do:
  • Simplify and use SeLiteSettings.commonSettings?

(static) setTestDbKeeper()

Set SeLiteSettings.moduleForReloadButtons.testDbKeeper and initialise it. You can call this only after you've called SeLiteSettings.setModuleForReloadButtons(this) successfully - normally it's done automatically for module 'extensions.selite-settings.common'.
Parameters:
Name Type Description
testDbKeeper. SeLiteSettings.TestDbKeeper | null Pass null if your framework doesn't use testDbKeeper.
Source:

(static) setTestSuiteFolder(folder)

Parameters:
Name Type Description
folder string or undefined
Source:

(static) webRoot() → {string}

Source:
Returns:
Webroot URL of the application, ending with a slash '/'. This is useful because Selenium IDE doesn't allow base URL to contain path (https://github.com/SeleniumHQ/selenium/issues/1550).
Type
string

(static) webURL(pathopt) → {string}

Parameters:
Name Type Attributes Description
path string <optional>
URI, absolute path, relative to webroot. It can start with '/' or without it. Optional - if not present, then this just returns webroot.
Source:
Returns:
URL of the application, based on SeLiteSettings.webRoot() and the given path.
Type
string