Interface Casper

Hierarchy

Index

Properties

Methods

Properties

public __utils__: ClientUtils

public options: CasperOptions

public test: Tester

Methods

public back(): Casper

Returns

Casper

public base64encode(url: string, method?: string, data?: any): string

Parameters

  • url: string
  • method?: string optional
  • data?: any optional

Returns

string

public bypass(nb: number): any

Parameters

  • nb: number

Returns

any

public capture(targetFilePath: string, clipRect: ClipRect): Casper

Parameters

  • targetFilePath: string
  • clipRect: ClipRect

Returns

Casper

public captureBase64(format: string): string

Parameters

  • format: string

Returns

string

public captureBase64(format: string, area: string): string

Parameters

  • format: string
  • area: string

Returns

string

public captureBase64(format: string, area: ClipRect): string

Parameters

Returns

string

public captureBase64(format: string, area: any): string

Parameters

  • format: string
  • area: any

Returns

string

public captureSelector(targetFile: string, selector: string): Casper

Parameters

  • targetFile: string
  • selector: string

Returns

Casper

public clear(): Casper

Returns

Casper

public click(selector: string): boolean

Parameters

  • selector: string

Returns

boolean

public clickLabel(label: string, tag?: string): boolean

Parameters

  • label: string
  • tag?: string optional

Returns

boolean

public constructor(options: CasperOptions): Casper

Parameters

Returns

Casper

public debugHTML(selector?: string, outer?: boolean): Casper

Parameters

  • selector?: string optional
  • outer?: boolean optional

Returns

Casper

public debugPage(): Casper

Returns

Casper

public die(message: string, status?: number): Casper

Parameters

  • message: string
  • status?: number optional

Returns

Casper

public download(url: string, target?: string, method?: string, data?: any): Casper

Parameters

  • url: string
  • target?: string optional
  • method?: string optional
  • data?: any optional

Returns

Casper

public each(array: Array<T>, fn: (self: Casper, item: T, index: number) => void): Casper

Parameters

  • array: Array<T>
  • fn: (self: Casper, item: T, index: number) => void

Returns

Casper

public echo(message: string, style?: string): Casper

Parameters

  • message: string
  • style?: string optional

Returns

Casper

public evaluate(fn: () => T, args?: Array<any>): T

Parameters

  • fn: () => T
  • args?: Array<any> optional

Returns

T

public evaluateOrDie(fn: () => any, message?: string, status?: number): Casper

Parameters

  • fn: () => any
  • message?: string optional
  • status?: number optional

Returns

Casper

public exists(selector: string): boolean

Parameters

  • selector: string

Returns

boolean

public exit(status?: number): Casper

Parameters

  • status?: number optional

Returns

Casper

public fetchText(selector: string): string

Parameters

  • selector: string

Returns

string

public fill(selector: string, values: any, submit?: boolean)

Parameters

  • selector: string
  • values: any
  • submit?: boolean optional

public fillSelectors(selector: string, values: any, submit?: boolean)

Parameters

  • selector: string
  • values: any
  • submit?: boolean optional

public fillXPath(selector: string, values: any, submit?: boolean)

Parameters

  • selector: string
  • values: any
  • submit?: boolean optional

public forward(): Casper

Returns

Casper

public getCurrentUrl(): string

Returns

string

public getElementAttribute(selector: string, attribute: string): string

Parameters

  • selector: string
  • attribute: string

Returns

string

public getElementBounds(selector: string): ElementBounds

Parameters

  • selector: string

Returns

ElementBounds

public getElementInfo(selector: string): ElementInfo

Parameters

  • selector: string

Returns

ElementInfo

public getElementsAttribute(selector: string, attribute: string): string

Parameters

  • selector: string
  • attribute: string

Returns

string

public getElementsBounds(selector: string): ElementBounds[]

Parameters

  • selector: string

Returns

ElementBounds[]

public getElementsInfo(selector: string): ElementInfo

Parameters

  • selector: string

Returns

ElementInfo

public getFormValues(selector: string): any

Parameters

  • selector: string

Returns

any

public getGlobal(name: string): any

Parameters

  • name: string

Returns

any

public getHTML(selector?: string, outer?: boolean): string

Parameters

  • selector?: string optional
  • outer?: boolean optional

Returns

string

public getPageContent(): string

Returns

string

public getTitle(): string

Returns

string

public log(message: string, level?: string, space?: string): Casper

Parameters

  • message: string
  • level?: string optional
  • space?: string optional

Returns

Casper

public mouseEvent(type: string, selector: string): boolean

Parameters

  • type: string
  • selector: string

Returns

boolean

public open(location: string, settings: OpenSettings): Casper

Parameters

Returns

Casper

public reload(then?: (response: HttpResponse) => void): Casper

