-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add chat-screen.spec, add testIDs and fix chat-screen issues
- Loading branch information
Showing
4 changed files
with
77 additions
and
20 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const Utils = require('./utils') | ||
|
||
describe('Chat Screen Tests', () => { | ||
before(async () => { | ||
await device.reloadReactNative() | ||
await Utils.loginAsUser() | ||
}) | ||
after(async () => { | ||
await element(by.type('_UIBackButtonContainerView')).tap() | ||
await Utils.logout() | ||
}) | ||
|
||
beforeEach(async () => { | ||
await device.reloadReactNative() | ||
await navigateToChatScreen() | ||
}) | ||
|
||
const navigateToChatScreen = async () => { | ||
await expect(element(by.id('launchScreen'))).toBeVisible() | ||
await element(by.id('menuButton')).tap() | ||
await element(by.id('chatDrawerButton')).tap() | ||
} | ||
|
||
const sendChat = async (message) => { | ||
await element(by.id('chatScreenInput')).replaceText(message) | ||
await element(by.id('chatScreenSendButton')).tap() | ||
} | ||
|
||
it('should display the chat screen and message input', async () => { | ||
await expect(element(by.id('chatScreen'))).toBeVisible() | ||
await expect(element(by.id('chatScreenInput'))).toBeVisible() | ||
}) | ||
|
||
it('should send a chat message then display it', async () => { | ||
await sendChat('Java Hipster') | ||
await expect(element(by.text('Java Hipster'))).toBeVisible() | ||
}) | ||
}) |
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