Skip to content
This repository has been archived by the owner on Jun 15, 2022. It is now read-only.

Commit

Permalink
Refactor e2e helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
johnny243 committed Mar 29, 2020
1 parent 57a0ba3 commit 839084b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
8 changes: 8 additions & 0 deletions e2e/helpers.js
@@ -0,0 +1,8 @@
module.exports.openSettingsScreen = async () => {
await device.reloadReactNative();

// Opens the settings screen
await waitFor(element(by.id('rootView'))).toBeVisible().withTimeout(2000);
await element(by.id('headerButton')).tap();
await element(by.id('settingsButton')).tap();
};
1 change: 1 addition & 0 deletions src/screens/Abstract.js
Expand Up @@ -15,6 +15,7 @@ const IoniconsHeaderButton = passMeFurther => (
// and it is important to pass those props to `HeaderButton`
// then you may add some information like icon size or color (if you use icons)
<HeaderButton
testID="headerButton"
{...passMeFurther}
IconComponent={Icon}
iconSize={30}
Expand Down
1 change: 0 additions & 1 deletion src/screens/Notes/NoteList.js
Expand Up @@ -14,7 +14,6 @@ export default class NoteList extends ThemedComponent {

return (
<View
testID="noteListHeader"
style={{
paddingLeft: 5,
paddingRight: 5,
Expand Down
5 changes: 4 additions & 1 deletion src/screens/SideMenu/MainSideMenu.js
Expand Up @@ -336,7 +336,10 @@ export default class MainSideMenu extends AbstractSideMenu {
size={29}
paddingTop={ApplicationState.isIOS ? 2 : 0}
iconTextComponent={
<Icon name={StyleKit.nameForIcon(ICON_SETTINGS)} />
<Icon
testID="settingsButton"
name={StyleKit.nameForIcon(ICON_SETTINGS)}
/>
}
/>

Expand Down

0 comments on commit 839084b

Please sign in to comment.