Skip to content

Commit

Permalink
Merge pull request #549 from Satellite-im/luis/failures-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm authored Dec 4, 2023
2 parents 5c16874 + 49c7f39 commit 345db94
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 24 deletions.
31 changes: 11 additions & 20 deletions tests/helpers/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,59 +109,50 @@ export async function saveTestKeys(
// Login or Create Users Functions

export async function createNewUser(username: string) {
const pinScreen = await createPinFirstUser.unlockLayout;
await pinScreen.waitForExist();
await createPinFirstUser.unlockLayout.waitForExist();

// Enter pin for test user
await createPinFirstUser.enterPin("1234");
const createPinButton = await createPinFirstUser.createAccountButton;
await createPinButton.waitForEnabled();
await createPinFirstUser.createAccountButton.waitForEnabled();
await createPinFirstUser.clickOnCreateAccount();

// Enter Username and click on Create Account
await createUserFirstUser.enterUsername(username);
const createUserButton = await createUserFirstUser.createAccountButton;
await createUserButton.waitForEnabled();
await createUserFirstUser.createAccountButton.waitForEnabled();
await createUserFirstUser.clickOnCreateAccount();

// Ensure Main Screen is displayed
const welcomeLayout = await welcomeScreenFirstUser.welcomeLayout;
await welcomeLayout.waitForExist();
await welcomeScreenFirstUser.welcomeLayout.waitForExist();

// Workaround to ensure that user clicks on Add Someone
await welcomeScreenFirstUser.clickAddSomeone();
const friendsLayout = await friendsScreenFirstUser.friendsBody;
await friendsLayout.waitForExist();
await friendsScreenFirstUser.friendsBody.waitForExist();
}

export async function createNewUserSecondInstance(username: string) {
// Reset Pin before creating new user
const unlockLayout = await createPinSecondUser.unlockLayout;
await unlockLayout.waitForExist();
await createPinSecondUser.unlockLayout.waitForExist();
await createPinSecondUser.openHelpButtonMenu();
await createPinSecondUser.clickOnResetAccount();

// Enter pin for test user
await createPinSecondUser.enterPin("1234");
const createPinButton = await createPinSecondUser.createAccountButton;
await createPinButton.waitForEnabled();
await createPinSecondUser.createAccountButton.waitForEnabled();
await createPinSecondUser.clickOnCreateAccount();

// Enter Username and click on Create Account
await createUserSecondUser.enterUsername(username);
const createUserButton = await createUserSecondUser.createAccountButton;
await createUserButton.waitForEnabled();
await createUserSecondUser.createAccountButton.waitForEnabled();
await createUserSecondUser.clickOnCreateAccount();

// Ensure Main Screen is displayed
const welcomeLayout = await welcomeScreenSecondUser.welcomeLayout;
await welcomeLayout.waitForExist();
await welcomeScreenSecondUser.welcomeLayout.waitForExist();

// Workaround to ensure that user clicks on Add Someone
await welcomeScreenSecondUser.clickAddSomeone();
const friendsLayout = await friendsScreenSecondUser.friendsBody;
await friendsLayout.waitForExist();
await friendsScreenSecondUser.friendsBody.waitForExist();
}

export async function loginWithTestUser() {
// Enter pin for test user
const unlockScreen = await createPinFirstUser.unlockLayout;
Expand Down
3 changes: 3 additions & 0 deletions tests/screenobjects/friends/FriendsScreen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -664,16 +664,19 @@ export default class FriendsScreen extends UplinkMainScreen {
}

async goToAllFriendsList() {
await browser.pause(1000);
const allFriendsButton = await this.allFriendsButton;
await allFriendsButton.click();
}

async goToBlockedList() {
await browser.pause(1000);
const blockedListButton = await this.blockedListButton;
await blockedListButton.click();
}

async goToPendingFriendsList() {
await browser.pause(1000);
const pendingFriendsButton = await this.pendingFriendsButton;
await pendingFriendsButton.click();
}
Expand Down
3 changes: 0 additions & 3 deletions tests/specs/reusable-accounts/07-quick-profile.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ export default async function quickProfileTests() {
await chatsInputFirstUser.clickOnInputBar();
await chatsInputFirstUser.typeMessageOnInput("click...");
await chatsInputFirstUser.clickOnSendMessage();
await chatsMessagesFirstUser.waitForMessageSentToExist("click...");
});

it("Chat User A - Validate contents from remote quick profile", async () => {
// With User A - Validate that message was received
await activateFirstApplication();
await chatsInputFirstUser.clickOnInputBar();
await chatsMessagesFirstUser.waitForReceivingMessage("click...");

// Open quick profile from remote user
await chatsMessageGroupsFirstUser.openRemoteQuickProfile();
Expand Down Expand Up @@ -177,7 +175,6 @@ export default async function quickProfileTests() {
// Send message to Chat User B
await chatsInputFirstUser.typeMessageOnInput("Accepted...");
await chatsInputFirstUser.clickOnSendMessage();
await chatsMessagesFirstUser.waitForMessageSentToExist("Accepted...");
});

it("Chat User A - Block Friend", async () => {
Expand Down
1 change: 0 additions & 1 deletion tests/specs/reusable-accounts/08-sidebar-chats.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@ export default async function sidebarChatsTests() {
// Send message to Chat User B
await chatsInputFirstUser.typeMessageOnInput("Hi...");
await chatsInputFirstUser.clickOnSendMessage();
await chatsMessagesFirstUser.waitForMessageSentToExist("Hi...");
});

it("Chat User B - Validate message was received", async () => {
Expand Down

0 comments on commit 345db94

Please sign in to comment.