GPAL - Generally Positive Automation Library v1.0
GPAL The Fluent Automation LIbrary
Loading...
Searching...
No Matches
GenerallyPositive.Browser.GPALUrl Class Reference

Represents a URL with optional pre-navigation storage cleanup / inspection actions. Uses fluent builder pattern with fail-forward design (logs issues instead of throwing exceptions). Supports implicit conversion to/from string (with warning on first implicit use). More...

Inheritance diagram for GenerallyPositive.Browser.GPALUrl:
GenerallyPositive.Browser.IGPALUrl GenerallyPositive.Browser.IAllowGPALUrlForUrl GenerallyPositive.Browser.IAllowGPALUrlStorageType GenerallyPositive.Browser.IAllowGPALUrlStorageItemConfig GenerallyPositive.Browser.IAllowGPALUrlStorageData GenerallyPositive.Browser.IAllowToGPALObject< TResult > GenerallyPositive.Browser.IAllowToGPALObject< TResult > GenerallyPositive.Browser.IAllowGPALUrlStorageType GenerallyPositive.Browser.IAllowToGPALObject< TResult > GenerallyPositive.Browser.IAllowToGPALObject< TResult >

Public Member Functions

IAllowGPALUrlStorageType ForUrl (string url)
 Changes (or sets) the target URL for this builder instance.
IAllowGPALUrlStorageItemConfig WithStorageType (WebsiteStorageType type)
 Specify the storage type for this storage action.
IAllowGPALUrlStorageItemConfig WithStorageData (string data)
 Specifies the data to set.
IAllowGPALUrlStorageItemConfig WithStorageKey (string key)
 Specifies the key for the most recently added storage action.
IAllowGPALUrlStorageItemConfig WithStoragePath (string path)
 Specifies the path restriction for the most recently added storage action (mainly for cookies).
IAllowGPALUrlStorageItemConfig WithStorageDomain (string domain)
 Specifies the domain restriction for the most recently added storage action (mainly cookies).
IAllowGPALUrlStorageItemConfig WithStorageStoreName (string storeName)
 Specifies the IndexedDB store name for the most recently added action.
IAllowGPALUrlStorageItemConfig WithUserDefined (string userDefined)
 Specifies the data to set.
IAllowGPALUrlStorageItemConfig WithDeleteAcrossOrigins (bool trueOrFalse)
 OttoMagic Only: For delete operations without a domain, limit to origin? true = delete across origins false = delete only in the current origin (default).
List< StorageActionAdd (StorageAction storageAction)
 Adds a fully-configured StorageAction to the list.
List< StorageActionAdd (List< StorageAction > storageActions)
 Adds multiple fully-configured StorageAction items.
IGPALUrl ToGPALObject ()
 Returns this instance typed as IGPALUrl.

Static Public Member Functions

static implicit operator string (GPALUrl url)
 Implicitly converts GPALUrl to its string URL representation.
static implicit operator GPALUrl (string url)
 Implicitly converts a string to a GPALUrl instance. Logs a one-time warning about equality limitations of implicit conversions.

Properties

string Url [get]
 Gets the target URL string.

Detailed Description

Represents a URL with optional pre-navigation storage cleanup / inspection actions. Uses fluent builder pattern with fail-forward design (logs issues instead of throwing exceptions). Supports implicit conversion to/from string (with warning on first implicit use).

The url says which storage a workflow touches. Each WithStorageType starts an action and the calls after it narrow that one action, so a url carries as many as it was given. What runs is decided later: the browser's RunGet, RunSet and RunDelete pick from the actions declared here and never reach past them.

GPALUrl url = "https://example.com"; // or GPAL.Url.ForUrl("https://example.com")
url.WithStorageType(WebsiteStorageType.cookie)
.WithStorageDomain("example.com")
.WithStorageKey("session");
url.WithStorageType(WebsiteStorageType.localStorage)
.WithStorageKey("theme");
browser.GoTo(url); // the url becomes the one in context
browser.WithStorageKey("theme")
.WithStorageData("dark")
.RunSet(WebsiteStorageType.localStorage);
Represents a URL with optional pre-navigation storage cleanup / inspection actions....
Definition GPALUrl.cs:53
IAllowGPALUrlStorageItemConfig WithStorageType(WebsiteStorageType type)
Specify the storage type for this storage action.
Definition GPALUrl.cs:117
IAllowGPALUrlStorageItemConfig WithStorageKey(string key)
Specific key for the current storage type.
IAllowGPALUrlStorageItemConfig WithStorageDomain(string domain)
Optional: domain override.

Definition at line 52 of file GPALUrl.cs.

Member Function Documentation

◆ Add() [1/2]

List< StorageAction > GenerallyPositive.Browser.GPALUrl.Add ( List< StorageAction > storageActions)

Adds multiple fully-configured StorageAction items.

Parameters
storageActionsActions to append.
Returns
The updated list of actions.

Implements GenerallyPositive.Browser.IGPALUrl.

Definition at line 254 of file GPALUrl.cs.

◆ Add() [2/2]

List< StorageAction > GenerallyPositive.Browser.GPALUrl.Add ( StorageAction storageAction)

Adds a fully-configured StorageAction to the list.

Parameters
storageActionThe action to add.
Returns
The updated list of actions (for convenience, though usually not needed).

Implements GenerallyPositive.Browser.IGPALUrl.

