Skip to content

Commit

Permalink
Partly fix detox with RN .44 + fix iOS demo proj build
Browse files Browse the repository at this point in the history
  • Loading branch information
d4vidi committed May 14, 2017
1 parent bad0508 commit 02bf7dc
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 12 deletions.
2 changes: 2 additions & 0 deletions demo/demoKeyboards.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class KeyboardView extends Component {
<Text style={{color: 'white'}}>HELOOOO!!!</Text>
<Text style={{color: 'white'}}>{this.props.title}</Text>
<TouchableOpacity
testID={'click-me'}
style={{padding: 20, marginTop: 30, backgroundColor: 'white'}}
onPress={() => this.onButtonPress()}
>
Expand Down Expand Up @@ -46,6 +47,7 @@ class AnotherKeyboardView extends Component {
<Text>*** ANOTHER ONE ***</Text>
<Text>{this.props.title}</Text>
<TouchableOpacity
testID={'toggle-fs'}
style={{padding: 20, marginTop: 30, backgroundColor: 'white'}}
onPress={() => this.onButtonPress()}
>
Expand Down
5 changes: 4 additions & 1 deletion demo/demoScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,17 @@ export default class AwesomeProject extends Component {
return [
{
text: 'show1',
testID: 'show1',
onPress: () => this.showKeyboardView('KeyboardView', 'FIRST - 1 (passed prop)'),
},
{
text: 'show2',
testID: 'show2',
onPress: () => this.showKeyboardView('AnotherKeyboardView', 'SECOND - 2 (passed prop)'),
},
{
text: 'reset',
testID: 'reset',
onPress: () => this.resetKeyboardView(),
},
];
Expand Down Expand Up @@ -98,7 +101,7 @@ export default class AwesomeProject extends Component {
<View style={{flexDirection: 'row'}}>
{
this.getToolbarButtons().map((button, index) =>
<TouchableOpacity onPress={button.onPress} style={{paddingLeft: 15, paddingBottom: 10}} key={index}>
<TouchableOpacity onPress={button.onPress} style={{paddingLeft: 15, paddingBottom: 10}} key={index} testID={button.testID}>
<Text>{button.text}</Text>
</TouchableOpacity>)
}
Expand Down
22 changes: 11 additions & 11 deletions e2e/sanity.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,29 @@ describe('Sanity', () => {

it('should switch between keyboards', async () => {
await element(by.id('input')).tap();
await element(by.label('show1')).tap();
await element(by.id('show1')).tap();
await expect(element(by.label('HELOOOO!!!'))).toBeVisible();
await element(by.label('show2')).tap();
await element(by.id('show2')).tap();
await expect(element(by.label('*** ANOTHER ONE ***'))).toBeVisible();
await element(by.label('reset')).tap();
await element(by.id('reset')).tap();
await expect(element(by.label('Keyboards example'))).toBeVisible();
});

it('should select item on the first demo keyboard', async () => {
await element(by.id('input')).tap();
await element(by.label('show1')).tap();
await element(by.id('show1')).tap();
await expect(element(by.label('HELOOOO!!!'))).toBeVisible();
await element(by.label('Click Me!')).tap();
await element(by.id('click-me')).tap();
await expect(element(by.id('demo-message'))).toBeVisible();
});

it('should expand the keyboard', async () => {
await element(by.id('input')).tap();
await expect(element(by.label('show2'))).toBeVisible();
await element(by.label('show2')).tap();
await element(by.label('Toggle Full-Screen!')).tap();
await expect(element(by.label('show2'))).toBeNotVisible();
await element(by.label('Toggle Full-Screen!')).tap();
await expect(element(by.label('show2'))).toBeVisible();
await expect(element(by.id('show2'))).toBeVisible();
await element(by.id('show2')).tap();
await element(by.id('toggle-fs')).tap();
await expect(element(by.id('show2'))).toBeNotVisible();
await element(by.id('toggle-fs')).tap();
await expect(element(by.id('show2'))).toBeVisible();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
BuildableName = "libReact.a"
BlueprintName = "React"
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
Expand Down

0 comments on commit 02bf7dc

Please sign in to comment.