Skip to content

Commit

Permalink
refactpr example and fix
Browse files Browse the repository at this point in the history
  • Loading branch information
potapovDim committed Jan 27, 2019
1 parent b1e4c6d commit e3cc4d8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
8 changes: 4 additions & 4 deletions awb.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ElementAWB as ElAWB, ElementsAWB as ElsAWB } from './lib/element'
import { Client } from './lib/client'
import { Config } from './lib/config'
import {ElementAWB as ElAWB, ElementsAWB as ElsAWB} from './lib/element'
import {Client} from './lib/client'
import {Config} from './lib/config'

interface ElementInit {
(selector: string): ElAWB;
Expand All @@ -12,7 +12,7 @@ interface ElementsInit {

export = AWB;

declare function AWB(conf?: Config): { element: ElementInit, elements: ElementsInit, client: Client, $: ElementInit, $$: ElementsInit }
declare function AWB(conf?: Config): {element: ElementInit, elements: ElementsInit, client: Client, $: ElementInit, $$: ElementsInit}

declare namespace AWB {
export type Conf = Config
Expand Down
6 changes: 5 additions & 1 deletion examples/driver.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
const awb = require('../awb')({ browser: 'chrome', directConnection: true })
const awb = require('../awb')({
desiredCapabilities: {
javascriptEnabled: true, acceptSslCerts: true, platform: 'ANY', browserName: 'firefox'
}, host: 'http://localhost:9090', remote: true
})

module.exports = awb
2 changes: 1 addition & 1 deletion examples/po/google.po.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const {$, $$} = require('../driver')
class Google {
constructor() {
this.submitSearch = $('body').$('.tsf-p').$('[name="btnK"]').waitForClickable(1000)
this.inputSearch = $('#lst-ib')
this.inputSearch = $('[name="q"]')
this.resultSearch = $('#ires .g').waitForElementVisible(1000)
this.input4 = $$('input').get(4)
}
Expand Down
4 changes: 2 additions & 2 deletions lib/proxySubCalls.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ async function waitPresent(that, findElement, present, tagName, time) {
async function waitClicable(that, findElement, present, displayed, tagName, time) {
const lessTime = await waitEl(that, findElement, tagName, time)
const {error: errorPresent, time: timePresent} = await waitCondition(present, (resp) => resp.value, lessTime, that.sessionId, that.elementId)
if(errorPresent) throw new InterfaceError(JSON.stringify(error))
if(errorPresent) throw new InterfaceError(JSON.stringify(errorPresent))
const {error: errorDisplay, time: timeDisplayed} = await waitCondition(displayed, (resp) => resp.value, timePresent, that.sessionId, that.elementId)
if(errorDisplay) throw new InterfaceError(JSON.stringify(error))
if(errorDisplay) throw new InterfaceError(JSON.stringify(errorDisplay))
return timeDisplayed
}

Expand Down

0 comments on commit e3cc4d8

Please sign in to comment.