C# Class Machete.Test.Selenium.View.sharedUI

显示文件 Open project: SavageLearning/Machete Class Usage Examples

Public Properties

Property Type Description
_d IWebDriver
maxwait int

Public Methods

Method Description
GetID ( string s ) : string
GetOptionIndex ( By by ) : int
GetOptionText ( By by ) : string
GetOptionText ( IWebElement elem ) : string
GetOptionValue ( By by ) : string
RandomString ( int size ) : string
ReplaceElementText ( By by, string text ) : bool
SelectOption ( By by, string opttext ) : bool
SelectOptionByIndex ( By by, int index ) : bool
SelectOptionByValue ( By by, string optvalue ) : bool
SolutionDirectory ( ) : string
WaitAndDoubleClick ( By by ) : bool
WaitForElement ( By by ) : IWebElement
WaitForElementDisplayed ( By by ) : IWebElement
WaitForElementExists ( By by ) : bool
WaitForElementValue ( By by, string value ) : bool

Wait for both an element to exist and for the specified value to be present.

WaitForText ( String what ) : bool
WaitForText ( String what, int waitfor ) : bool
WaitThenClickElement ( By by ) : bool
activityCreate ( Activity _act ) : bool
activityMenuLink ( ) : bool
activitySignIn ( string idPrefix, int dwccardnum ) : bool
activitySignInIsSanctioned ( ) : bool
activitySignInValidate ( string idPrefix, int dwccardnum, int rowcount ) : bool
activityValidate ( Activity _act ) : bool
confirmWorkerDeleted ( ) : bool
createSomeWorkers ( int numWorkers, DbSet workers ) : bool
elementExists ( By by ) : bool
employerCreate ( Employer _emp ) : bool

employerDelete ( Employer _emp ) : bool
employerValidate ( Employer _emp ) : bool

eventCreate ( Event _ev ) : bool
eventValidate ( Event &_ev ) : bool
getSelectedTabRecordID ( string cssClass ) : int
gotoMachete ( ) : bool
login ( ) : bool

logout ( ) : bool
nextAvailableDwccardnum ( MacheteContext DB ) : int
personCreate ( Person _per ) : bool
personValidate ( Person _per ) : bool
refreshCache ( ) : bool
sharedUI ( IWebDriver driver, string url ) : System
workAssignmentActivate ( Employer _emp, WorkOrder _wo, WorkAssignment _wa ) : bool

Activate work order. Assumes start at WA ListTab.

workAssignmentCreate ( Employer emp, WorkOrder wo, WorkAssignment wa ) : bool

Create new assignment. Last action executes Create Button, returning to List Tab.

workAssignmentValidate ( Employer _emp, WorkOrder _wo, WorkAssignment _wa ) : bool
workOrderCreate ( Employer _emp, WorkOrder _wo ) : bool
workOrderValidate ( WorkOrder _wo ) : bool
workerCreate ( Worker _wkr, string imagepath ) : bool
workerDelete ( Worker _wkr ) : bool
workerSanction ( Worker _wkr ) : bool
workerValidate ( Worker _wkr ) : bool

Private Methods

Method Description
IsElementPresent ( By by ) : IWebElement

Returns element or null if not found. Catches Selenium exceptions.

IsElementValuePresent ( By by, string value ) : bool

Find element by the given By object and return true if the value matches the attribute value.

isTextPresent ( String what, IWebDriver driver ) : bool

Method Details

GetID() public static method

public static GetID ( string s ) : string
s string
return string

GetOptionIndex() public method

public GetOptionIndex ( By by ) : int
by OpenQA.Selenium.By
return int

GetOptionText() public method

public GetOptionText ( By by ) : string
by OpenQA.Selenium.By
return string

GetOptionText() public method

public GetOptionText ( IWebElement elem ) : string
elem IWebElement
return string

GetOptionValue() public method

public GetOptionValue ( By by ) : string
by OpenQA.Selenium.By
return string

RandomString() public method

public RandomString ( int size ) : string
size int
return string

ReplaceElementText() public method

public ReplaceElementText ( By by, string text ) : bool
by OpenQA.Selenium.By
text string
return bool

SelectOption() public method

public SelectOption ( By by, string opttext ) : bool
by OpenQA.Selenium.By
opttext string
return bool

SelectOptionByIndex() public method

public SelectOptionByIndex ( By by, int index ) : bool
by OpenQA.Selenium.By
index int
return bool

SelectOptionByValue() public method

public SelectOptionByValue ( By by, string optvalue ) : bool
by OpenQA.Selenium.By
optvalue string
return bool

SolutionDirectory() public static method

public static SolutionDirectory ( ) : string
return string

WaitAndDoubleClick() public method

public WaitAndDoubleClick ( By by ) : bool
by OpenQA.Selenium.By
return bool

WaitForElement() public method

public WaitForElement ( By by ) : IWebElement
by OpenQA.Selenium.By
return IWebElement

