-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added waitFor to API which allows to wait for things to happen, the f…
…irst one is waiting for an element to be visible while scrolling
- Loading branch information
talkol
committed
Oct 9, 2016
1 parent
38a9e25
commit cfc9587
Showing
9 changed files
with
168 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
describe('WaitFor', function () { | ||
|
||
beforeEach(function (done) { | ||
simulator.reloadReactNativeApp(done); | ||
}); | ||
|
||
beforeEach(function () { | ||
element(by.label('WaitFor')).tap(); | ||
}); | ||
|
||
it('should find element by scrolling until it is visible', function () { | ||
expect(element(by.label('Text5'))).toBeNotVisible(); | ||
waitFor(element(by.label('Text5'))).toBeVisible().whileElement(by.id('ScrollView630')).scroll(50, 'down'); | ||
expect(element(by.label('Text5'))).toBeVisible(); | ||
}); | ||
|
||
}); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import React, { Component } from 'react'; | ||
import { | ||
Text, | ||
View, | ||
TouchableOpacity, | ||
TextInput, | ||
ScrollView | ||
} from 'react-native'; | ||
|
||
export default class WaitForScreen extends Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
greeting: undefined | ||
}; | ||
} | ||
|
||
render() { | ||
if (this.state.greeting) return this.renderAfterButton(); | ||
return ( | ||
<View style={{flex: 1, paddingTop: 40, justifyContent: 'flex-start'}}> | ||
|
||
<View style={{height: 100, borderColor: '#c0c0c0', borderWidth: 1, backgroundColor: '#f8f8ff', marginBottom: 20}}> | ||
<ScrollView testID='ScrollView630'> | ||
<Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text1</Text> | ||
<Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text2</Text> | ||
<Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text3</Text> | ||
<Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text4</Text> | ||
<Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text5</Text> | ||
<Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text6</Text> | ||
<Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text7</Text> | ||
<Text style={{height: 30, backgroundColor: '#e8e8f8', padding: 5, margin: 10}}>Text8</Text> | ||
</ScrollView> | ||
</View> | ||
|
||
</View> | ||
); | ||
} | ||
|
||
renderAfterButton() { | ||
return ( | ||
<View style={{flex: 1, paddingTop: 20, justifyContent: 'center', alignItems: 'center'}}> | ||
<Text style={{fontSize: 25}}> | ||
{this.state.greeting}!!! | ||
</Text> | ||
</View> | ||
); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters