Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions e2e/pageobjects/Home/SidebarScreen.page.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ class SidebarScreen {
get chatButton() {
return $('android=new UiSelector().text("Chat")');
}
get followerRequestsButton() {
return $('android=new UiSelector().text("Follower requests")');
}
get currentUsername() {
return $('~sidebar-current-username');
}
Expand Down Expand Up @@ -123,8 +120,7 @@ class SidebarScreen {
(await this.accountSwitcherButton.isDisplayed()) &&
(await this.settingsButton.isDisplayed()) &&
(await this.profileButton.isDisplayed()) &&
(await this.chatButton.isDisplayed()) &&
(await this.followerRequestsButton.isDisplayed())
(await this.chatButton.isDisplayed())
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion e2e/specs/logout.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Logout Flow', () => {
it('should not show start screen when side swiping and logged in', async () => {
await driver.back();
await driver.back();
await driver.activateApp('com.raven.app');
await driver.activateApp('space.cmp27.raven');
await ForYouScreen.forYouTab.waitForDisplayed();
await expect(await ForYouScreen.isDisplayed()).toBe(true);
});
Expand Down
27 changes: 15 additions & 12 deletions e2e/specs/notifications.e2e.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, driver } from '@wdio/globals';
import { driver, expect } from '@wdio/globals';

import ForYouScreen from '../pageobjects/Home/ForYouScreen.page';
import LoginEmailScreen from '../pageobjects/Login/LoginEmail.page';
Expand All @@ -7,6 +7,7 @@ import AllNotificationsScreen from '../pageobjects/Notifications/AllNotification
import MentionsScreen from '../pageobjects/Notifications/MentionsScreen.page';
import ProfileScreen from '../pageobjects/Profile/ProfileScreen.page';
import StartScreen from '../pageobjects/StartScreen.page';
import TweetComposerScreen from '../pageobjects/Tweets/TweetComposerScreen.page';
import TweetDetailsScreen from '../pageobjects/Tweets/TweetDetailsScreen.page';
import { changeUsername } from '../utils/changeUsername';
import { createTestTweets } from '../utils/createTestTweets';
Expand Down Expand Up @@ -47,14 +48,14 @@ describe('Notifications Flow', () => {

describe('Follow notifications', () => {
before(async () => {
const numOfFollowers = 6;
const numOfFollowers = 1;
await followUser(testUser.username, numOfFollowers);
});

it('should show all follow notifications after users follow me', async () => {
await AllNotificationsScreen.refresh();
await expect(await AllNotificationsScreen.followNotifications.length).toBe(6);
await expect(await AllNotificationsScreen.followBackButton.length).toBe(6);
await expect(await AllNotificationsScreen.followNotifications.length).toBe(1);
await expect(await AllNotificationsScreen.followBackButton.length).toBe(1);
});

it('should correctly handle following back a user from notifications list', async () => {
Expand All @@ -77,7 +78,7 @@ describe('Notifications Flow', () => {
await ProfileScreen.goBack();
await AllNotificationsScreen.followingButton[0].click();
await expect(await AllNotificationsScreen.followingButton.length).toBe(0);
await expect(await AllNotificationsScreen.followBackButton.length).toBe(6);
await expect(await AllNotificationsScreen.followBackButton.length).toBe(1);
await AllNotificationsScreen.followNotifications[0].click();
await expect(await ProfileScreen.isFollowBackButtonDisplayed()).toBe(true);
await ProfileScreen.goBack();
Expand Down Expand Up @@ -149,10 +150,11 @@ describe('Notifications Flow', () => {
);
});

it('should navigate to tweet view when clicking on the reply icon', async () => {
it('should open reply composer when clicking on the reply icon', async () => {
await AllNotificationsScreen.replyIcon[0].click();
await TweetDetailsScreen.screenTitle.waitForDisplayed();
await expect(await TweetDetailsScreen.isDisplayed()).toBe(true);
await TweetComposerScreen.tweetInput.waitForDisplayed();
await expect(await TweetComposerScreen.isDisplayed()).toBe(true);
await TweetComposerScreen.goBack();
});

it('should show new notifications on refresh', async () => {
Expand All @@ -166,7 +168,7 @@ describe('Notifications Flow', () => {
await AllNotificationsScreen.refresh();
await driver.pause(500);
await AllNotificationsScreen.refresh();
await expect(await AllNotificationsScreen.likeNotifications.length).toBe(5);
await expect(await AllNotificationsScreen.likeNotifications.length).toBe(1);
});
});

Expand Down Expand Up @@ -221,10 +223,11 @@ describe('Notifications Flow', () => {
await expect(await MentionsScreen.retweetCount[0].getText()).toBe(String(initialCount + 1));
});

it('should navigate to mention tweet view when clicking on reply icon in mentions tab', async () => {
it('should open reply composer when clicking on reply icon in mentions tab', async () => {
await MentionsScreen.replyIcon[0].click();
await TweetDetailsScreen.screenTitle.waitForDisplayed();
await expect(await TweetDetailsScreen.isDisplayed()).toBe(true);
await TweetComposerScreen.tweetInput.waitForDisplayed();
await expect(await TweetComposerScreen.isDisplayed()).toBe(true);
await TweetComposerScreen.goBack();
});

it('should handle showing multiple new mention notifications', async () => {
Expand Down
3 changes: 2 additions & 1 deletion e2e/specs/onboarding.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ describe('Onboarding Flow', () => {

it('should show error for short usernames', async () => {
await OnboardingUsernameScreen.screenTitle.waitForDisplayed();
await OnboardingUsernameScreen.enterUsername('ab');
await OnboardingUsernameScreen.enterUsername('a');
await OnboardingUsernameScreen.enterUsername('b');
await expect(await OnboardingUsernameScreen.isShortUsernameErrorMessageDisplayed()).toBe(
true
);
Expand Down
23 changes: 21 additions & 2 deletions e2e/specs/signup.e2e.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, driver } from '@wdio/globals';
import { driver, expect, $ } from '@wdio/globals';

import OnboardingProfilePicScreen from '../pageobjects/Onboarding/OnboardingProfilePicScreen.page';
import SignupStep1Page from '../pageobjects/SignUp/SignupStep1.page';
Expand Down Expand Up @@ -131,7 +131,26 @@ describe('Signup Flow', () => {
describe('Edge Cases', () => {
before(async () => {
await driver.reloadSession();
await driver.pause(10000);
await driver.pause(1500);
const scheme = 'raven';
const packageName = 'space.cmp27.raven';

const metroUrl = 'http://10.0.2.2:8081';
const deepLinkUrl = `${scheme}://expo-development-client/?url=${encodeURIComponent(metroUrl)}`;

await driver.execute('mobile: deepLink', {
url: deepLinkUrl,
package: packageName,
});

try {
const closeButton = await $('~Close');
await closeButton.waitForDisplayed();
await closeButton.click();
await driver.pause(3000);
} catch {
// It didn't appear, carry on.
}
await StartScreen.welcomeText.waitForDisplayed();
await StartScreen.openSignupScreen();
});
Expand Down
10 changes: 7 additions & 3 deletions e2e/specs/tweets.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import LoginPasswordScreen from '../pageobjects/Login/LoginPassword.page';
import StartScreen from '../pageobjects/StartScreen.page';
import TweetComposerScreen from '../pageobjects/Tweets/TweetComposerScreen.page';
import TweetDetailsScreen from '../pageobjects/Tweets/TweetDetailsScreen.page';
import { changeUsername } from '../utils/changeUsername';
import { createTestUser } from '../utils/createTestUser';
import { getAccessToken } from '../utils/getAccessToken';

let testUser;

Expand All @@ -23,6 +25,8 @@ describe('Tweets Flow', () => {

before(async () => {
testUser = await createTestUser();
const accessToken = await getAccessToken(testUser.email, testUser.password);
testUser.username = await changeUsername(accessToken);
await login();
});

Expand Down Expand Up @@ -171,7 +175,7 @@ describe('Tweets Flow', () => {
});

it('should navigate to tweet detail when clicking on a tweet', async () => {
const firstTweet = await FollowingScreen.tweetCard[0];
const firstTweet = await FollowingScreen.tweetCard[2];
await firstTweet.click();
await TweetDetailsScreen.screenTitle.waitForDisplayed();
await expect(await TweetDetailsScreen.isDisplayed()).toBe(true);
Expand All @@ -187,7 +191,7 @@ describe('Tweets Flow', () => {
describe('Thread View Tests', () => {
before(async () => {
await FollowingScreen.screenTitle.waitForDisplayed();
const firstTweet = await FollowingScreen.tweetCard[0];
const firstTweet = await FollowingScreen.tweetCard[2];
await firstTweet.click();
await TweetDetailsScreen.screenTitle.waitForDisplayed();
});
Expand Down Expand Up @@ -221,7 +225,7 @@ describe('Tweets Flow', () => {
let initialReplyCount;

before(async () => {
const firstTweet = await FollowingScreen.tweetCard[0];
const firstTweet = await FollowingScreen.tweetCard[2];
await firstTweet.click();
await TweetDetailsScreen.screenTitle.waitForDisplayed();
initialReplyCount = await TweetDetailsScreen.getReplyCountValue();
Expand Down
2 changes: 1 addition & 1 deletion src/screens/tweets/TweetDetailScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ export default function TweetDetailScreen() {
return (
<KeyboardAvoidingView
behavior={'padding'}
keyboardVerticalOffset={Platform.OS === 'ios' ? 90 : 30}
keyboardVerticalOffset={Platform.OS === 'ios' ? 90 : 60}
style={styles.keyboardAvoid}
accessibilityLabel="tweet-view"
>
Expand Down
Loading