Definition at line 243 of file GPALUrl.cs.

◆ ForUrl()

IAllowGPALUrlStorageType GenerallyPositive.Browser.GPALUrl.ForUrl ( string url)

Changes (or sets) the target URL for this builder instance.

Parameters
urlThe new URL. If null/empty/whitespace > defaults to "https://google.com".
Returns
Self (for fluent chaining).

Implements GenerallyPositive.Browser.IAllowGPALUrlForUrl.

Definition at line 106 of file GPALUrl.cs.

◆ operator GPALUrl()

implicit GenerallyPositive.Browser.GPALUrl.operator GPALUrl ( string url)
static

Implicitly converts a string to a GPALUrl instance. Logs a one-time warning about equality limitations of implicit conversions.

Prefer explicit construction GPAL.Url(str) when reusing the same URL object.

Definition at line 90 of file GPALUrl.cs.

◆ operator string()

implicit GenerallyPositive.Browser.GPALUrl.operator string ( GPALUrl url)
static

Implicitly converts GPALUrl to its string URL representation.

Definition at line 79 of file GPALUrl.cs.

◆ ToGPALObject()

IGPALUrl GenerallyPositive.Browser.GPALUrl.ToGPALObject ( )

Returns this instance typed as IGPALUrl.

Returns
Self as interface.

Implements GenerallyPositive.Browser.IAllowToGPALObject< TResult >.

Definition at line 264 of file GPALUrl.cs.

◆ WithDeleteAcrossOrigins()

IAllowGPALUrlStorageItemConfig GenerallyPositive.Browser.GPALUrl.WithDeleteAcrossOrigins ( bool trueFalse)

OttoMagic Only: For delete operations without a domain, limit to origin? true = delete across origins false = delete only in the current origin (default).

Parameters
trueFalse
Returns

Implements GenerallyPositive.Browser.IAllowGPALUrlStorageItemConfig.

Definition at line 226 of file GPALUrl.cs.

◆ WithStorageData()

IAllowGPALUrlStorageItemConfig GenerallyPositive.Browser.GPALUrl.WithStorageData ( string data)

Specifies the data to set.

Parameters
datadata (context sensistieve).
Returns
Interface for continued configuration.

Implements GenerallyPositive.Browser.IAllowGPALUrlStorageData.

Definition at line 128 of file GPALUrl.cs.

◆ WithStorageDomain()

IAllowGPALUrlStorageItemConfig GenerallyPositive.Browser.GPALUrl.WithStorageDomain ( string domain)

Specifies the domain restriction for the most recently added storage action (mainly cookies).

Parameters
domainDomain (e.g. ".example.com", "sub.example.com").
Returns
Interface for continued configuration.

Implements GenerallyPositive.Browser.IAllowGPALUrlStorageItemConfig.

Definition at line 180 of file GPALUrl.cs.

◆ WithStorageKey()

IAllowGPALUrlStorageItemConfig GenerallyPositive.Browser.GPALUrl.WithStorageKey ( string key)

Specifies the key for the most recently added storage action.

Parameters
keyThe storage key (e.g. "sessionId", "theme").
Returns
Interface for continued configuration.

Ignored if no previous action exists or key is empty.

Implements GenerallyPositive.Browser.IAllowGPALUrlStorageItemConfig.

Definition at line 146 of file GPALUrl.cs.

◆ WithStoragePath()

IAllowGPALUrlStorageItemConfig GenerallyPositive.Browser.GPALUrl.WithStoragePath ( string path)

Specifies the path restriction for the most recently added storage action (mainly for cookies).

Parameters
pathCookie path (e.g. "/account", "/").
Returns
Interface for continued configuration.

Implements GenerallyPositive.Browser.IAllowGPALUrlStorageItemConfig.

Definition at line 163 of file GPALUrl.cs.

◆ WithStorageStoreName()

IAllowGPALUrlStorageItemConfig GenerallyPositive.Browser.GPALUrl.WithStorageStoreName ( string storeName)

Specifies the IndexedDB store name for the most recently added action.

Parameters
storeNameName of the object store.
Returns
Interface for continued configuration.

Implements GenerallyPositive.Browser.IAllowGPALUrlStorageItemConfig.

Definition at line 197 of file GPALUrl.cs.

◆ WithStorageType()

IAllowGPALUrlStorageItemConfig GenerallyPositive.Browser.GPALUrl.WithStorageType ( WebsiteStorageType type)

Specify the storage type for this storage action.

Parameters
typeType of storage action (cookies, localStorage, etc.).
Returns
Interface allowing further configuration of this action.

Implements GenerallyPositive.Browser.IAllowGPALUrlStorageType.

Definition at line 117 of file GPALUrl.cs.

◆ WithUserDefined()

IAllowGPALUrlStorageItemConfig GenerallyPositive.Browser.GPALUrl.WithUserDefined ( string userDefined)

Specifies the data to set.

Parameters
datadata (context sensistieve).
Returns
Interface for continued configuration.

Implements GenerallyPositive.Browser.IAllowGPALUrlStorageItemConfig.

Definition at line 214 of file GPALUrl.cs.

Property Documentation

◆ Url

string GenerallyPositive.Browser.GPALUrl.Url
get

Gets the target URL string.

Implements GenerallyPositive.Browser.IGPALUrl.

Definition at line 69 of file GPALUrl.cs.


The documentation for this class was generated from the following file: