-
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.
iOS(Test App): write failed detox tests (to reproduce #2834).
Failed test: `scroll interactions -> should not be intractable when overlay is shown`.
- Loading branch information
Showing
4 changed files
with
111 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
const { expectToThrow } = require('./utils/custom-expects'); | ||
|
||
describe(':ios: Overlay', () => { | ||
let showOverlayButton; | ||
let verticalScrollView; | ||
|
||
beforeEach(async () => { | ||
await device.reloadReactNative(); | ||
await device.launchApp({newInstance: true}); | ||
|
||
await element(by.text('Overlay')).tap(); | ||
|
||
showOverlayButton = await element(by.id('ShowOverlayButton')); | ||
await expect(showOverlayButton).toBeVisible(); | ||
|
||
verticalScrollView = await element(by.id('VerticalScrollView')); | ||
}); | ||
|
||
describe('button', () => { | ||
it('should be visible when overlay is not shown', async () => { | ||
await expect(verticalScrollView).toBeVisible(); | ||
}); | ||
|
||
it('should not be visible when overlay is not shown', async () => { | ||
await showOverlayButton.tap(); | ||
await expect(verticalScrollView).not.toBeVisible(); | ||
}); | ||
|
||
it('should not be intractable when overlay is shown', async () => { | ||
await showOverlayButton.tap(); | ||
await expectToThrow(() => showOverlayButton.tap()); | ||
}); | ||
}); | ||
|
||
describe('scroll interactions', () => { | ||
it('should be intractable when overlay is not shown', async () => { | ||
await verticalScrollView.scrollTo('bottom'); | ||
await expect(showOverlayButton).not.toBeVisible(); | ||
}); | ||
|
||
it('should not be intractable when overlay is shown', async () => { | ||
await showOverlayButton.tap(); | ||
await expectToThrow(() => verticalScrollView.scrollTo('bottom')); | ||
}); | ||
}); | ||
}); |
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,59 @@ | ||
import React, { Component } from 'react'; | ||
import { View, ScrollView, TouchableOpacity, StyleSheet, Text, NativeModules, Dimensions } from 'react-native'; | ||
|
||
const { NativeModule } = NativeModules; | ||
|
||
export default class OverlayScreen extends Component { | ||
render() { | ||
return ( | ||
<ScrollView style={styles.container} testID='VerticalScrollView'> | ||
<TouchableOpacity onPress={() => NativeModule.presentOverlayWindow()} style={styles.button} testID='ShowOverlayButton'> | ||
<Text style={styles.text}>Show Overlay</Text> | ||
</TouchableOpacity> | ||
|
||
<View style={styles.item}><Text style={styles.itemText}>Text1</Text></View> | ||
<View style={styles.item}><Text style={styles.itemText}>Text2</Text></View> | ||
<View style={styles.item}><Text style={styles.itemText}>Text3</Text></View> | ||
<View style={styles.item}><Text style={styles.itemText}>Text4</Text></View> | ||
<View style={styles.item}><Text style={styles.itemText}>Text5</Text></View> | ||
<View style={styles.item}><Text style={styles.itemText}>Text6</Text></View> | ||
<View style={styles.item}><Text style={styles.itemText}>Text7</Text></View> | ||
<View style={styles.item}><Text style={styles.itemText}>Text8</Text></View> | ||
<View style={styles.item}><Text style={styles.itemText}>Text9</Text></View> | ||
<View style={styles.item}><Text style={styles.itemText}>Text10</Text></View> | ||
</ScrollView> | ||
); | ||
} | ||
} | ||
|
||
const { height } = Dimensions.get('window'); | ||
const itemHeight = height / 10 + 50; | ||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1 | ||
}, | ||
button: { | ||
backgroundColor: '#ffd9d9', | ||
height: itemHeight, | ||
justifyContent: "center", | ||
alignItems: "center", | ||
margin: 10 | ||
}, | ||
text: { | ||
fontSize: 18, | ||
color: '#000000', | ||
textAlign: 'center' | ||
}, | ||
item: { | ||
height: itemHeight, | ||
backgroundColor: '#d9d9ff', | ||
justifyContent: "center", | ||
alignItems: "center", | ||
margin: 10 | ||
}, | ||
itemText: { | ||
fontSize: 18, | ||
color: '#525252', | ||
textAlign: 'center' | ||
} | ||
}); |
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