WaitForElementDisplayed() public method

public WaitForElementDisplayed ( By by ) : IWebElement
by OpenQA.Selenium.By
return IWebElement

WaitForElementExists() public method

public WaitForElementExists ( By by ) : bool
by OpenQA.Selenium.By
return bool

WaitForElementValue() public method

Wait for both an element to exist and for the specified value to be present.
public WaitForElementValue ( By by, string value ) : bool
by OpenQA.Selenium.By
value string
return bool

WaitForText() public method

public WaitForText ( String what ) : bool
what String
return bool

WaitForText() public method

public WaitForText ( String what, int waitfor ) : bool
what String
waitfor int
return bool

WaitThenClickElement() public method

public WaitThenClickElement ( By by ) : bool
by OpenQA.Selenium.By
return bool

activityCreate() public method

public activityCreate ( Activity _act ) : bool
_act Machete.Domain.Activity
return bool

activityMenuLink() public method

public activityMenuLink ( ) : bool
return bool

activitySignIn() public method

public activitySignIn ( string idPrefix, int dwccardnum ) : bool
idPrefix string
dwccardnum int
return bool

activitySignInIsSanctioned() public method

public activitySignInIsSanctioned ( ) : bool
return bool

activitySignInValidate() public method

public activitySignInValidate ( string idPrefix, int dwccardnum, int rowcount ) : bool
idPrefix string
dwccardnum int
rowcount int
return bool

activityValidate() public method

public activityValidate ( Activity _act ) : bool
_act Machete.Domain.Activity
return bool

confirmWorkerDeleted() public method

public confirmWorkerDeleted ( ) : bool
return bool

createSomeWorkers() public method

public createSomeWorkers ( int numWorkers, DbSet workers ) : bool
numWorkers int
workers DbSet
return bool

elementExists() public method

public elementExists ( By by ) : bool
by OpenQA.Selenium.By
return bool

employerCreate() public method

public employerCreate ( Employer _emp ) : bool
_emp Machete.Domain.Employer
return bool

employerDelete() public method

public employerDelete ( Employer _emp ) : bool
_emp Machete.Domain.Employer
return bool

employerValidate() public method

public employerValidate ( Employer _emp ) : bool
_emp Machete.Domain.Employer
return bool

eventCreate() public method

public eventCreate ( Event _ev ) : bool
_ev Machete.Domain.Event
return bool

eventValidate() public method

public eventValidate ( Event &_ev ) : bool
_ev Machete.Domain.Event
return bool

getSelectedTabRecordID() public method

public getSelectedTabRecordID ( string cssClass ) : int
cssClass string
return int

gotoMachete() public method

public gotoMachete ( ) : bool
return bool

login() public method

public login ( ) : bool
return bool

logout() public method

public logout ( ) : bool
return bool

nextAvailableDwccardnum() public static method

public static nextAvailableDwccardnum ( MacheteContext DB ) : int
DB MacheteContext
return int

personCreate() public method

public personCreate ( Person _per ) : bool
_per Person
return bool

personValidate() public method

public personValidate ( Person _per ) : bool
_per Person
return bool

refreshCache() public method

public refreshCache ( ) : bool
return bool

sharedUI() public method

public sharedUI ( IWebDriver driver, string url ) : System
driver IWebDriver
url string
return System

workAssignmentActivate() public method

Activate work order. Assumes start at WA ListTab.
public workAssignmentActivate ( Employer _emp, WorkOrder _wo, WorkAssignment _wa ) : bool
_emp Employer
_wo WorkOrder
_wa WorkAssignment
return bool

workAssignmentCreate() public method

Create new assignment. Last action executes Create Button, returning to List Tab.
public workAssignmentCreate ( Employer emp, WorkOrder wo, WorkAssignment wa ) : bool
emp Employer
wo WorkOrder
wa WorkAssignment
return bool

workAssignmentValidate() public method

public workAssignmentValidate ( Employer _emp, WorkOrder _wo, WorkAssignment _wa ) : bool
_emp Employer
_wo WorkOrder
_wa WorkAssignment
return bool

workOrderCreate() public method

public workOrderCreate ( Employer _emp, WorkOrder _wo ) : bool
_emp Employer
_wo WorkOrder
return bool

workOrderValidate() public method

public workOrderValidate ( WorkOrder _wo ) : bool
_wo WorkOrder
return bool

workerCreate() public method

public workerCreate ( Worker _wkr, string imagepath ) : bool
_wkr Worker
imagepath string
return bool

workerDelete() public method

public workerDelete ( Worker _wkr ) : bool
_wkr Worker
return bool

workerSanction() public method

public workerSanction ( Worker _wkr ) : bool
_wkr Worker
return bool

workerValidate() public method

public workerValidate ( Worker _wkr ) : bool
_wkr Worker
return bool

Property Details

_d public_oe property

public IWebDriver _d
return IWebDriver

maxwait public_oe property

public int maxwait
return int