Skip to content

Instantly share code, notes, and snippets.

View mfrachet's full-sized avatar
💭
😊

Marvin Frachet mfrachet

💭
😊
View GitHub Profile
@mfrachet
mfrachet / detox-describe.js
Last active August 22, 2017 09:49
detox-describe
describe('Example', () => {
beforeEach(async () => {
await device.reloadReactNative();
});
describe('Test describe block', () => {
it('should make something great', async () => {
// core of the async test
});
});
@mfrachet
mfrachet / detox-testid.js
Last active August 22, 2017 06:07
detox-testid
<TextInput
placeholderTextColor="#dddddd"
style={[styles.main, styles.textColor]}
placeholder="Add a new todo item"
onChangeText={this.handleInputChanges}
value={inputValue}
testID="inputAdder"
/>
@mfrachet
mfrachet / detox-findbyid.js
Last active August 22, 2017 06:15
detox-findbyid
describe('Handle changes on input text', () => {
it('should have...', async () => {
const itemAdder = await element(by.id('inputAdder'));
// some actions and expectations
});
});
@mfrachet
mfrachet / detox-findbyid-touchable.js
Created August 22, 2017 06:14
detox-findbyid-touchable
describe('Handle changes on input text', () => {
it('should have...', async () => {
const itemAdder = await element(by.id('inputAdder'));
const touchableAdder = await element(by.id('touchableAdder'));
// some actions and expectations
});
});
@mfrachet
mfrachet / detox-fill-input.js
Last active June 14, 2018 23:40
detox-fill-input
describe('Handle changes on input text', () => {
it('should have...', async () => {
const itemAdder = await element(by.id('inputAdder'));
const touchableAdder = await element(by.id('touchableAdder'));
// Focus the input field
await itemAdder.tap();
await itemAdder.typeText('Item');
// expectations
});
@mfrachet
mfrachet / detox-assertion.js
Last active August 22, 2017 11:50
detox-assertion
describe('Handle changes on input text', () => {
it('should have displayed the Add button when a text is filled in the input', async () => {
const itemAdder = await element(by.id('inputAdder'));
const touchableAdder = await element(by.id('touchableAdder'));
// Check that it's not visible before typing text
await expect(touchableAdder).toBeNotVisible();
// Focus the input field
await itemAdder.tap();
@mfrachet
mfrachet / detox-packagejson.json
Last active August 23, 2017 05:52
detox-packagejson
{
"detox": {
"configurations": {
"ios.sim.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/detoxExample.app",
"build": "xcodebuild -project ios/detoxExample.xcodeproj -scheme detoxExample -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 7"
}
}
@mfrachet
mfrachet / detox-packagejson-conf.json
Last active August 24, 2017 14:23
detox-packagejson-conf
{
"configurations": {
"ios.sim7.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/detoxExample.app",
"build": "xcodebuild -project ios/detoxExample.xcodeproj -scheme detoxExample -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
"type": "ios.simulator",
"name": "iPhone 7"
},
"ios.sim6.debug": {
"binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/detoxExample.app",
MessageQueue.spy(true) // will display every messages sent and received in the console.
@mfrachet
mfrachet / hello-world.js
Created September 21, 2017 10:14
RN Eu
<View style={style.blue}>
<Text>Hello world !</Text>
</View>