Parameters

  • then?: (response: HttpResponse) => void optional

Returns

Casper

public removeAllFilters(filter: string): Casper

Parameters

  • filter: string

Returns

Casper

public repeat(times: number, then: Function): Casper

Parameters

  • times: number
  • then: Function

Returns

Casper

public resourceExists(test: Function): boolean

Parameters

  • test: Function

Returns

boolean

public resourceExists(test: string): boolean

Parameters

  • test: string

Returns

boolean

public run(onComplete: Function, time?: number): Casper

Parameters

  • onComplete: Function
  • time?: number optional

Returns

Casper

public scrollTo(x: number, y: number): Casper

Parameters

  • x: number
  • y: number

Returns

Casper

public scrollToBottom(): Casper

Returns

Casper

public sendKeys(selector: string, keys: string, options?: any): Casper

Parameters

  • selector: string
  • keys: string
  • options?: any optional

Returns

Casper

public setFilter(filter: string, cb: Function): boolean

Parameters

  • filter: string
  • cb: Function

Returns

boolean

public setHttpAuth(username: string, password: string): Casper

Parameters

  • username: string
  • password: string

Returns

Casper

public start(url?: string, then?: (response: HttpResponse) => void): Casper

Parameters

  • url?: string optional
  • then?: (response: HttpResponse) => void optional

Returns

Casper

public status(asString: boolean): any

Parameters

  • asString: boolean

Returns

any

public then(fn: (self?: Casper) => void): Casper

Parameters

  • fn: (self?: Casper) => void

Returns

Casper

public thenBypass(nb: number): Casper

Parameters

  • nb: number

Returns

Casper

public thenBypassIf(condition: any, nb: number): Casper

Parameters

  • condition: any
  • nb: number

Returns

Casper

public thenBypassUnless(condition: any, nb: number): Casper

Parameters

  • condition: any
  • nb: number

Returns

Casper

public thenClick(selector: string): Casper

Parameters

  • selector: string

Returns

Casper

public thenEvaluate(fn: () => any, args?: Array<any>): Casper

Parameters

  • fn: () => any
  • args?: Array<any> optional

Returns

Casper

public thenOpen(location: string, then?: (response: HttpResponse) => void): Casper

Parameters

  • location: string
  • then?: (response: HttpResponse) => void optional

Returns

Casper

public thenOpen(location: string, options?: OpenSettings, then?: (response: HttpResponse) => void): Casper

Parameters

  • location: string
  • options?: OpenSettings optional
  • then?: (response: HttpResponse) => void optional

Returns

Casper

public thenOpenAndEvaluate(location: string, then?: Function, args?: Array<any>): Casper

Parameters

  • location: string
  • then?: Function optional
  • args?: Array<any> optional

Returns

Casper

public toString(): string

Returns

string

public unwait(): Casper

Returns

Casper

public userAgent(agent: string): string

Parameters

  • agent: string

Returns

string

public viewport(width: number, height: number): Casper

Parameters

  • width: number
  • height: number

Returns

Casper

public visible(selector: string): boolean

Parameters

  • selector: string

Returns

boolean

public wait(timeout: number, then?: Function): Casper

Parameters

  • timeout: number
  • then?: Function optional

Returns

Casper

public waitFor(testFx: Function, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • testFx: Function
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitForAlert(then: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • then: Function
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitForPopup(urlPattern: string, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • urlPattern: string
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitForPopup(urlPattern: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • urlPattern: RegExp
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitForResource(testFx: Function, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • testFx: Function
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitForSelector(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • selector: string
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitForText(pattern: string, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • pattern: string
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitForText(pattern: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • pattern: RegExp
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitForUrl(url: string, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • url: string
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitForUrl(url: RegExp, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • url: RegExp
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitUntilVisible(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • selector: string
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitWhileSelector(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • selector: string
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public waitWhileVisible(selector: string, then?: Function, onTimeout?: Function, timeout?: number): Casper

Parameters

  • selector: string
  • then?: Function optional
  • onTimeout?: Function optional
  • timeout?: number optional

Returns

Casper

public warn(message: string): Casper

Parameters

  • message: string

Returns

Casper

public withFrame(frameInfo: string, then: Function): Casper

Parameters

  • frameInfo: string
  • then: Function

Returns

Casper

public withFrame(frameInfo: number, then: Function): Casper

Parameters

  • frameInfo: number
  • then: Function

Returns

Casper

public withPopup(popupInfo: string, step: Function): Casper

Parameters

  • popupInfo: string
  • step: Function

Returns

Casper

public withPopup(popupInfo: RegExp, step: Function): Casper

Parameters

  • popupInfo: RegExp
  • step: Function

Returns

Casper

public zoom(factor: number): Casper

Parameters

  • factor: number

Returns

Casper